GNOME Bugzilla – Bug 696892
pygobject-3.8.0 with -fstack-protector-all - test killed by SSP
Last modified: 2013-03-31 22:17:24 UTC
Created attachment 240153 [details] pygobject-3.8.0-build.log libtool: link: gcc -o /var/tmp/portage/dev-python/pygobject-3.8.0/work/pygobject-3.8.0-python2_7/tests/tmp-introspectQnBLlv/.libs/Regress-1.0 -O2 -ggdb -pipe -fstack-protector-all -Wall -Werror=unused-variable -fno-strict-aliasing -std=c9x -Wall -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-sign-compare -Wl,-O1 -Wl,--hash-style=gnu -Wl,--icf=safe /var/tmp/portage/dev-python/pygobject-3.8.0/work/pygobject-3.8.0-python2_7/tests/tmp-introspectQnBLlv/Regress-1.0.o -Wl,--export-dynamic -pthread -Wl,--export-dynamic -Wl,--as-needed -L. ./.libs/libregress.so -lcairo-gobject -lcairo -lgio-2.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -pthread -Wl,-rpath -Wl,/usr/lib64/python2.7/site-packages/pygobject g-ir-compiler Regress-1.0.gir -o Regress-1.0.typelib glib-compile-schemas --targetdir=. --schema-file=org.gnome.test.gschema.xml CHECK Pyflakes skipped, pyflakes not installed CHECK PEP8 skipped, pep8 not installed export `/usr/bin/dbus-launch` && \ PYTHONPATH=..:../tests:${PYTHONPATH:+:$PYTHONPATH} LD_LIBRARY_PATH=./.libs:$LD_LIBRARY_PATH GI_TYPELIB_PATH=.:$GI_TYPELIB_PATH XDG_DATA_DIRS=$XDG_DATA_DIRS:/usr/share MALLOC_PERTURB_=85 MALLOC_CHECK_=3 G_SLICE=debug-blocks TESTS_BUILDDIR=. /usr/bin/python2.7 -Wd ./runtests.py; rc=$?; \ [ "$rc" -ne 0 ] || [ -n "$TEST_NAMES" ] || { TEST_NAMES=compat_test_pygtk PYTHONPATH=..:../tests:${PYTHONPATH:+:$PYTHONPATH} LD_LIBRARY_PATH=./.libs:$LD_LIBRARY_PATH GI_TYPELIB_PATH=.:$GI_TYPELIB_PATH XDG_DATA_DIRS=$XDG_DATA_DIRS:/usr/share MALLOC_PERTURB_=85 MALLOC_CHECK_=3 G_SLICE=debug-blocks TESTS_BUILDDIR=. /usr/bin/python2.7 -Wd -Werror::PendingDeprecationWarning -Werror::DeprecationWarning -Werror::RuntimeWarning ./runtests.py; rc=$?; }; \ kill $DBUS_SESSION_BUS_PID; \ exit $rc *** stack smashing detected ***: python2.7 - terminated python2.7: stack smashing attack in function <unknown> - terminated Report to http://bugs.gentoo.org/ /bin/sh: line 4: 20093 Killed PYTHONPATH=..:../tests:${PYTHONPATH:+:$PYTHONPATH} LD_LIBRARY_PATH=./.libs:$LD_LIBRARY_PATH GI_TYPELIB_PATH=.:$GI_TYPELIB_PATH XDG_DATA_DIRS=$XDG_DATA_DIRS:/usr/share MALLOC_PERTURB_=85 MALLOC_CHECK_=3 G_SLICE=debug-blocks TESTS_BUILDDIR=. /usr/bin/python2.7 -Wd ./runtests.py make[2]: *** [check-local] Error 137 make[2]: Leaving directory `/var/tmp/portage/dev-python/pygobject-3.8.0/work/pygobject-3.8.0-python2_7/tests' make[1]: *** [check-am] Error 2 make[1]: Leaving directory `/var/tmp/portage/dev-python/pygobject-3.8.0/work/pygobject-3.8.0-python2_7/tests'
I was able to reproduce in Python 2.7 and 3.3 using the following options: ./configure CFLAGS="-fstack-protector-all -O2" make clean make make check
This was on a 64 bit machine, note that "-O2" is required in addition to -fstack-protector-all.
Simplified: ./configure CFLAGS="-fstack-protector-all -O2 -g" make clean make python3 -c "from gi.repository import GLib" *** stack smashing detected ***: /usr/local/bin/python3.3 terminated Aborted (core dumped) The detection is occurring during the return of gi/_gobject/pygflags.c:pyg_flags_new __GI_raise() at raise.c:64 0x7ffff7131425 __GI_abort() at abort.c:91 0x7ffff7134b8b __libc_message() at libc_fatal.c:201 0x7ffff716f39e __GI___fortify_fail() at fortify_fail.c:38 0x7ffff720582c __stack_chk_fail() at stack_chk_fail.c:29 0x7ffff72057d0 pyg_flags_new() at pygflags.c:186 0x7ffff4715cfd type_call() at typeobject.c:719 0x42c915 PyObject_Call() at abstract.c:2,082 0x508dda
Fixed with this commit: https://git.gnome.org/browse/pygobject/commit/?id=2259ccac8aa2ec23240 Cherry-picked for 3.8: https://git.gnome.org/browse/pygobject/commit/?h=pygobject-3-8&id=c1fb6516031d3c32abd6 I'm curious to see if this fix has any affect on bug 693121.
Just saw this in IRC... <jzmer> sfeltman: i applied the patch there in the bug and "from gi.repository import GLib" still would cause stack smashing. sfeltman: the only way for me to avoid, as is documented in the bug report, is to drop O2 <jzmer> thanks for point that out. You might need to do a "make install" for it to be picked up? Curious because I am definitely able to reproduce the bug and verify the given commit fixes it (at least on my system). What system architecture are you on?