Issue #13811 has been updated by jeremyevans0 (Jeremy Evans).

Status changed from Open to Feedback

Does this still happen with Ruby 2.5.5, 2.6.3, or the master branch?

----------------------------------------
Bug #13811: Ruby 2.4.1 fails to compile inside qemu armhf - signal 11 (Segmentation fault)
https://bugs.ruby-lang.org/issues/13811#change-80104

* Author: hackeron (Roman Gaufman)
* Status: Feedback
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 2.4.1
* Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
I'm using this Dockerfile to compile: https://github.com/docker-library/ruby/blob/ecbfdeb2b71e155222b1d3df0a33685247f00616/2.4/alpine3.6/Dockerfile, except with FROM resin/armhf-alpine (https://hub.docker.com/r/resin/armhf-alpine/) which forces docker to run through qemu with armhf emulation.

The compile is pretty standard:

```
	&& autoconf \
	&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
# the configure script does not detect isnan/isinf as macros
	&& export ac_cv_func_isnan=yes ac_cv_func_isinf=yes \
	&& ./configure \
		--build="$gnuArch" \
		--disable-install-doc \
		--enable-shared \
	&& make -j "$(nproc)" \
	&& make install \
```


 The above compiles without issues on am armhf and amd64 device, however when compiling through qemu armhf, it throws the following segmentation fault:


```
compiling util.c
compiling variable.c
compiling version.c
compiling vm.c
In file included from vm.c:293:0:
vm_exec.c: In function 'vm_exec_core':
vm_exec.c:83:18: warning: variable 'reg_pc' set but not used [-Wunused-but-set-variable]
     const VALUE *reg_pc;
                  ^~~~~~
compiling vm_backtrace.c
compiling vm_dump.c
compiling vm_trace.c
compiling ./missing/explicit_bzero.c
compiling ./missing/setproctitle.c
compiling addr2line.c
compiling dmyenc.c
compiling dln.c
compiling localeinit.c
compiling prelude.c
compiling array.c
compiling enc/ascii.c
compiling enc/us_ascii.c
compiling enc/unicode.c
compiling enc/utf_8.c
compiling enc/trans/newline.c
vm.c: At top level:
cc1: warning: unrecognized command line option '-Wno-self-assign'
cc1: warning: unrecognized command line option '-Wno-constant-logical-operand'
cc1: warning: unrecognized command line option '-Wno-parentheses-equality'
linking miniruby
generating encdb.h
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
make: *** [uncommon.mk:854: encdb.h] Segmentation fault
make: *** Waiting for unfinished jobs....
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
make: *** [uncommon.mk:643: .rbconfig.time] Segmentation fault
```

Any ideas?



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>