Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
user mode qemu-arm : unsupported syscalls
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM
View previous topic :: View next topic  
Author Message
xaviermiller
Administrator
Administrator


Joined: 23 Jul 2004
Posts: 7582
Location: ~Brussels - Belgique

PostPosted: Sat Sep 23, 2017 7:01 pm    Post subject: user mode qemu-arm : unsupported syscalls Reply with quote

Hi!

I'm using qemu-arm in user mode to chroot an armv6j image (Raspberry Pi).

When emerging (instal phase), I got the following messages :
Code:
qemu: Unsupported syscall: 383
scanelf: seccomp_load failed: Bad address

or
Code:
qemu: Unsupported syscall: 391


Running locale-gen, I got:
Code:
# locale-gen
 * Generating 8 locales (this might take a while) with 4 jobs
 *  (1/8) Generating en_US.ISO-8859-1 ...
localedef: ../sysdeps/unix/sysv/linux/spawni.c:366: __spawnix: Assertion `ec >= 0' failed.
qemu: uncaught target signal 6 (Aborted) - core dumped                                                                                                                                                                                  [ !! ]


I have to run it on the Raspberry Pi to get is successful.

Is there a configuration problem on the host?
Can I fix something to not have those errors?
_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
n05ph3r42
n00b
n00b


Joined: 11 Jul 2016
Posts: 68

PostPosted: Mon Oct 02, 2017 5:30 pm    Post subject: Reply with quote

HIYA.
Same situation, but actually it affects not only locale-gen. It affects bunch of other packages, producing same error while emerging (iproute for example):
Code:

armv7a-hardfloat-linux-gnueabi-gcc -Wall -Wstrict-prototypes  -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -Wformat=2 -O2 -pipe -fomit-frame-pointer -ftree-vectorize -march=armv7-a -mtune=cortex-a9 -mfpu=vfpv3-d16 -mfloat-abi=hard  -I../include -DRESOLVE_HOSTNAMES -DLIBDIR=\"/lib\" -DCONFDIR=\"/etc/iproute2\" -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -O2 -pipe -fomit-frame-pointer -ftree-vectorize -march=armv7-a -mtune=cortex-a9 -mfpu=vfpv3-d16 -mfloat-abi=hard -DHAVE_SETNS -DHAVE_LIBMNL  -DCONFIG_GACT -DCONFIG_GACT_PROB -DIPT_LIB_DIR=\"/usr/lib/xtables\" -DYY_NO_INPUT   -c -o m_ematch.o m_ematch.c
bison -d -t -v -o emp_ematch.yacc.c emp_ematch.y
bison: ../sysdeps/unix/sysv/linux/spawni.c:366: __spawnix: Assertion `ec >= 0' failed.
qemu: uncaught target signal 6 (Aborted) - core dumped
make[1]: *** [Makefile:178: emp_ematch.yacc.c] Aborted
make[1]: *** Waiting for unfinished jobs....
/usr/share/bison/c-skel.m4:20: error: invalid glr value: b4_glr_flag
/usr/share/bison/c-skel.m4:20: the top level
make[1]: Leaving directory '/tmp/portage/sys-apps/iproute2-4.13.0/work/iproute2-4.13.0/tc'
make: *** [Makefile:57: all] Error 2
 * ERROR: sys-apps/iproute2-4.13.0::gentoo failed (compile phase):
 *   emake failed


I think problem is not in qemu (or it present in earlier versions of qemu too, but arises with newer system libs), because error appeared after upgrading glibc version fom sys-libs/glibc-2.23-r4 to 2.25-r5, and binutils sys-devel/binutils-2.28.1 to 2.29.1, when qemu was still 2.9.x (i forgot to update qemu binpkg at chroot first).
Back to top
View user's profile Send private message
fedeliallalinea
Bodhisattva
Bodhisattva


Joined: 08 Mar 2003
Posts: 18804
Location: here

PostPosted: Mon Oct 02, 2017 6:30 pm    Post subject: Reply with quote

Here a open bug in qemu bug tracker
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
xaviermiller
Administrator
Administrator


Joined: 23 Jul 2004
Posts: 7582
Location: ~Brussels - Belgique

PostPosted: Mon Oct 02, 2017 6:33 pm    Post subject: Reply with quote

Hi,

I run full ~arch systems, and qemu-user-arm is always synced before I chroot.

So, I have
Code:
Portage 2.3.10 (python 2.7.14-final-0, default/linux/amd64/17.0/no-multilib, gcc-7.2.0, glibc-2.25-r5, 4.13.4-gentoo x86_64)
Portage 2.3.10 (python 3.4.6-final-0, default/linux/arm/13.0/armv6j, gcc-7.2.0, glibc-2.25-r5, 4.13.3+ armv6l)

_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
xaviermiller
Administrator
Administrator


Joined: 23 Jul 2004
Posts: 7582
Location: ~Brussels - Belgique

PostPosted: Mon Oct 02, 2017 6:38 pm    Post subject: Reply with quote

fedeliallalinea wrote:
Here a open bug in qemu bug tracker


Done, thanks! :)
_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
xaviermiller
Administrator
Administrator


Joined: 23 Jul 2004
Posts: 7582
Location: ~Brussels - Belgique

PostPosted: Mon Oct 02, 2017 6:46 pm    Post subject: Reply with quote

Following this; syscall 383 is seccomp, and 391 is copy_file_range which are, I think, active on the host system.
_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
n05ph3r42
n00b
n00b


Joined: 11 Jul 2016
Posts: 68

PostPosted: Mon Oct 02, 2017 8:18 pm    Post subject: Reply with quote

xaviermiller wrote:
Following this; syscall 383 is seccomp, and 391 is copy_file_range which are, I think, active on the host system.

Yup. Those are constantly present when cross-compiling whith qemu, - listed syscalls just cannot be emulated, i think.
Back to top
View user's profile Send private message
xaviermiller
Administrator
Administrator


Joined: 23 Jul 2004
Posts: 7582
Location: ~Brussels - Belgique

PostPosted: Thu Oct 05, 2017 8:25 pm    Post subject: Reply with quote

And one other unsupported syscall: 1000
Code:
>>> Running pre-merge checks for sys-libs/glibc-2.25-r6
make -j5 -l3 -s glibc-test
make -j5 -l3 -s glibc-test
qemu: Unsupported syscall: 1000


But I cannot find it in the table I've found
_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
xaviermiller
Administrator
Administrator


Joined: 23 Jul 2004
Posts: 7582
Location: ~Brussels - Belgique

PostPosted: Fri Oct 06, 2017 6:01 am    Post subject: Reply with quote

and today, I cannot emerge glibc using qemu:
Code:
qemu: Unsupported syscall: 26
 * /var/tmp/portage/sys-apps/sandbox-2.12/work/sandbox-2.12/libsandbox/trace.c:_do_ptrace():75: failure (Function not implemented):
 * ISE:_do_ptrace: ptrace(PTRACE_TRACEME, ..., 0x00000000, 0x00000000): Function not implemented
/proc/5968/cmdline: /usr/bin/make -r PARALLELMFLAGS= -C /var/tmp/portage/sys-libs/glibc-2.25-r6/work/glibc-2.25 objdir=/var/tmp/portage/sys-libs/glibc-2.25-r6/work/build-arm-armv6j-hardfloat-linux-gnueabi-nptl install

qemu: uncaught target signal 6 (Aborted) - core dumped
make[1]: *** [Makefile:106: install-symbolic-link] Error 134
make[1]: Leaving directory '/var/tmp/portage/sys-libs/glibc-2.25-r6/work/glibc-2.25'
make: *** [Makefile:12: install] Error 2
 * ERROR: sys-libs/glibc-2.25-r6::gentoo failed (install phase):
 *   emake failed
 *
 * If you need support, post the output of `emerge --info '=sys-libs/glibc-2.25-r6::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-libs/glibc-2.25-r6::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/sys-libs/glibc-2.25-r6/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-libs/glibc-2.25-r6/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-libs/glibc-2.25-r6/work/build-arm-armv6j-hardfloat-linux-gnueabi-nptl'
 * S: '/var/tmp/portage/sys-libs/glibc-2.25-r6/work/glibc-2.25'

>>> Failed to emerge sys-libs/glibc-2.25-r6, Log file:


Is it due to the new sandbox?
_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
n05ph3r42
n00b
n00b


Joined: 11 Jul 2016
Posts: 68

PostPosted: Sun Oct 08, 2017 6:50 pm    Post subject: Reply with quote

I suggest to emerge glibc 2.26 version via true cross-compiling (w/o chrooting + qemu). It seems that version 2.25 is too buggy. It works for me, at least many packages emerged fine with version 2.26, which failed with 2.25.
Sandbox 2.12 is emerged, btw.
Back to top
View user's profile Send private message
n05ph3r42
n00b
n00b


Joined: 11 Jul 2016
Posts: 68

PostPosted: Fri Nov 10, 2017 6:13 am    Post subject: Reply with quote

updated: https://bugs.launchpad.net/qemu/+bug/1673976/comments/7
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 40808
Location: 56N 3W

PostPosted: Fri Nov 10, 2017 9:40 am    Post subject: Reply with quote

Moved from Portage & Programming to Gentoo on ARM.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
n05ph3r42
n00b
n00b


Joined: 11 Jul 2016
Posts: 68

PostPosted: Sat Nov 11, 2017 7:58 am    Post subject: Assertion `ec >= 0' failed Reply with quote

SUMMARY:
Linux-user clone() can't handle glibc posix_spawn() causing
Code:
../sysdeps/unix/sysv/linux/spawni.c:366: __spawnix: Assertion `ec >= 0' failed

due to QEMU strict flag check.
Back to top
View user's profile Send private message
n05ph3r42
n00b
n00b


Joined: 11 Jul 2016
Posts: 68

PostPosted: Wed Nov 29, 2017 5:41 pm    Post subject: Reply with quote

Apparently I was right.

n05ph3r42 wrote:

I think problem is not in qemu (or it present in earlier versions of qemu too, but arises with newer system libs), because error appeared after upgrading glibc version fom sys-libs/glibc-2.23-r4 to 2.25-r5, and binutils sys-devel/binutils-2.28.1 to 2.29.1, when qemu was still 2.9.x (i forgot to update qemu binpkg at chroot first).


The problem, in fact, is in new posix_spawn implementation in glibc:

https://bugs.launchpad.net/qemu/+bug/1673976/comments/13

https://sourceware.org/git/?p=glibc.git;a=blobdiff;f=sysdeps/unix/sysv/linux/spawni.c;h=679534b79dfc6308f5a92db6094b692c72cd916d;hp=67e1c42426cffeab27861ccbd9f175e43f5578a1;hb=4b4d4056bb154603f36c6f8845757c1012758158;hpb=8d3bd947483f50b57aee7c35c07dc1927d6e8a27
Back to top
View user's profile Send private message
n05ph3r42
n00b
n00b


Joined: 11 Jul 2016
Posts: 68

PostPosted: Tue Dec 05, 2017 8:00 pm    Post subject: Assertion `ec >= 0' failed Reply with quote

Improper assert in Linux posix_spawn implementation
FIXED https://sourceware.org/bugzilla/show_bug.cgi?id=22273
Back to top
View user's profile Send private message
xaviermiller
Administrator
Administrator


Joined: 23 Jul 2004
Posts: 7582
Location: ~Brussels - Belgique

PostPosted: Tue Jun 12, 2018 12:19 pm    Post subject: Reply with quote

xaviermiller wrote:
and today, I cannot emerge glibc using qemu:
Code:
qemu: Unsupported syscall: 26
 * /var/tmp/portage/sys-apps/sandbox-2.12/work/sandbox-2.12/libsandbox/trace.c:_do_ptrace():75: failure (Function not implemented):
 * ISE:_do_ptrace: ptrace(PTRACE_TRACEME, ..., 0x00000000, 0x00000000): Function not implemented
/proc/5968/cmdline: /usr/bin/make -r PARALLELMFLAGS= -C /var/tmp/portage/sys-libs/glibc-2.25-r6/work/glibc-2.25 objdir=/var/tmp/portage/sys-libs/glibc-2.25-r6/work/build-arm-armv6j-hardfloat-linux-gnueabi-nptl install

qemu: uncaught target signal 6 (Aborted) - core dumped
make[1]: *** [Makefile:106: install-symbolic-link] Error 134
make[1]: Leaving directory '/var/tmp/portage/sys-libs/glibc-2.25-r6/work/glibc-2.25'
make: *** [Makefile:12: install] Error 2
 * ERROR: sys-libs/glibc-2.25-r6::gentoo failed (install phase):
 *   emake failed
 *
 * If you need support, post the output of `emerge --info '=sys-libs/glibc-2.25-r6::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-libs/glibc-2.25-r6::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/sys-libs/glibc-2.25-r6/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-libs/glibc-2.25-r6/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-libs/glibc-2.25-r6/work/build-arm-armv6j-hardfloat-linux-gnueabi-nptl'
 * S: '/var/tmp/portage/sys-libs/glibc-2.25-r6/work/glibc-2.25'

>>> Failed to emerge sys-libs/glibc-2.25-r6, Log file:


Is it due to the new sandbox?


Hi,

Same problem again... tested with glibc 2.26, 2.27 and qemu 2.11, 2.12 :(
_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
n05ph3r42
n00b
n00b


Joined: 11 Jul 2016
Posts: 68

PostPosted: Tue Jun 12, 2018 11:08 pm    Post subject: Reply with quote

IDK, but last glibc update caused issue with sandbox in tor in ~amd64. Only disabling sandbox in torrc allowed daemon to work.

Did you tried w/o sandbox?
Back to top
View user's profile Send private message
xaviermiller
Administrator
Administrator


Joined: 23 Jul 2004
Posts: 7582
Location: ~Brussels - Belgique

PostPosted: Fri Jun 15, 2018 9:08 pm    Post subject: Reply with quote

No, disabling sandbox doesn't help
_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum