Bug 56707 - Segfault in armhf chroot on arm64
Summary: Segfault in armhf chroot on arm64
Status: NEW
Alias: None
Product: Runtime
Classification: Mono
Component: General (show other bugs)
Version: 5.0 (2017-02)
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-05-21 19:03 UTC by neolynx
Modified: 2017-08-28 15:02 UTC (History)
2 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments

Description neolynx 2017-05-21 19:03:08 UTC
Hello,

When running in a armhf chroot environment on Debian/jessie arm64 systems, mono terminates with a segfault.

Steps to reproduce (on a Debian/jessie arm64 system):

sudo debootstrap --arch=armhf jessie jessie-armhf
sudo mount proc -t proc jessie-armhf/proc
sudo chroot jessie-armhf/

Add the mono sources to the chroot:

apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/debian jessie main" > /etc/apt/sources.list.d/mono-official.list
apt-get update

Inside the chroot, install gdb and mono-dbg

apt-get install gdb mono-dbg
...

Now, installing mono-devel will fail:

apt-get install mono-devel
...

Setting up libnunit-core-interfaces2.6.3-cil (2.6.3+dfsg-1) ...
* Installing 1 assembly from libnunit-core-interfaces2.6.3-cil into Mono
Stacktrace:

  at <unknown> <0xffffffff>
  at GetAssemblyName.Main (string[]) [0x00027] in <037a790a00934377b0c3cb8bac6505ac>:0
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) [0x0004e] in <037a790a00934377b0c3cb8bac6505ac>:0
/proc/self/maps:
00010000-00279000 r-xp 00000000 00:16 18118                              /usr/bin/mono-sgen
00288000-00289000 r--p 00268000 00:16 18118                              /usr/bin/mono-sgen
00289000-0028b000 rw-p 00269000 00:16 18118                              /usr/bin/mono-sgen
0028b000-002a6000 rw-p 00000000 00:00 0
0082f000-008ab000 rw-p 00000000 00:00 0                                  [heap]
f5700000-f5721000 rw-p 00000000 00:00 0
f5721000-f5800000 ---p 00000000 00:00 0
f5857000-f5c00000 r--p 00000000 00:16 17970                              /usr/lib/mono/4.5/mscorlib.dll
f5c00000-f6400000 rw-p 00000000 00:00 0
f6400000-f6401000 ---p 00000000 00:00 0
f6401000-f7000000 rw-p 00000000 00:00 0
f7113000-f7120000 r--p 00000000 00:16 19762                              /usr/lib/cli/nunit.core.interfaces-2.6.3/nunit.core.interfaces.dll
f7120000-f7121000 ---p 00000000 00:00 0
f7121000-f72a0000 rw-p 00000000 00:00 0
f72a2000-f72a3000 rw-p 00000000 00:00 0
f72a3000-f72b3000 rwxp 00000000 00:00 0
f72b3000-f72b4000 rw-p 00000000 00:00 0
f72b4000-f72e3000 ---p 00000000 00:00 0
f72e3000-f72f3000 rwxp 00000000 00:00 0
f72f3000-f73ce000 r-xp 00000000 00:16 10049                              /lib/arm-linux-gnueabihf/libc-2.19.so
f73ce000-f73dd000 ---p 000db000 00:16 10049                              /lib/arm-linux-gnueabihf/libc-2.19.so
f73dd000-f73df000 r--p 000da000 00:16 10049                              /lib/arm-linux-gnueabihf/libc-2.19.so
f73df000-f73e0000 rw-p 000dc000 00:16 10049                              /lib/arm-linux-gnueabihf/libc-2.19.so
f73e0000-f73e3000 rw-p 00000000 00:00 0
f73e3000-f73fc000 r-xp 00000000 00:16 3789                               /lib/arm-linux-gnueabihf/libgcc_s.so.1
f73fc000-f740b000 ---p 00019000 00:16 3789                               /lib/arm-linux-gnueabihf/libgcc_s.so.1
f740b000-f740c000 rw-p 00018000 00:16 3789                               /lib/arm-linux-gnueabihf/libgcc_s.so.1
f740c000-f741c000 r-xp 00000000 00:16 10045                              /lib/arm-linux-gnueabihf/libpthread-2.19.so
f741c000-f742b000 ---p 00010000 00:16 10045                              /lib/arm-linux-gnueabihf/libpthread-2.19.so
f742b000-f742c000 r--p 0000f000 00:16 10045                              /lib/arm-linux-gnueabihf/libpthread-2.19.so
f742c000-f742d000 rw-p 00010000 00:16 10045                              /lib/arm-linux-gnueabihf/libpthread-2.19.so
f742d000-f742f000 rw-p 00000000 00:00 0
f742f000-f7431000 r-xp 00000000 00:16 10052                              /lib/arm-linux-gnueabihf/libdl-2.19.so
f7431000-f7440000 ---p 00002000 00:16 10052                              /lib/arm-linux-gnueabihf/libdl-2.19.so
f7440000-f7441000 r--p 00001000 00:16 10052                              /lib/arm-linux-gnueabihf/libdl-2.19.so
f7441000-f7442000 rw-p 00002000 00:16 10052                              /lib/arm-linux-gnueabihf/libdl-2.19.so
f7442000-f7447000 r-xp 00000000 00:16 10064                              /lib/arm-linux-gnueabihf/librt-2.19.so
f7447000-f7456000 ---p 00005000 00:16 10064                              /lib/arm-linux-gnueabihf/librt-2.19.so
f7456000-f7457000 r--p 00004000 00:16 10064                              /lib/arm-linux-gnueabihf/librt-2.19.so
f7457000-f7458000 rw-p 00005000 00:16 10064                              /lib/arm-linux-gnueabihf/librt-2.19.so
f7458000-f74bb000 r-xp 00000000 00:16 10053                              /lib/arm-linux-gnueabihf/libm-2.19.so
f74bb000-f74ca000 ---p 00063000 00:16 10053                              /lib/arm-linux-gnueabihf/libm-2.19.so
f74ca000-f74cb000 r--p 00062000 00:16 10053                              /lib/arm-linux-gnueabihf/libm-2.19.so
f74cb000-f74cc000 rw-p 00063000 00:16 10053                              /lib/arm-linux-gnueabihf/libm-2.19.so
f74cc000-f74e3000 r-xp 00000000 00:16 10046                              /lib/arm-linux-gnueabihf/ld-2.19.so
f74e3000-f74e4000 rw-p 00000000 00:00 0
f74e4000-f74e5000 r--p 00000000 00:16 18055                              /usr/share/mono/MonoGetAssemblyName.exe
f74e5000-f74ef000 rw-p 00000000 00:00 0
f74ef000-f74f0000 ---p 00000000 00:00 0
f74f0000-f74f1000 r--p 00000000 00:00 0
f74f1000-f74f3000 rw-p 00000000 00:00 0
f74f3000-f74f4000 r--p 00017000 00:16 10046                              /lib/arm-linux-gnueabihf/ld-2.19.so
f74f4000-f74f5000 rw-p 00018000 00:16 10046                              /lib/arm-linux-gnueabihf/ld-2.19.so
ff9dd000-ff9fe000 rw-p 00000000 00:00 0                                  [stack]
ffff0000-ffff1000 r-xp 00000000 00:00 0                                  [vectors]

Native stacktrace:


Debug info from gdb:

Mono support loaded.
[New LWP 14327]
[New LWP 14326]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
__libc_do_syscall () at ../ports/sysdeps/unix/sysv/linux/arm/libc-do-syscall.S:43
43      ../ports/sysdeps/unix/sysv/linux/arm/libc-do-syscall.S: No such file or directory.
  Id   Target Id         Frame
  3    Thread 0xf6bff440 (LWP 14326) "SGen worker" __libc_do_syscall () at ../ports/sysdeps/unix/sysv/linux/arm/libc-do-syscall.S:43
  2    Thread 0xf721f440 (LWP 14327) "Finalizer" __libc_do_syscall () at ../ports/sysdeps/unix/sysv/linux/arm/libc-do-syscall.S:43
* 1    Thread 0xf74eb000 (LWP 14325) "mono" __libc_do_syscall () at ../ports/sysdeps/unix/sysv/linux/arm/libc-do-syscall.S:43

Thread 3 (Thread 0xf6bff440 (LWP 14326)):
#0  __libc_do_syscall () at ../ports/sysdeps/unix/sysv/linux/arm/libc-do-syscall.S:43
#1  0xf7415144 in __pthread_cond_wait (cond=0x2a4330, mutex=0x2a4314) at pthread_cond_wait.c:187
#2  0x001afc7c in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 2 (Thread 0xf721f440 (LWP 14327)):
#0  __libc_do_syscall () at ../ports/sysdeps/unix/sysv/linux/arm/libc-do-syscall.S:43
#1  0xf74168c2 in do_futex_wait (isem=isem@entry=0x29c470) at ../nptl/sysdeps/unix/sysv/linux/sem_wait.c:48
#2  0xf741692e in __new_sem_wait (sem=0x29c470) at ../nptl/sysdeps/unix/sysv/linux/sem_wait.c:69
#3  0x00156fca in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 1 (Thread 0xf74eb000 (LWP 14325)):
#0  __libc_do_syscall () at ../ports/sysdeps/unix/sysv/linux/arm/libc-do-syscall.S:43
#1  0xf7418306 in __libc_waitpid (pid=14328, stat_loc=0xff9fb2b0, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:40
#2  0x0008cdce in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

=================================================================
Got a SIGILL while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================

Aborted
Use of uninitialized value $_ in scalar chomp at /usr/share/cli-common/runtimes.d/mono line 275.
Use of uninitialized value $fullname in concatenation (.) or string at /usr/share/cli-common/runtimes.d/mono line 225.



The segfault can be triggered with:

gdb /usr/bin/mono
(gdb) run /usr/lib/mono/4.5/gacutil.exe

Starting program: /usr/bin/mono /usr/lib/mono/4.5/gacutil.exe
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
[New Thread 0xf6fff440 (LWP 15413)]
[New Thread 0xf5af9440 (LWP 15414)]

Program received signal SIGILL, Illegal instruction.
0xf75381d0 in ?? ()

Running the same in a armhf chroot on a intel cpu by using qemu does not show the error.

Note You need to log in before you can comment on or make changes to this bug.