mailing list of musl libc
 help / color / Atom feed
* [musl] Crash on (qemu'ed) s390x doing prlimit call after probing stack size
@ 2020-02-25 22:07 Tobias Koch
  2020-02-26  9:56 ` Szabolcs Nagy
  0 siblings, 1 reply; 2+ messages in thread
From: Tobias Koch @ 2020-02-25 22:07 UTC (permalink / raw)
  To: musl

Hi,

I have some programs crashing on me under QEMU s390x user emulation. I 
see them probe the stack size using mremaps and then do a prlimit as in 
this snippet

24948 mremap(274877911040,4096,8192,0,0,56) = -1 errno=12 (Cannot 
allocate memory)
24948 mremap(274877906944,4096,8192,0,0,56) = -1 errno=12 (Cannot 
allocate memory)
24948 mremap(274877902848,4096,8192,0,0,56) = -1 errno=14 (Bad address)
24948 prlimit64(0,3,0,274889373840,274879934536,56) = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=1, si_addr=0x0000004000001000} ---
Segmentation fault

The same programs on other 64bit arches (such as aarch64 or powerpc64le) 
emluated with QEMU work OK. I'm trying to understand, what musl is doing 
here and why QEMU cannot handle it.Any pointers would be appreciated.

Tobias


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [musl] Crash on (qemu'ed) s390x doing prlimit call after probing stack size
  2020-02-25 22:07 [musl] Crash on (qemu'ed) s390x doing prlimit call after probing stack size Tobias Koch
@ 2020-02-26  9:56 ` Szabolcs Nagy
  0 siblings, 0 replies; 2+ messages in thread
From: Szabolcs Nagy @ 2020-02-26  9:56 UTC (permalink / raw)
  To: Tobias Koch; +Cc: musl

* Tobias Koch <tobias.koch@nonterra.com> [2020-02-26 01:07:58 +0300]:
> I have some programs crashing on me under QEMU s390x user emulation. I see
> them probe the stack size using mremaps and then do a prlimit as in this
> snippet
> 
> 24948 mremap(274877911040,4096,8192,0,0,56) = -1 errno=12 (Cannot allocate
> memory)
> 24948 mremap(274877906944,4096,8192,0,0,56) = -1 errno=12 (Cannot allocate
> memory)
> 24948 mremap(274877902848,4096,8192,0,0,56) = -1 errno=14 (Bad address)
> 24948 prlimit64(0,3,0,274889373840,274879934536,56) = 0
> --- SIGSEGV {si_signo=SIGSEGV, si_code=1, si_addr=0x0000004000001000} ---
> Segmentation fault

i'd use

qemu-s390x -d page -strace exe

to see how 0x0000004000001000 is mapped and then

qemu-s390x -d page,in_asm,cpu,nochain -strace exe

to see the exact failing instruction, that may give a hint.

> 
> The same programs on other 64bit arches (such as aarch64 or powerpc64le)
> emluated with QEMU work OK. I'm trying to understand, what musl is doing
> here and why QEMU cannot handle it.Any pointers would be appreciated.
> 
> Tobias

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-25 22:07 [musl] Crash on (qemu'ed) s390x doing prlimit call after probing stack size Tobias Koch
2020-02-26  9:56 ` Szabolcs Nagy

mailing list of musl libc

Archives are clonable: git clone --mirror http://inbox.vuxu.org/musl

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.musl


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git