develooper Front page | perl.perl5.porters | Postings from December 2009

Intermittent "*** buffer overflow detected ***" errors with -D_FORTIFY_SOURCE=2 (?)

Thread Next
From:
Cosimo Streppone
Date:
December 5, 2009 09:17
Subject:
Intermittent "*** buffer overflow detected ***" errors with -D_FORTIFY_SOURCE=2 (?)
Message ID:
b8d18bf90912050917j75b14459qfdbfa8035241e3d8@mail.gmail.com
Hi perl5-porters,

I'm trying to work on an "interesting" problem.
It regards an XS module I wrote some time ago.
This module used to work perfectly under various Linux distributions,
including RHEL4, and Win32.

Now, with RHEL5, it's been reported to crash with "*** buffer overflow
detected ***" messages,
presumably when using `call_sv()' from XS code.

After digging a bit into the problem, it seems that the use of
-D_FORTIFY_SOURCE=2
in conjunction with and -O2 in $CFLAGS is causing these (fake?) buffer
overflows.

Actually the problems are intermittent: that is, if I run the test
suite of the module,
it fails maybe 40%-50% of the times. Horrible.

Reading briefly about _FORTIFY_SOURCE=2 from people having the same problem,
it would seem to me that it is just a really bad idea to have that enabled
for a perl (interpreter and modules) installation. Unfortunately, this
is the default in $CFLAGS for RHEL5.

So, coming to the question, has any of you dealt with this before?
Any advice?

-- 
Cosimo

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About