Linux gnu m4 help (was: Re: Error configuring RTEMS 4.7)

Peter Dufault dufault at hda.com
Sun Feb 20 15:22:39 UTC 2005


On Feb 18, 2005, at 10:10 AM, Peter Dufault wrote:

> It is a bug in m4.  I tried the latest. On line 734, src/format.c of 
> GNU m4 1.4.2 it is doing:
>
> sprint(str, fstart, ...

While waiting and hoping that rtem 4.7 now builds for me, I'm trying to 
figure out why I'm seeing the stack overflow in M4 on FreeBSD during 
"bootstrap" and others are not on Linux and Cygwin.

Looking at m4 1.4.2 I see that the corruption is being detected by 
gm4's "src/stackovf.c", which is conditionally included during 
configuration, so maybe it isn't in use on Linux.

Could someone with Linux build GNU m4 1.4.2 with debugging and run the 
following GDB script against it in their rtems 4.7 source directory to 
see if the stack is corrupted but that it isn't being noticed?  I've 
attached it as a ".txt" file to get past the censors.

Run as:
gdb gm4 -x gm4_gdbinit.txt
(or whatever GNU m4 1.4.2 with debugging is on your system)

On FreeBSD I get:

536       fmt = ARG_STR (argc, argv);
format (obs=0x80637e0, argc=1, argv=0x8124010) at format.c:727
727               if (width != -1 && prec != -1)
sizeof(str) is 256 and the format is "%-349s"
(gdb)

showing that the sprintf into str will corrupt the stack.


Thanks,

Peter

Peter Dufault
HD Associates, Inc.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: gm4_gdbinit.txt
URL: <http://lists.rtems.org/pipermail/users/attachments/20050220/360d7e71/attachment-0001.txt>
-------------- next part --------------



More information about the users mailing list