run-parts segfaults with gcc 4.5.0

Denys Vlasenko vda.linux at googlemail.com
Mon May 10 10:59:52 UTC 2010


On Mon, May 10, 2010 at 12:45 PM, Thierry Reding
<thierry.reding at avionic-design.de> wrote:
> * Denys Vlasenko wrote:
>> On Mon, May 10, 2010 at 10:16 AM, Thierry Reding
>> <thierry.reding at avionic-design.de> wrote:
>> > Hi,
>> >
>> > After upgrading gcc to 4.5.0, I get segfaults when running the run-parts
>> > applet. The segfault happens in bb_alphasort() during the calls to strcmp().
>> > I debugged this and saw that the pointers passed into strcmp() were both
>> > NULL. Apparently this comes from the act() function, which for some reason
>> > overwrites the elements of the names array. Oddly enough, when I print that
>> > same array at the end of each call to act() the segfault disappears.
>> >
>> > FWIW, I came up with the following patch that fixes things, though it is
>> > probably not the preferred way for busybox because it removes the names
>> > variable from the global storage.
>>
>> This patch does not fix anything, it just disturbs heisenbug
>> so that it does not happen anymore for you.
>
> I agree that this is not actually a fix for the real cause of the bug. Yet it
> is a workaround that keeps the real culprit (probably gcc in this case) from
> messing things up.
>
>> You need to debug it further.
>
> So you think I should rather take this to the gcc mailing list?

No, you should try to prove it's a gcc bug.
Only then take it to gcc list.

-- 
vda


More information about the busybox mailing list