Hello,

At 15:52 +0200 on 2014-4-26 Martin Costabel wrote:
 >
 > I finally found the reason for the crash (don't ask me how...)
 > In my opinion it is a bug in clang, but of the kind that is unlikely to 
 > get fixed. In objects.c, clang incorrectly thinks that the variable 
 > r->flag is uninitialized; the static analyzer emits a warning:
 > 
 > objects.c:332:24: warning: The left expression of the compound 
 > assignment is an uninitialized value. The computed value will also
 >        be garbage
 >                 r->flag &= ~(ISPERMANENT(ON) | ISIMMORTAL(ON));
 >                 ~~~~~~~ ^
 >
 > Then, from a certain optimization level on (-Oz, -Os, -O2), it concludes 
 > that since this is garbage anyway, it does not need to execute the 
 > compound statement and may as well do nothing or put 0 into r->flag. The 
 > result is that all the structures that use the function t1_Allocate will 
 > then indeed have garbage in the corresponding field, with the segfault 
 > as a final consequence.

Wow, that's real detective work. :-) I am not sure I would call the
issue a compiler bug, it's just life with pointers.  It seams
unreasonable to expect the compiler to keep track of all the
references to an object (which in this case get created through a
macro no less), but then the previous clang versions seem to be able
to do just that at least in this case (this, or they just ignore this
particular chance to optimize...).

In any event, the fix works for me at least in the sense that xdvik is
quite happy with the new t1lib (don't really know what else to test).
Many thanks!

Best regards,
Stefan

-- 
If it was so, it might be; and if it were so, it would be; but as it 
isn't, it ain't.  That's logic.  --Lewis Carroll, Through the Looking-Glass

No HTML emails and proprietary attachments please <http://bruda.ca/ascii>

------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
Fink-users mailing list
Fink-users@lists.sourceforge.net
List archive:
http://news.gmane.org/gmane.os.macosx.fink.user
Subscription management:
https://lists.sourceforge.net/lists/listinfo/fink-users

Reply via email to