Tracker: Patches

5 Patch for GCC 4.7 - ID: 3474660
Last Update: Comment added ( sds )

I maintain the Fedora Clisp package. We were recently asked to compile all of our packages with what will soon be GCC 4.7, in order to find bugs. Clisp built, but failed a socket test on 32-bit x86. The current code uses a get_hostname() macro in socket.d that is unsafe. It creates a character array on the stack, saves a pointer to the first element of the array, exits the scope in which the array is defined, then accesses the (now out of scope) array via the pointer. A C compiler is free to reuse the stack space of out of scope variables, and it appears that GCC 4.7 does in fact do so, at least on 32-bit x86. This is the patch I applied to the Fedora build of Clisp in order to address this issue.


Jerry James ( jjames ) - 2012-01-16 20:49:31 PST

5

Closed

Accepted

Sam Steingold

None

None

Public


Comment ( 1 )

Date: 2012-02-02 12:40:21 PST
Sender: sdsProject AdminAccepting Donations

I applied a slightly different patch.
thanks.


Attached File ( 1 )

Filename Description Download
clisp-hostname.patch Patch to fix accessing an out of scope array Download

Changes ( 7 )

Field Old Value Date By
resolution_id None 2012-02-02 12:40:21 PST sds
allow_comments 1 2012-02-02 12:40:21 PST sds
close_date - 2012-02-02 12:40:21 PST sds
status_id Open 2012-02-02 12:40:21 PST sds
assigned_to haible 2012-02-02 12:40:21 PST sds
assigned_to nobody 2012-01-16 21:46:48 PST sds
File Added 433226: clisp-hostname.patch 2012-01-16 20:49:33 PST jjames