This is the mail archive of the
libffi-discuss@sourceware.org
mailing list for the libffi project.
libffi crashes libgobject when compiled without optimizations
- From: LRN <lrn1986 at gmail dot com>
- To: libffi-discuss at sourceware dot org
- Date: Sat, 09 Mar 2013 16:39:45 +0400
- Subject: libffi crashes libgobject when compiled without optimizations
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I'm using mingw.org i386 gcc 4.7.2
When i compile libffi with -O1, everything works fine.
If i replace "-O1" with " -O0 \
-fauto-inc-dec \
-fcompare-elim \
-fcprop-registers \
-fdce \
-fdefer-pop \
-fdelayed-branch \
-fdse \
-fguess-branch-probability \
-fif-conversion2 \
-fif-conversion \
-fipa-pure-const \
-fipa-profile \
-fipa-reference \
-fmerge-constants \
-fsplit-wide-types \
-ftree-bit-ccp \
-ftree-builtin-call-dce \
-ftree-ccp \
-ftree-ch \
-ftree-copyrename \
-ftree-dce \
-ftree-dominator-opts \
-ftree-dse \
-ftree-forwprop \
-ftree-fre \
-ftree-phiprop \
-ftree-sra \
-ftree-pta \
-ftree-ter \
-funit-at-a-time \
-fomit-frame-pointer \
"
(that is, -O0 and all the optimizations that -O1 enables)
libffi crashes when libgobject is unloaded.
The crash can be reproduced with this program:
#include <windows.h>
#include <stdio.h>
int
main (int argc, char **argv)
{
HMODULE h;
h = LoadLibraryA ("libgobject-2.0-0.dll");
if (h == NULL)
printf ("Failed to loadlib: %lu\n", GetLastError ());
else
FreeLibrary (h);
return 0;
}
The version of glib doesn't matter much (anything released within last
couple of years will do, i think). The version of libffi doesn't
matter either (verified for the first commit after 3.0.10 (i.e. the
one that bumped the interface)).
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQEcBAEBAgAGBQJROy2RAAoJEOs4Jb6SI2CwacoIAIotJT3NBP1AENCtqFDxNV0k
fz9Gs+a08KRojerz57PAlHLjytYrZR/4V1KApW4eB07dL5xPukDZKrAxm0ATW85t
wVWVu3GUznx3m8H9D6X5vMk+3NYgJtkUKylpl4O2XhZ0s+zxg3MYOJNekCE69wgF
pSvs2gkPMhZmVJBUXuuLqoVpzeLEHA7QZmyA45dX0kif77D92RReNaJgVfQwoPLb
/EWF2+OLdHflEW0rzuiZgSBWR+BjFJYJCyk5uAohh7BR71g/PNiA2dvb1c2gq3ai
GSN3PQ7jQOaG4Tc9cuxCuSKx+b0Wodf9u2RCBBPh1dzgkmkYYp0nfuOwJyIOxyI=
=BKaD
-----END PGP SIGNATURE-----