POWER: Unexpected fault when writing to brk-allocated memory
Florian Weimer
fweimer at redhat.com
Sun Nov 5 23:35:40 AEDT 2017
On 11/05/2017 01:18 PM, Nicholas Piggin wrote:
> There was a recent change to move to 128TB address space by default,
> and option for 512TB addresses if explicitly requested.
Do you have a commit hash for the introduction of 128TB by default? Thanks.
> Your brk request asked for > 128TB which the kernel gave it, but the
> address limit in the paca that the SLB miss tests against was not
> updated to reflect the switch to 512TB address space.
>
> Why is your brk starting so high? Are you trying to test the > 128TB
> case, or maybe something is confused by the 64->128TB change? What's
> the strace look like if you run on a distro or <= 4.10 kernel?
I think it is a consequence of running with an explicit loader
invocation. With that, the heap is placed above ld.so, which can be
quite high in the address space.
I'm attaching two runs of cat, one executing directly as /bin/cat, and
one with /lib64/ld64.so.1 /bin/cat.
Fortunately, this does *not* apply to PIE binaries (also attached).
However, explicit loader invocations are sometimes used in test suites
(not just for glibc), and these sporadic test failures are quite annoying.
Do you still need the strace log? And if yes, of what exactly?
> Something like the following patch may help if you could test.
Okay, this will take some time.
Thanks,
Florian
-------------- next part --------------
1231d0000-1231e0000 r-xp 00000000 fd:00 17852425 /root/a.out
1231e0000-1231f0000 r--p 00000000 fd:00 17852425 /root/a.out
1231f0000-123200000 rw-p 00010000 fd:00 17852425 /root/a.out
1000dbc0000-1000dbf0000 rw-p 00000000 00:00 0 [heap]
7fffa31d0000-7fffa3400000 r-xp 00000000 fd:00 25167936 /usr/lib64/power8/libc-2.25.so
7fffa3400000-7fffa3410000 ---p 00230000 fd:00 25167936 /usr/lib64/power8/libc-2.25.so
7fffa3410000-7fffa3420000 r--p 00230000 fd:00 25167936 /usr/lib64/power8/libc-2.25.so
7fffa3420000-7fffa3430000 rw-p 00240000 fd:00 25167936 /usr/lib64/power8/libc-2.25.so
7fffa3440000-7fffa3460000 r-xp 00000000 00:00 0 [vdso]
7fffa3460000-7fffa34a0000 r-xp 00000000 fd:00 8390329 /usr/lib64/ld-2.25.so
7fffa34a0000-7fffa34b0000 r--p 00030000 fd:00 8390329 /usr/lib64/ld-2.25.so
7fffa34b0000-7fffa34c0000 rw-p 00040000 fd:00 8390329 /usr/lib64/ld-2.25.so
7fffe9450000-7fffe9480000 rw-p 00000000 00:00 0 [stack]
-------------- next part --------------
7fff7e790000-7fff7e7d0000 rw-p 00000000 00:00 0
7fff7e7d0000-7fff7e830000 r--p 00000000 fd:00 25167925 /usr/lib/locale/en_US.utf8/LC_CTYPE
7fff7e830000-7fff7e840000 r--p 00000000 fd:00 25167928 /usr/lib/locale/en_US.utf8/LC_NUMERIC
7fff7e840000-7fff7e850000 r--p 00000000 fd:00 16798929 /usr/lib/locale/en_US.utf8/LC_TIME
7fff7e850000-7fff7e980000 r--p 00000000 fd:00 25167924 /usr/lib/locale/en_US.utf8/LC_COLLATE
7fff7e980000-7fff7e990000 r--p 00000000 fd:00 16798927 /usr/lib/locale/en_US.utf8/LC_MONETARY
7fff7e990000-7fff7e9a0000 r--p 00000000 fd:00 2511 /usr/lib/locale/en_US.utf8/LC_MESSAGES/SYS_LC_MESSAGES
7fff7e9a0000-7fff7e9b0000 r--p 00000000 fd:00 16798942 /usr/lib/locale/en_US.utf8/LC_PAPER
7fff7e9b0000-7fff7e9c0000 r--p 00000000 fd:00 25167927 /usr/lib/locale/en_US.utf8/LC_NAME
7fff7e9c0000-7fff7e9d0000 r--p 00000000 fd:00 16798924 /usr/lib/locale/en_US.utf8/LC_ADDRESS
7fff7e9d0000-7fff7e9e0000 r--p 00000000 fd:00 16798928 /usr/lib/locale/en_US.utf8/LC_TELEPHONE
7fff7e9e0000-7fff7e9f0000 r--p 00000000 fd:00 16798926 /usr/lib/locale/en_US.utf8/LC_MEASUREMENT
7fff7e9f0000-7fff7ea00000 r--s 00000000 fd:00 8390669 /usr/lib64/gconv/gconv-modules.cache
7fff7ea00000-7fff7ec30000 r-xp 00000000 fd:00 25167936 /usr/lib64/power8/libc-2.25.so
7fff7ec30000-7fff7ec40000 ---p 00230000 fd:00 25167936 /usr/lib64/power8/libc-2.25.so
7fff7ec40000-7fff7ec50000 r--p 00230000 fd:00 25167936 /usr/lib64/power8/libc-2.25.so
7fff7ec50000-7fff7ec60000 rw-p 00240000 fd:00 25167936 /usr/lib64/power8/libc-2.25.so
7fff7ec60000-7fff7ec70000 r--p 00000000 fd:00 16798925 /usr/lib/locale/en_US.utf8/LC_IDENTIFICATION
7fff7ec70000-7fff7ec80000 r-xp 00000000 fd:00 202293 /usr/bin/cat
7fff7ec80000-7fff7ec90000 r--p 00000000 fd:00 202293 /usr/bin/cat
7fff7ec90000-7fff7eca0000 rw-p 00010000 fd:00 202293 /usr/bin/cat
7fff7eca0000-7fff7ecc0000 r-xp 00000000 00:00 0 [vdso]
7fff7ecc0000-7fff7ed00000 r-xp 00000000 fd:00 8390329 /usr/lib64/ld-2.25.so
7fff7ed00000-7fff7ed10000 r--p 00030000 fd:00 8390329 /usr/lib64/ld-2.25.so
7fff7ed10000-7fff7ed20000 rw-p 00040000 fd:00 8390329 /usr/lib64/ld-2.25.so
7fff9be20000-7fff9be50000 rw-p 00000000 00:00 0 [heap]
7ffffd470000-7ffffd4a0000 rw-p 00000000 00:00 0 [stack]
-------------- next part --------------
13eea0000-13eeb0000 r-xp 00000000 fd:00 202293 /usr/bin/cat
13eeb0000-13eec0000 r--p 00000000 fd:00 202293 /usr/bin/cat
13eec0000-13eed0000 rw-p 00010000 fd:00 202293 /usr/bin/cat
1003ebe0000-1003ec10000 rw-p 00000000 00:00 0 [heap]
7fff97490000-7fff974d0000 rw-p 00000000 00:00 0
7fff974d0000-7fff97530000 r--p 00000000 fd:00 25167925 /usr/lib/locale/en_US.utf8/LC_CTYPE
7fff97530000-7fff97540000 r--p 00000000 fd:00 25167928 /usr/lib/locale/en_US.utf8/LC_NUMERIC
7fff97540000-7fff97550000 r--p 00000000 fd:00 16798929 /usr/lib/locale/en_US.utf8/LC_TIME
7fff97550000-7fff97680000 r--p 00000000 fd:00 25167924 /usr/lib/locale/en_US.utf8/LC_COLLATE
7fff97680000-7fff97690000 r--p 00000000 fd:00 16798927 /usr/lib/locale/en_US.utf8/LC_MONETARY
7fff97690000-7fff976a0000 r--p 00000000 fd:00 2511 /usr/lib/locale/en_US.utf8/LC_MESSAGES/SYS_LC_MESSAGES
7fff976a0000-7fff976b0000 r--p 00000000 fd:00 16798942 /usr/lib/locale/en_US.utf8/LC_PAPER
7fff976b0000-7fff976c0000 r--p 00000000 fd:00 25167927 /usr/lib/locale/en_US.utf8/LC_NAME
7fff976c0000-7fff976d0000 r--p 00000000 fd:00 16798924 /usr/lib/locale/en_US.utf8/LC_ADDRESS
7fff976d0000-7fff976e0000 r--p 00000000 fd:00 16798928 /usr/lib/locale/en_US.utf8/LC_TELEPHONE
7fff976e0000-7fff976f0000 r--p 00000000 fd:00 16798926 /usr/lib/locale/en_US.utf8/LC_MEASUREMENT
7fff976f0000-7fff97700000 r--s 00000000 fd:00 8390669 /usr/lib64/gconv/gconv-modules.cache
7fff97700000-7fff97930000 r-xp 00000000 fd:00 25167936 /usr/lib64/power8/libc-2.25.so
7fff97930000-7fff97940000 ---p 00230000 fd:00 25167936 /usr/lib64/power8/libc-2.25.so
7fff97940000-7fff97950000 r--p 00230000 fd:00 25167936 /usr/lib64/power8/libc-2.25.so
7fff97950000-7fff97960000 rw-p 00240000 fd:00 25167936 /usr/lib64/power8/libc-2.25.so
7fff97960000-7fff97970000 r--p 00000000 fd:00 16798925 /usr/lib/locale/en_US.utf8/LC_IDENTIFICATION
7fff97970000-7fff97990000 r-xp 00000000 00:00 0 [vdso]
7fff97990000-7fff979d0000 r-xp 00000000 fd:00 8390329 /usr/lib64/ld-2.25.so
7fff979d0000-7fff979e0000 r--p 00030000 fd:00 8390329 /usr/lib64/ld-2.25.so
7fff979e0000-7fff979f0000 rw-p 00040000 fd:00 8390329 /usr/lib64/ld-2.25.so
7fffdd110000-7fffdd140000 rw-p 00000000 00:00 0 [stack]
More information about the Linuxppc-dev
mailing list