[Bug 658509] New: _FORTIFY_SOURCE wrappers for memmove and bcopy are wrong
https://bugzilla.novell.com/show_bug.cgi?id=658509 https://bugzilla.novell.com/show_bug.cgi?id=658509#c0 Summary: _FORTIFY_SOURCE wrappers for memmove and bcopy are wrong Classification: openSUSE Product: openSUSE 11.4 Version: Factory Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem AssignedTo: rguenther@novell.com ReportedBy: rguenther@novell.com QAContact: qa@suse.de CC: pbaudis@novell.com Found By: Development Blocker: --- extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) void * __attribute__ ((__nothrow__)) memmove (void *__restrict __dest, __const void *__restrict __src, size_t __len) { return __builtin___memmove_chk (__dest, __src, __len, __builtin_object_size (__dest, 0)); } and the bcopy variant wrongly use restrict qualified arguments. This leads the optimizer in newer GCC to the conclusion that the memory regions pointed to by dest and src do not overlap. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=658509
https://bugzilla.novell.com/show_bug.cgi?id=658509#c1
Cristian Rodríguez
https://bugzilla.novell.com/show_bug.cgi?id=658509
https://bugzilla.novell.com/show_bug.cgi?id=658509#c2
--- Comment #2 from Richard Guenther
https://bugzilla.novell.com/show_bug.cgi?id=658509
https://bugzilla.novell.com/show_bug.cgi?id=658509#c3
Stefan Krah
from cdecimal import * Decimal(111111111222222222333333333) Decimal('111111111111111111111111111')
I can work around this by specifying -U_FORTIFY_SOURCE in setup.py:
from cdecimal import * Decimal(111111111222222222333333333) Decimal('111111111222222222333333333')
-- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=658509
https://bugzilla.novell.com/show_bug.cgi?id=658509#c4
--- Comment #4 from Marcus Meissner
https://bugzilla.novell.com/show_bug.cgi?id=658509
https://bugzilla.novell.com/show_bug.cgi?id=658509#c5
--- Comment #5 from Stefan Krah
better way is of course to patch the glibc headers.
Well yes, but until those patches are widely in use, I'm going to play it safe and make -U_FORTIFY_SOURCE the default for cdecimal. The problem is that users will blame the application and not their toolchain. Will the glibc patches be backported to 11.3? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=658509
https://bugzilla.novell.com/show_bug.cgi?id=658509#c6
--- Comment #6 from Marcus Meissner
https://bugzilla.novell.com/show_bug.cgi?id=658509
https://bugzilla.novell.com/show_bug.cgi?id=658509#c7
--- Comment #7 from Marcus Meissner
https://bugzilla.novell.com/show_bug.cgi?id=658509
https://bugzilla.novell.com/show_bug.cgi?id=658509#c8
--- Comment #8 from Stefan Krah
as this seems only gcc 4.6, whihc is not yet released, please put pressure on people to fix their glibcs.
Right. I decided to detect this in ./configure, using a variation of the
the code that Richard Guenther posted elsewhere. In case someone finds this
thread searching for a solution, this works for me:
AC_MSG_CHECKING(for glibc _FORTIFY_SOURCE/memmove bug)
saved_cflags="$CFLAGS"
CFLAGS="-O2 -D_FORTIFY_SOURCE=2"
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include
https://bugzilla.novell.com/show_bug.cgi?id=658509
https://bugzilla.novell.com/show_bug.cgi?id=658509#c9
Richard Guenther
participants (1)
-
bugzilla_noreply@novell.com