[Bug 1885332] Re: Error in user-mode calculation of ELF aux vector's AT_PHDR

2021-05-12 Thread Thomas Huth
This is an automated cleanup. This bug report has been moved to QEMU's new bug tracker on gitlab.com and thus gets marked as 'expired' now. Please continue with the discussion here: https://gitlab.com/qemu-project/qemu/-/issues/275 ** Changed in: qemu Status: New => Expired ** Bug watch

[Bug 1885332] Re: Error in user-mode calculation of ELF aux vector's AT_PHDR

2021-05-07 Thread Langston
** Changed in: qemu Status: Incomplete => New -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1885332 Title: Error in user-mode calculation of ELF aux vector's AT_PHDR Status in QEMU: New

[Bug 1885332] Re: Error in user-mode calculation of ELF aux vector's AT_PHDR

2021-05-06 Thread Thomas Huth
The QEMU project is currently moving its bug tracking to another system. For this we need to know which bugs are still valid and which could be closed already. Thus we are setting the bug state to "Incomplete" now. If the bug has already been fixed in the latest upstream version of QEMU, then plea

[Bug 1885332] Re: Error in user-mode calculation of ELF aux vector's AT_PHDR

2020-07-13 Thread Dmitry
Built the latest QEMU, the issue goes away $ bin/debug/native/s390x-linux-user/qemu-s390x --version qemu-s390x version 5.0.50 (v5.0.0-2358-g6c87d9f311-dirty) Copyright (c) 2003-2020 Fabrice Bellard and the QEMU Project developers $ bin/debug/native/s390x-linux-user/qemu-s390x ../njs/njs-s390 -c

[Bug 1885332] Re: Error in user-mode calculation of ELF aux vector's AT_PHDR

2020-07-11 Thread Dmitry
When I switch to armv7 the issue goes away $ cat Dockerfile.armv7 FROM arm32v7/ubuntu RUN apt-get update && \ apt-get install -y \ gcc make libpcre3-dev libreadline-dev git RUN cd /home && git clone https://github.com/nginx/njs RUN cd /home/njs && ./configure --cc-opt='-O0 -static -lm -

[Bug 1885332] Re: Error in user-mode calculation of ELF aux vector's AT_PHDR

2020-07-10 Thread Dmitry
@Langston will do tomorrow. s390x ABI requires heavy changes to the python script. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1885332 Title: Error in user-mode calculation of ELF aux vector's A

[Bug 1885332] Re: Error in user-mode calculation of ELF aux vector's AT_PHDR

2020-07-10 Thread Langston
@Dimitry To confirm that this is really the same issue (and not an unrelated crash in the same function), could you post: 1. the ELF headers ("readelf -h"), 2. the program headers ("readelf -l"), and 3. the output (the AUX VECTOR section) from this GDB script (suitably modified for your progra

[Bug 1885332] Re: Error in user-mode calculation of ELF aux vector's AT_PHDR

2020-07-10 Thread Dmitry
> runs just fine on top of the Linux kernel in QEMU full-system emulation, but crashes before main in user-mode emulation So it seems system vs user-mode is not the issue here, probably it is related to gdb mode in user-mode qemu. -- You received this bug notification because you are a member of

[Bug 1885332] Re: Error in user-mode calculation of ELF aux vector's AT_PHDR

2020-07-10 Thread Dmitry
@langston0 Thanks for detailed explanation, got the same problem for qemu-s390. The way to reproduce (linux kernel >= 4.8, for example: Ubuntu 18.04): # Register qemu binfmt_misc handlers $ docker run --rm --privileged multiarch/qemu-user-static --reset -p yes $ cat Dockerfile.s390x FROM s390x/

[Bug 1885332] Re: Error in user-mode calculation of ELF aux vector's AT_PHDR

2020-07-10 Thread Dmitry
BTW, before "sudo bash -c "echo -1 > /proc/sys/fs/binfmt_misc/qemu- s390x" njs-s390 also works on the host: $ ./njs-s390 -c 'console.log("hello")' hello $ file njs-s390 njs-s390: ELF 64-bit MSB executable, IBM S/390, version 1 (GNU/Linux), statically linked, BuildID[sha1]=e37618578fb0a8c60f4268

[Bug 1885332] Re: Error in user-mode calculation of ELF aux vector's AT_PHDR

2020-06-29 Thread Langston
Taking a peek at how Linux and QEMU calculate AT_PHDR for static binaries reveals the following. Both involve the program headers' offset (e_phoff) added to a value I'll call load_addr (as in the kernel). In the kernel, load_addr is elf_ppnt->p_vaddr - elf_ppnt->p_offset where elf_ppnt is the

[Bug 1885332] Re: Error in user-mode calculation of ELF aux vector's AT_PHDR

2020-06-26 Thread Langston
I just confirmed that this is still a problem on git tag v5.0.0, where I applied the following: diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 619c054cc4..093656d059 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -2016,6 +2016,7 @@ static abi_ulong create