other/10284: mmap test configury - subtle breakage exposed by corner case

gschafer@zip.com.au gschafer@zip.com.au
Tue Apr 1 04:46:00 GMT 2003


>Number:         10284
>Category:       other
>Synopsis:       mmap test configury - subtle breakage exposed by corner case
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 01 04:46:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Greg Schafer
>Release:        3.2.2, 3.3, 3.4
>Organization:
>Environment:
i686-pc-linux-gnu
>Description:
Under normal conditions gcc configure will report:-

checking for working mmap from /dev/zero... yes
checking for working mmap with MAP_ANON(YMOUS)... yes

But in the conditions described below it erroneously reports:-

checking for working mmap from /dev/zero... no
checking for working mmap with MAP_ANON(YMOUS)... no

Investigation has revealed that the problem happens only when the "/etc/ld.so.cache" file is less than 1 memory page in size. This can happen for example when building up a new system inside a chroot environment.

It appears to be a subtle timing issue as evidenced by the strace logs and analysis contained in the thread that starts here:-

http://archive.linuxfromscratch.org/mail-archives/lfs-dev/2003/03/0170.html
>How-To-Repeat:
Configure gcc in an environment where the "/etc/ld.so.cache" file is less than 1 memory page in size. NOTE - rm'ing the cache file does NOT reproduce the problem.
>Fix:
A patch has been worked up by:-

Donald Smith <dss-lfs@cfl.rr.com>

I've tested it thoroughly and it does the right thing on my platform and in the conditions described above. Patch is attached.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/x-gunzip; name="gcc-3.2.2.mmap_test.patch.gz"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="gcc-3.2.2.mmap_test.patch.gz"

H4sICH0/dD4AA2djYy0zLjIuMi5tbWFwX3Rlc3QucGF0Y2gAfVJdb9MwFH1ufsVhL6R1k+aj66aG
Si1iSEiAeOC9ylwnNUviynbUZhP/netkZSBYHUV2fM+559x7s5NFgaD9qlFyHqRhQo/SspzR54yr
ppBlq8VL8O97LwiCi8RREkVpECVBNEccL+Ob5XwRRucFFsdR5DHGXhN45qdBvEASLeNoGaX/8Ndr
BPMkWkwXYP1+g/XagxXGblP4Yw9PHgC+zzUmpykmHb2PmccA2VjIzIOLn7BC3qimzg/wD+U4c5ey
gE+BFfyBPv6y+bb9uPn0+e7D+Fk4ng/C8fU0SXvlgda9RoNbB6G10ltxkhb+lfOKFLXTTq6miK+d
vMdmE2xg2ntbCeicC1BndtJK1UBx3mqD4140sHuBahcaFfKc07mQhJcGlTCGgjmhG+HqRS1qpTsc
8pIADYx8FCG+7wnL89YI06eiFPwBVqHIZTUoNErXeVV1ILtH1Va75q0N+4zvBRmkX4TgObdtDyqF
7RPZI13ufpBx6nMc9KpalGTfhMBk5jGXolAavqTuRxkk3uGWNsbGoOIrWZMgpb6F1ZLsOY5r39Ow
nTv9ZkXjY6CpeWxEsdEwzi7rj93LZIfBusuLI3KASzNKzzNio59nJ6Iyoifea5E/ZM5+qazr/G/X
hPX+5xlDSfizpJULB334F93oPzelAwAA



More information about the Gcc-prs mailing list