Apache OpenOffice (AOO) Bugzilla – Issue 77485
dbmgr.cxx: zero terminated varargs function throws SIGSEGV
Last modified: 2013-08-07 14:42:39 UTC
Different promotion for 0 (zero) and NULL at the end of varargs function. Zero throws SIGSEGV signal because it isn't considered to pointed to NULL.
Created attachment 45226 [details] patch replace zero by NULL
Yeah, because a 0 is just an int and isn't promoted to a 64bit pointer on x86_64 in this case because the method signature has an ... eclipse and so when the loop to look for a 0 pointer is run there is no long on the stack, just an int. ugh! cmc->kendy, pjanik: if either of you wants to snarf this go ahead, otherwise I'll pick it up next week. We may have more of this type of monstrosity floating around.
better do this myself, I have a workspace open. I'll first have a scan for problems in other uses of these ellipsed methods.
Search for other by temporarily renaming the method, built OOo, checked the missing ones. Only sw has some of the Execute( ..., 0), everyplace else has Execute( ..., 0L) or Execute(..., NULL) so just a few places in sw to be modified. Done in cmcfixes34.
reassign for a quick look-see. cmc->kendy: Can I get you to verify this. Looks straightforward to me, make a few places in sw the same as everywhere else.
caolan: My personal preference would be to use (void *) NULL, but 0L does as good job I guess, so - verified ;-) Thank you!
oh, for reference, I went for 0L not (void*)0 or static_cast<void*>(0) because the root of the hierarchy of this is sfx2 and 0L is used consistently there and throughout the majority of OOo, so aligned the offending code with the most consistent style.
OK, everything is perfect then, thank you once more!
*** Issue 71750 has been marked as a duplicate of this issue. ***
This issue is closed automatically and wasn't rechecked in a current version of OOo. The fixed issue should be integrated in OOo since more than half a year. If you think this issue isn't fixed in a current version (OOo 3.1), please reopen it and change the field 'Target Milestone' accordingly. If you want to download a current version of OOo => http://download.openoffice.org/index.html If you want to know more about the handling of fixed/verified issues => http://wiki.services.openoffice.org/wiki/Handle_fixed_verified_issues