From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.2 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by inbox.vuxu.org (OpenSMTPD) with SMTP id 076e293b for ; Wed, 26 Feb 2020 09:56:38 +0000 (UTC) Received: (qmail 7550 invoked by uid 550); 26 Feb 2020 09:56:36 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 7532 invoked from network); 26 Feb 2020 09:56:36 -0000 Date: Wed, 26 Feb 2020 10:56:24 +0100 From: Szabolcs Nagy To: Tobias Koch Cc: musl@lists.openwall.com Message-ID: <20200226095624.GG14278@port70.net> Mail-Followup-To: Tobias Koch , musl@lists.openwall.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Subject: Re: [musl] Crash on (qemu'ed) s390x doing prlimit call after probing stack size * Tobias Koch [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