[lfs-dev] 'ls -l' segfaults on Athlon XP

Bruce Dubbs bruce.dubbs at gmail.com
Sun Feb 22 10:37:58 PST 2015


Pierre Labastie wrote:
> Le 22/02/2015 19:00, Pierre Labastie a écrit :
>> Le 22/02/2015 17:08, Christoph Feikes a écrit :
>>> Hello,
>>>
>>> I'm trying to build LFS according to current 7.7-rc1.
>>> 'ls -l' on a non-empty directory segfaults on Athlon XP as soon as a ls
>>> linked against glibc-2.21 gets installed. When using glibc-2.20 on the
>>> Athlon, all other parameters unchanged, no segfault occurs.
>>>
>>> log entry: kernel: ls[15030]: segfault at 0 ip b76652a4 sp bfe82570
>>> error 6 in libc-2.21.so[b75ed000+1af000]
>>>
>>> The segfault happens, when in coreutils-8.23/src/ls.c the function
>>> align_nstrftime() (line 3663) gets executed, the pointer pfmt returned
>>> from a call to mempcpy() with 0 count to copy points to a bogus address,
>>> and stpcpy() is called with this pointer as a destination address (lines
>>> 3678, 3679).
>>>
>>> I'm suspecting a bug in glibc, specifically in the area of
>>> sysdeps/i386/i686/multiarch, but so far I wasn't able to find it. I
>>> admit I hardly know intel assembler, especially not the unix version.
>>>
>>> Kind regards,
>>> Christoph
>>>
>>>
>>>
>> There seem to be a patch on archlinux, which touches exactly the area you say:
>> https://projects.archlinux.org/svntogit/packages.git/tree/trunk/glibc-2.21-roundup.patch?h=packages/glibc
>> sorry for the broken line.
>> Would it solve your problem?
>> Pierre
>>
> Also on glibc site:
> https://sourceware.org/git/?p=glibc.git;a=patch;h=132a1328eccd20621b77f7810eebbeec0a1af187
>
> (again only one line). Looks like this is only for non SSE2
> CPUs.

Good find Pierre.

See if this works:

sed -e '/ia32/s/^  /1:/' \
     -e '/SSE2/s/^1:/  /' \
     -i  sysdeps/i386/i686/multiarch/mempcpy_chk.S

   -- Bruce



More information about the lfs-dev mailing list