GNU bug report logs - #40737
Segfault in arm gcc7, thumb2 builroot, with arm patch

Previous Next

Package: guile;

Reported by: dsmich <at> roadrunner.com

Date: Mon, 20 Apr 2020 19:35:02 UTC

Severity: important

Done: Dale Smith <dalepsmith <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 40737 in the body.
You can then email your comments to 40737 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#40737; Package guile. (Mon, 20 Apr 2020 19:35:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to dsmich <at> roadrunner.com:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Mon, 20 Apr 2020 19:35:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: dsmich <at> roadrunner.com
To: "'bug-guile <at> gnu.org'" <bug-guile <at> gnu.org>
Subject: Segfault in arm gcc7, thumb2 builroot, with arm patch
Date: Mon, 20 Apr 2020 19:34:28 +0000
[Message part 1 (text/plain, inline)]
Here is a backtrace of running guile on a builtroot constructed system
for rpi3.
Thumb2 instructions: BR2_ARM_INSTRUCTIONS_THUMB2=y
Gcc 7.5: BR2_GCC_VERSION="7.5.0"
Glibc.

Uses the patch from
https://gitlab.com/wingo/lightening/-/merge_requests/3

I hope this makes it through the mail client ok. 

-Dale

Core was generated by `guile'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x76ee6f12 in ?? ()
[Current thread is 1 (LWP 507)]
(gdb) thread apply all backtrace

Thread 5 (LWP 508):
#0 0x76e59674 in __libc_do_syscall () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/lib/libpthread.so.0
#1 0x76e5499e in pthread_cond_wait@@GLIBC_2.4 () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/lib/libpthread.so.0
#2 0x76e7d7aa in GC_wait_marker () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libgc.so.1
#3 0x76e7dab0 in GC_help_marker () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libgc.so.1
#4 0x76e7db26 in GC_mark_thread () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libgc.so.1
#5 0x76e4fbb0 in start_thread () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/lib/libpthread.so.0
#6 0x76b450ec in ?? () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/lib/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt
stack?)

Thread 4 (LWP 510):
#0 0x76e59674 in __libc_do_syscall () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/lib/libpthread.so.0
#1 0x76e5499e in pthread_cond_wait@@GLIBC_2.4 () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/lib/libpthread.so.0
#2 0x76e7d7aa in GC_wait_marker () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libgc.so.1
#3 0x76e7dab0 in GC_help_marker () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libgc.so.1
#4 0x76e7db26 in GC_mark_thread () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libgc.so.1
#5 0x76e4fbb0 in start_thread () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/lib/libpthread.so.0
#6 0x76b450ec in ?? () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/lib/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt
stack?)

Thread 3 (LWP 511):
#0 0x76e59674 in __libc_do_syscall () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/lib/libpthread.so.0
#1 0x76e57720 in read () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/lib/libpthread.so.0
#2 0x76ef8aee in read_finalization_pipe_data (data=0x74c1f95c) at
finalizers.c:205
#3 0x76e7cea8 in GC_do_blocking_inner () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libgc.so.1
#4 0x76e7b068 in GC_with_callee_saves_pushed () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libgc.so.1
#5 0x76e7b094 in GC_do_blocking () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libgc.so.1
#6 0x76f3f10c in scm_without_guile (func=0x76ef8add , data=0x74c1f95c)
at threads.c:706
#7 0x76ef8d7a in finalization_thread_proc (unused=) at
finalizers.c:218
#8 0x76eef876 in c_body (d=0x74c1fe1c) at continuations.c:430
#9 0x76f4298e in vm_debug_engine (thread=0x76a46c00) at
vm-engine.c:972
#10 0x76f47b9c in scm_call_n (proc=0x7521dc70,
argv=argv <at> entry=0x74c1fbc0, nargs=nargs <at> entry=2) at vm.c:1608
#11 0x76ef22c4 in scm_call_2 (proc=, arg1=, arg2=) at eval.c:503
#12 0x76ef31a2 in scm_c_with_exception_handler (type=type <at> entry=0x404,
handler=0x76f3f9b9 , handler_data=handler_data <at> entry=0x74c1fda8, 
 thunk=0x76f3fa7d , thunk_data=thunk_data <at> entry=0x74c1fda8) at
exceptions.c:170
#13 0x76f3fbd4 in scm_c_catch (tag=tag <at> entry=0x404,
body=body <at> entry=0x76eef86d , body_data=body_data <at> entry=0x74c1fe1c, 
 handler=handler <at> entry=0x76eefa1d ,
handler_data=handler_data <at> entry=0x74c1fe1c, 
 pre_unwind_handler=pre_unwind_handler <at> entry=0x76eef8fb ,
pre_unwind_handler_data=pre_unwind_handler_data <at> entry=0x751fc300) at
throw.c:168
--Type  for more, q to quit, c to continue without paging--c
#14 0x76eefba2 in scm_i_with_continuation_barrier (body=0x76eef86d ,
body_data=body_data <at> entry=0x74c1fe1c, handler=0x76eefa1d ,
handler_data=handler_data <at> entry=0x74c1fe1c,
pre_unwind_handler=0x76eef8fb , pre_unwind_handler_data=0x751fc300) at
continuations.c:368
#15 0x76eefc06 in scm_c_with_continuation_barrier (func=, data=) at
continuations.c:464
#16 0x76f3edd4 in with_guile (base=0x74c1fe4c, data=0x74c1fe64) at
threads.c:645
#17 0x76e78e98 in GC_call_with_stack_base () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libgc.so.1
#18 0x76f3f0cc in scm_i_with_guile (dynamic_state=, data=, func=) at
threads.c:688
#19 scm_with_guile (func=, data=) at threads.c:694
#20 0x76e4fbb0 in start_thread () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/lib/libpthread.so.0
#21 0x76b450ec in ?? () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/lib/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt
stack?)

Thread 2 (LWP 509):
#0 0x76e59674 in __libc_do_syscall () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/lib/libpthread.so.0
#1 0x76e5499e in pthread_cond_wait@@GLIBC_2.4 () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/lib/libpthread.so.0
#2 0x76e7d7aa in GC_wait_marker () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libgc.so.1
#3 0x76e7dab0 in GC_help_marker () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libgc.so.1
#4 0x76e7db26 in GC_mark_thread () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libgc.so.1
#5 0x76e4fbb0 in start_thread () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/lib/libpthread.so.0
#6 0x76b450ec in ?? () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/lib/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt
stack?)

Thread 1 (LWP 507):
#0 0x76ee6f12 in scm_is_pair (x=0x0) at pairs.h:182
#1 scm_sloppy_assq (key=0x752076f0, alist=0x0) at alist.c:59
#2 0x76effef8 in scm_hash_fn_ref (table=table <at> entry=0x751da8b0,
obj=obj <at> entry=0x752076f0, dflt=dflt <at> entry=0x4,
hash_fn=hash_fn <at> entry=0x76eff79d , assoc_fn=0x76ee6f0d ,
closure=closure <at> entry=0x0) at hashtab.c:300
#3 0x76efff5c in scm_hashq_ref (table=0x751da8b0,
key=key <at> entry=0x752076f0, dflt=0x4, dflt <at> entry=0x904) at hashtab.c:426
#4 0x76f11f74 in scm_module_variable (module=0x74f281e0,
sym=0x752076f0) at modules.c:500
#5 0x76f430c4 in vm_debug_engine (thread=0x76a46e00) at
vm-engine.c:1560
#6 0x76f47b9c in scm_call_n (proc=0x74107800,
argv=argv <at> entry=0x7eb8fb64, nargs=nargs <at> entry=1) at vm.c:1608
#7 0x76ef22b0 in scm_call_1 (proc=, arg1=) at eval.c:496
#8 0x76f4298e in vm_debug_engine (thread=0x76a46e00) at
vm-engine.c:972
#9 0x76f47b9c in scm_call_n (proc=0x7521dc30,
argv=argv <at> entry=0x7eb8fdb0, nargs=nargs <at> entry=4) at vm.c:1608
#10 0x76ef22f4 in scm_call_4 (proc=, arg1=arg1 <at> entry=0x751fc300,
arg2=arg2 <at> entry=0x74d09810, arg3=arg3 <at> entry=0x76a4ab60,
arg4=arg4 <at> entry=0x7416c0b8) at eval.c:517
#11 0x76eea9a0 in scm_print_exception (port=port <at> entry=0x751fc300,
frame=frame <at> entry=0x74d09810, key=key <at> entry=0x76a4ab60,
args=args <at> entry=0x7416c0b8) at backtrace.c:121
#12 0x76eef994 in print_exception_and_backtrace (args=0x7416c0b8,
tag=0x76a4ab60, port=0x751fc300) at continuations.c:415
#13 pre_unwind_handler (error_port=0x751fc300, tag=0x76a4ab60,
args=0x7416c0b8) at continuations.c:453
#14 0x76f3fa2e in catch_pre_unwind_handler (data=0x7eb91c18,
exn=0x74159fa0) at throw.c:135
#15 0x76f4298e in vm_debug_engine (thread=0x76a46e00) at
vm-engine.c:972
#16 0x76f47b9c in scm_call_n (proc=proc <at> entry=0x7521dc50,
argv=0x7eb90068, nargs=5) at vm.c:1608
#17 0x76ef245a in scm_apply_0 (proc=0x7521dc50, args=0x304) at
eval.c:603
#18 0x76ef2afa in scm_apply_1 (proc=, arg1=arg1 <at> entry=0x76a4ab60,
args=args <at> entry=0x74d098c8) at eval.c:609
#19 0x76f3fd1c in scm_throw (key=0x76a4ab60, key <at> entry=0x76f8bd90 ,
args=0x74d098c8) at throw.c:262
#20 0x76f3fe22 in scm_ithrow (key=key <at> entry=0x76f8bd90 , args=,
no_return=no_return <at> entry=1) at throw.c:457
#21 0x76ef0e66 in scm_error_scm (key=key <at> entry=0x76f8bd90 ,
subr=subr <at> entry=0x4, message=message <at> entry=0x76a4ab60,
args=args <at> entry=0x304, data=0x74d09948) at error.c:90
#22 0x76f41c4a in bind_kwargs (thread=, npositional=, nlocals=14,
kwargs=0x75145ce0, strict=1 '01', allow_other_keys=0 '00') at
vm.c:1015
#23 0x7500c6e4 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt
stack?)

(gdb) info reg
r0 0x752076f0 1965061872
r1 0x0 0
r2 0x0 0
r3 0x76ee6f0d 1995337485
r4 0x4 4
r5 0x76f7c000 1995948032
r6 0x751da8b0 1964878000
r7 0x752076f0 1965061872
r8 0x3 3
r9 0x74c6d160 1959186784
r10 0x76f8c7e4 1996015588
r11 0x76f7c000 1995948032
r12 0x76f7c288 1995948680
sp 0x7eb8f8d8 0x7eb8f8d8
lr 0x76effef9 1995439865
pc 0x76ee6f12 0x76ee6f12 
cpsr 0x40000030 1073741872
fpscr 0x0 0

(gdb) disassem /r 0x76ee6f12,+8
Dump of assembler code from 0x76ee6f12 to 0x76ee6f1a:
=> 0x76ee6f12 : 0b 68 ldr r3, [r1, #0]
 0x76ee6f14 : da 07 lsls r2, r3, #31
 0x76ee6f16 : 0a d4 bmi.n 0x76ee6f2e 
 0x76ee6f18 : 13 f0 06 0f tst.w r3, #6
End of assembler dump.


[Message part 2 (text/html, inline)]

Information forwarded to bug-guile <at> gnu.org:
bug#40737; Package guile. (Mon, 20 Apr 2020 19:43:02 GMT) Full text and rfc822 format available.

Message #8 received at 40737 <at> debbugs.gnu.org (full text, mbox):

From: dsmich <at> roadrunner.com
To: "'40737 <at> debbugs.gnu.org'" <40737 <at> debbugs.gnu.org>
Subject: Forgot command output
Date: Mon, 20 Apr 2020 19:41:59 +0000
[Message part 1 (text/plain, inline)]
# ulimit -c unlimited
# guile
Backtrace:
Exception thrown while printing backtrace:
Unrecognized keyword: #:exports

Segmentation fault (core dumped)

-Dale


[Message part 2 (text/html, inline)]

Information forwarded to bug-guile <at> gnu.org:
bug#40737; Package guile. (Mon, 20 Apr 2020 19:49:02 GMT) Full text and rfc822 format available.

Message #11 received at 40737 <at> debbugs.gnu.org (full text, mbox):

From: dsmich <at> roadrunner.com
To: "'40737 <at> debbugs.gnu.org'" <40737 <at> debbugs.gnu.org>
Subject: Even more info
Date: Mon, 20 Apr 2020 19:48:03 +0000
[Message part 1 (text/plain, inline)]
Also forgot to mention this is guile 3.0.2.

It doesn't fail all the time.

When run with GUILE_JIT_THRESHOLD=-1 , there are never any problems.

With GUILE_JIT_THRESHOLD=0 , it always fails, but I'm not sure it's in
the same place.

-Dale


[Message part 2 (text/html, inline)]

Information forwarded to bug-guile <at> gnu.org:
bug#40737; Package guile. (Tue, 21 Apr 2020 12:38:02 GMT) Full text and rfc822 format available.

Message #14 received at 40737 <at> debbugs.gnu.org (full text, mbox):

From: dsmich <at> roadrunner.com
To: "'40737 <at> debbugs.gnu.org'" <40737 <at> debbugs.gnu.org>
Subject: RE: bug#40737: Even more info
Date: Tue, 21 Apr 2020 12:36:52 +0000
[Message part 1 (text/plain, inline)]
And with threshold set to 0:

# GUILE_JIT_THRESHOLD=0 guile
Pre-boot error; key: misc-error, args: (#f "parent is not a exception
type ~S" (#) #f)Aborted (core dumped)

Program terminated with signal SIGABRT, Aborted.
#0 0x76acd6b6 in ?? ()
[Current thread is 1 (LWP 515)]
(gdb) thread apply all backtrace

Thread 4 (LWP 518):
#0 0x76e5f674 in __libc_do_syscall () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/lib/libpthread.so.0
#1 0x76e5a99e in pthread_cond_wait@@GLIBC_2.4 () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/lib/libpthread.so.0
#2 0x76e837aa in GC_wait_marker () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libgc.so.1
#3 0x76e83ab0 in GC_help_marker () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libgc.so.1
#4 0x76e83b26 in GC_mark_thread () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libgc.so.1
#5 0x76e55bb0 in start_thread () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/lib/libpthread.so.0
#6 0x76b4b0ec in ?? () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/lib/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt
stack?)

Thread 3 (LWP 516):
#0 0x76e5f674 in __libc_do_syscall () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/lib/libpthread.so.0
#1 0x76e5a99e in pthread_cond_wait@@GLIBC_2.4 () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/lib/libpthread.so.0
#2 0x76e837aa in GC_wait_marker () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libgc.so.1
#3 0x76e83ab0 in GC_help_marker () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libgc.so.1
#4 0x76e83b26 in GC_mark_thread () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libgc.so.1
#5 0x76e55bb0 in start_thread () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/lib/libpthread.so.0
#6 0x76b4b0ec in ?? () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/lib/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt
stack?)

Thread 2 (LWP 517):
#0 0x76e5f674 in __libc_do_syscall () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/lib/libpthread.so.0
#1 0x76e5a99e in pthread_cond_wait@@GLIBC_2.4 () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/lib/libpthread.so.0
#2 0x76e837aa in GC_wait_marker () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libgc.so.1
#3 0x76e83ab0 in GC_help_marker () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libgc.so.1
#4 0x76e83b26 in GC_mark_thread () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libgc.so.1
#5 0x76e55bb0 in start_thread () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/lib/libpthread.so.0
#6 0x76b4b0ec in ?? () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/lib/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt
stack?)

Thread 1 (LWP 515):
#0 0x76acd6b6 in __libc_do_syscall () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/lib/libc.so.6
#1 0x76adbc70 in raise () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/lib/libc.so.6
#2 0x76adc73e in abort () from
/home/dales/br/rpi/host/arm-buildroot-linux-gnueabihf/sysroot/lib/libc.so.6
#3 0x76f45ce8 in scm_throw (key=0x76fb92b0, key <at> entry=0x0,
args=0x76a57360) at throw.c:264
#4 0x76f0b97e in throw_ (args=, key=0x0) at intrinsics.c:352
#5 throw_with_value (val=, key_subr_and_message=) at intrinsics.c:367
#6 0x74f473da in ?? ()
--Type  for more, q to quit, c to continue without paging--c
Backtrace stopped: previous frame identical to this frame (corrupt
stack?)
(gdb) info reg
r0 0x0 0
r1 0x7ef92688 2130257544
r2 0x0 0
r3 0x8 8
r4 0x0 0
r5 0x7ef92688 2130257544
r6 0x76a57360 1990554464
r7 0xaf 175
r8 0x75207308 1965060872
r9 0x75207208 1965060616
r10 0x4 4
r11 0x76f82000 1995972608
r12 0xaf 175
sp 0x7ef92680 0x7ef92680
lr 0x76adbc71 1991097457
pc 0x76acd6b6 0x76acd6b6 
cpsr 0x30 48
fpscr 0x0 0
(gdb) disassem /r 0x76acd6b6,+8
Dump of assembler code from 0x76acd6b6 to 0x76acd6be:
=> 0x76acd6b6 : 80 bd pop {r7, pc}
 0x76acd6b8 : 03 4b ldr r3, [pc, #12] ; (0x76acd6c8 )
 0x76acd6ba : 1d ee 70 0f mrc 15, 0, r0, cr13, cr0, {3}
End of assembler dump.
(gdb) 


[Message part 2 (text/html, inline)]

Severity set to 'important' from 'normal' Request was from Ludovic Courtès <ludo <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 27 May 2020 21:25:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-guile <at> gnu.org:
bug#40737; Package guile. (Wed, 17 Jun 2020 22:37:01 GMT) Full text and rfc822 format available.

Message #19 received at 40737 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: dsmich <at> roadrunner.com
Cc: 40737 <at> debbugs.gnu.org
Subject: Re: bug#40737: Segfault in arm gcc7, thumb2 builroot, with arm patch
Date: Thu, 18 Jun 2020 00:36:30 +0200
Hi Dale,

dsmich <at> roadrunner.com skribis:

> Here is a backtrace of running guile on a builtroot constructed system
> for rpi3.
> Thumb2 instructions: BR2_ARM_INSTRUCTIONS_THUMB2=y
> Gcc 7.5: BR2_GCC_VERSION="7.5.0"
> Glibc.
>
> Uses the patch from
> https://gitlab.com/wingo/lightening/-/merge_requests/3
>
> I hope this makes it through the mail client ok. 
>
> -Dale
>
> Core was generated by `guile'.
> Program terminated with signal SIGSEGV, Segmentation fault.

[...]

> #0 0x76ee6f12 in scm_is_pair (x=0x0) at pairs.h:182
> #1 scm_sloppy_assq (key=0x752076f0, alist=0x0) at alist.c:59
> #2 0x76effef8 in scm_hash_fn_ref (table=table <at> entry=0x751da8b0,
> obj=obj <at> entry=0x752076f0, dflt=dflt <at> entry=0x4,
> hash_fn=hash_fn <at> entry=0x76eff79d , assoc_fn=0x76ee6f0d ,
> closure=closure <at> entry=0x0) at hashtab.c:300
> #3 0x76efff5c in scm_hashq_ref (table=0x751da8b0,
> key=key <at> entry=0x752076f0, dflt=0x4, dflt <at> entry=0x904) at hashtab.c:426
> #4 0x76f11f74 in scm_module_variable (module=0x74f281e0,
> sym=0x752076f0) at modules.c:500
> #5 0x76f430c4 in vm_debug_engine (thread=0x76a46e00) at
> vm-engine.c:1560

Is this bug still present after the recent lightening merge in
3c3270491e78891e988af1b8007c6d8de9071a3c?

Thanks,
Ludo’.




Information forwarded to bug-guile <at> gnu.org:
bug#40737; Package guile. (Thu, 18 Jun 2020 13:50:02 GMT) Full text and rfc822 format available.

Message #22 received at 40737 <at> debbugs.gnu.org (full text, mbox):

From: dsmich <at> roadrunner.com
To: "'Ludovic Courtès'" <ludo <at> gnu.org>
Cc: "'40737 <at> debbugs.gnu.org'" <40737 <at> debbugs.gnu.org>
Subject: Re: bug#40737: Segfault in arm gcc7, thumb2 builroot, with arm patch
Date: Thu, 18 Jun 2020 13:49:35 +0000
[Message part 1 (text/plain, inline)]
I'm still seeing segfaults on rasbian on an rpi3. Have not tried
buildroot yet.

That patch *did* fix a boatload of errors on arm, but this segfault is
an unrelated problem I think. Only happens on arm though.

Here is a way to reproduce:

In the test-suite/standalone dir:
while GUILE_JIT_THRESHOLD=0 make TESTS=test-language check-TESTS; do
:;done

And then:
../../meta/uninstalled-env ../../libtool --mode=execute gdb
../../libguile/guile core

Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x76f505cc in scm_is_string (x=0x0) at strings.h:293
293 return SCM_HAS_TYP7 (x, scm_tc7_string);
[Current thread is 1 (Thread 0x76fe6010 (LWP 21616))]
(gdb) bt
#0 0x76f505cc in scm_is_string (x=0x0) at strings.h:293
#1 scm_string_to_symbol (string=0x0) at symbols.c:361
#2 0x722df4cc in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt
stack?)

	-----------------------------------------From: "Ludovic Courtès" 
To: dsmich <at> roadrunner.com
Cc: 40737 <at> debbugs.gnu.org
Sent: Wednesday June 17 2020 6:36:34PM
Subject: Re: bug#40737: Segfault in arm gcc7, thumb2 builroot, with
arm patch

Hi Dale,

 dsmich <at> roadrunner.com skribis:

 > Here is a backtrace of running guile on a builtroot constructed
 system
 > for rpi3.
 > Thumb2 instructions: BR2_ARM_INSTRUCTIONS_THUMB2=y
 > Gcc 7.5: BR2_GCC_VERSION="7.5.0"
 > Glibc.
 >
 > Uses the patch from
 >
[Message part 2 (text/html, inline)]

Information forwarded to bug-guile <at> gnu.org:
bug#40737; Package guile. (Thu, 18 Jun 2020 14:55:01 GMT) Full text and rfc822 format available.

Message #25 received at 40737 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: dsmich <at> roadrunner.com
Cc: "'40737 <at> debbugs.gnu.org'" <40737 <at> debbugs.gnu.org>
Subject: Re: bug#40737: Segfault in arm gcc7, thumb2 builroot, with arm patch
Date: Thu, 18 Jun 2020 16:54:21 +0200
Hi,

dsmich <at> roadrunner.com skribis:

> I'm still seeing segfaults on rasbian on an rpi3. Have not tried
> buildroot yet.
>
> That patch *did* fix a boatload of errors on arm, but this segfault is
> an unrelated problem I think. Only happens on arm though.
>
> Here is a way to reproduce:
>
> In the test-suite/standalone dir:
> while GUILE_JIT_THRESHOLD=0 make TESTS=test-language check-TESTS; do
> :;done
>
> And then:
> ../../meta/uninstalled-env ../../libtool --mode=execute gdb
> ../../libguile/guile core
>
> Program terminated with signal SIGSEGV, Segmentation fault.
> #0 0x76f505cc in scm_is_string (x=0x0) at strings.h:293
> 293 return SCM_HAS_TYP7 (x, scm_tc7_string);
> [Current thread is 1 (Thread 0x76fe6010 (LWP 21616))]
> (gdb) bt
> #0 0x76f505cc in scm_is_string (x=0x0) at strings.h:293
> #1 scm_string_to_symbol (string=0x0) at symbols.c:361
> #2 0x722df4cc in ?? ()
> Backtrace stopped: previous frame identical to this frame (corrupt
> stack?)

OK.

On IRC you mentioned that this does not happen with
GUILE_JIT_THRESHOLD=-1, right?

Thanks,
Ludo’.




Information forwarded to bug-guile <at> gnu.org:
bug#40737; Package guile. (Thu, 18 Jun 2020 15:18:01 GMT) Full text and rfc822 format available.

Message #28 received at 40737 <at> debbugs.gnu.org (full text, mbox):

From: dsmich <at> roadrunner.com
To: "'Ludovic Courtès'" <ludo <at> gnu.org>
Cc: "'40737 <at> debbugs.gnu.org'" <40737 <at> debbugs.gnu.org>
Subject: Re: bug#40737: Segfault in arm gcc7, thumb2 builroot, with arm patch
Date: Thu, 18 Jun 2020 15:17:30 +0000
[Message part 1 (text/plain, inline)]
From: "Ludovic Courtès" 
> dsmich <at> roadrunner.com skribis:
 > > In the test-suite/standalone dir:
 > > while GUILE_JIT_THRESHOLD=0 make TESTS=test-language check-TESTS;
> 
> OK.
 > 
 > On IRC you mentioned that this does not happen with
GUILE_JIT_THRESHOLD=-1, right?
 >

That is correct.

-Dale


[Message part 2 (text/html, inline)]

Information forwarded to bug-guile <at> gnu.org:
bug#40737; Package guile. (Fri, 19 Jun 2020 16:08:01 GMT) Full text and rfc822 format available.

Message #31 received at 40737 <at> debbugs.gnu.org (full text, mbox):

From: Andrew Gierth <andrew <at> tao11.riddles.org.uk>
To: 40737 <at> debbugs.gnu.org
Subject: Re: bug#40737: Segfault in arm gcc7, thumb2 builroot, with arm patch
Date: Fri, 19 Jun 2020 17:07:34 +0100
[Message part 1 (text/plain, inline)]
Patch attached.

-- 
Andrew.

[guile-arm.patch (text/x-patch, inline)]
diff --git a/libguile/lightening/lightening/arm-cpu.c b/libguile/lightening/lightening/arm-cpu.c
index 4445266af..2b4eecc29 100644
--- a/libguile/lightening/lightening/arm-cpu.c
+++ b/libguile/lightening/lightening/arm-cpu.c
@@ -230,7 +230,7 @@ encode_thumb_immediate(unsigned int v)
     return ((v & 0xff) | (1 << 12));
   /* abcdefgh 00000000 abcdefgh 00000000 */
   if (((v & 0xffff0000) >> 16) == (v & 0xffff) && (v & 0xff) == 0)
-    return ((v & 0x000000ff) | (2 << 12));
+    return (((v & 0x0000ff00) >> 8) | (2 << 12));
   /* abcdefgh abcdefgh abcdefgh abcdefgh */
   if ( (v &    0xff)        == ((v &     0xff00) >>  8) &&
        ((v &   0xff00) >> 8) == ((v &   0xff0000) >> 16) &&

Information forwarded to bug-guile <at> gnu.org:
bug#40737; Package guile. (Fri, 19 Jun 2020 19:11:02 GMT) Full text and rfc822 format available.

Message #34 received at 40737 <at> debbugs.gnu.org (full text, mbox):

From: dsmich <at> roadrunner.com
To: "'Andrew Gierth'" <andrew <at> tao11.riddles.org.uk>
Cc: "'40737 <at> debbugs.gnu.org'" <40737 <at> debbugs.gnu.org>
Subject: RE: bug#40737: Segfault in arm gcc7, thumb2 builroot, with arm patch
Date: Fri, 19 Jun 2020 19:10:35 +0000
[Message part 1 (text/plain, inline)]
Here is the start of a case to go in tests/movi.c:

#include "test.h"

// Should really test all of the cases seen in
// arm-cpu.c: encode_thumb_immediate()

/* 00000000 00000000 00000000 abcdefgh */
/* 00000000 abcdefgh 00000000 abcdefgh */
/* abcdefgh 00000000 abcdefgh 00000000 */
/* abcdefgh abcdefgh abcdefgh abcdefgh */
/* 1bcdefgh
[Message part 2 (text/html, inline)]

Information forwarded to bug-guile <at> gnu.org:
bug#40737; Package guile. (Sat, 20 Jun 2020 14:05:01 GMT) Full text and rfc822 format available.

Message #37 received at 40737 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Andrew Gierth <andrew <at> tao11.riddles.org.uk>
Cc: Andy Wingo <wingo <at> igalia.com>, dsmich <at> roadrunner.com, 40737 <at> debbugs.gnu.org
Subject: Re: bug#40737: Segfault in arm gcc7, thumb2 builroot, with arm patch
Date: Sat, 20 Jun 2020 16:04:28 +0200
Hi Andrew,

Andrew Gierth <andrew <at> tao11.riddles.org.uk> skribis:

> diff --git a/libguile/lightening/lightening/arm-cpu.c b/libguile/lightening/lightening/arm-cpu.c
> index 4445266af..2b4eecc29 100644
> --- a/libguile/lightening/lightening/arm-cpu.c
> +++ b/libguile/lightening/lightening/arm-cpu.c
> @@ -230,7 +230,7 @@ encode_thumb_immediate(unsigned int v)
>      return ((v & 0xff) | (1 << 12));
>    /* abcdefgh 00000000 abcdefgh 00000000 */
>    if (((v & 0xffff0000) >> 16) == (v & 0xffff) && (v & 0xff) == 0)
> -    return ((v & 0x000000ff) | (2 << 12));
> +    return (((v & 0x0000ff00) >> 8) | (2 << 12));
>    /* abcdefgh abcdefgh abcdefgh abcdefgh */
>    if ( (v &    0xff)        == ((v &     0xff00) >>  8) &&
>         ((v &   0xff00) >> 8) == ((v &   0xff0000) >> 16) &&

I pushed this fix to the lightening repo on your behalf:

  https://gitlab.com/wingo/lightening/-/commit/1bb909a44d2303f88bb05125fc6742e97f80cd1d

The CI jobs pass:

  https://gitlab.com/wingo/lightening/-/pipelines/158337465

I’ll try merging it into Guile, but do you have a test that reproduces
the original bug, either at the Guile level or in C using the lightening
API?  Perhaps the test that Dale posted yesterday at
<https://paste.debian.net/1152897/>?

--8<---------------cut here---------------start------------->8---
#include "test.h"                                               
                                                                
static void                                                     
run_test(jit_state_t *j, uint8_t *arena_base, size_t arena_size)
{                                                               
  jit_begin(j, arena_base, arena_size);                         
                                                                
  jit_movi(j, JIT_R0, 0xa500a500);                              
  jit_retr(j, JIT_R0);                                          
                                                                
  jit_uword_t (*f)(void) = jit_end(j, NULL);                    
                                                                
  ASSERT(f() == 0xa500a500);                                    
}                                                               
                                                                
int                                                             
main (int argc, char *argv[])                                   
{                                                               
  return main_helper(argc, argv, run_test);                     
}                                                               
--8<---------------cut here---------------end--------------->8---

Thanks,
Ludo’.




Information forwarded to bug-guile <at> gnu.org:
bug#40737; Package guile. (Sat, 20 Jun 2020 14:39:01 GMT) Full text and rfc822 format available.

Message #40 received at 40737 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Andrew Gierth <andrew <at> tao11.riddles.org.uk>
Cc: Andy Wingo <wingo <at> igalia.com>, dsmich <at> roadrunner.com, 40737 <at> debbugs.gnu.org
Subject: Re: bug#40737: Segfault in arm gcc7, thumb2 builroot, with arm patch
Date: Sat, 20 Jun 2020 16:37:59 +0200
Hi,

Ludovic Courtès <ludo <at> gnu.org> skribis:

> Andrew Gierth <andrew <at> tao11.riddles.org.uk> skribis:
>
>> diff --git a/libguile/lightening/lightening/arm-cpu.c b/libguile/lightening/lightening/arm-cpu.c
>> index 4445266af..2b4eecc29 100644
>> --- a/libguile/lightening/lightening/arm-cpu.c
>> +++ b/libguile/lightening/lightening/arm-cpu.c
>> @@ -230,7 +230,7 @@ encode_thumb_immediate(unsigned int v)
>>      return ((v & 0xff) | (1 << 12));
>>    /* abcdefgh 00000000 abcdefgh 00000000 */
>>    if (((v & 0xffff0000) >> 16) == (v & 0xffff) && (v & 0xff) == 0)
>> -    return ((v & 0x000000ff) | (2 << 12));
>> +    return (((v & 0x0000ff00) >> 8) | (2 << 12));
>>    /* abcdefgh abcdefgh abcdefgh abcdefgh */
>>    if ( (v &    0xff)        == ((v &     0xff00) >>  8) &&
>>         ((v &   0xff00) >> 8) == ((v &   0xff0000) >> 16) &&
>
> I pushed this fix to the lightening repo on your behalf:
>
>   https://gitlab.com/wingo/lightening/-/commit/1bb909a44d2303f88bb05125fc6742e97f80cd1d
>
> The CI jobs pass:
>
>   https://gitlab.com/wingo/lightening/-/pipelines/158337465
>
> I’ll try merging it into Guile, but do you have a test that reproduces
> the original bug, either at the Guile level or in C using the lightening
> API?  Perhaps the test that Dale posted yesterday at
> <https://paste.debian.net/1152897/>?

Replying to myself after our discussion on IRC: I’ve merged the test you
provided, Dale (with the addition of enter/leave_jit_abi), and pushed.

  https://gitlab.com/wingo/lightening/-/commit/24ef197b1269f8371b1f4a412caa6d2b99d66839

I’ll look into merging into Guile later today, and then I guess we can
close this bug.

Thank you!

Ludo’.




Information forwarded to bug-guile <at> gnu.org:
bug#40737; Package guile. (Mon, 22 Jun 2020 14:35:02 GMT) Full text and rfc822 format available.

Message #43 received at 40737 <at> debbugs.gnu.org (full text, mbox):

From: dsmich <at> roadrunner.com
To: "'Ludovic Courtès'" <ludo <at> gnu.org>
Cc: 'Andy Wingo' <wingo <at> igalia.com>,
 'Andrew Gierth' <andrew <at> tao11.riddles.org.uk>,
 "'40737 <at> debbugs.gnu.org'" <40737 <at> debbugs.gnu.org>
Subject: Re: bug#40737: Segfault in arm gcc7, thumb2 builroot, with arm patch
Date: Mon, 22 Jun 2020 14:34:00 +0000
[Message part 1 (text/plain, inline)]
close 40737 v3.0.3


[Message part 2 (text/html, inline)]

Reply sent to Dale Smith <dalepsmith <at> gmail.com>:
You have taken responsibility. (Mon, 22 Jun 2020 15:19:02 GMT) Full text and rfc822 format available.

Notification sent to dsmich <at> roadrunner.com:
bug acknowledged by developer. (Mon, 22 Jun 2020 15:19:02 GMT) Full text and rfc822 format available.

Message #48 received at 40737-done <at> debbugs.gnu.org (full text, mbox):

From: Dale Smith <dalepsmith <at> gmail.com>
To: 40737-done <at> debbugs.gnu.org
Subject: 40737-done <at> debbugs.gnu.org
Date: Mon, 22 Jun 2020 11:18:08 -0400
Fixed in the 3.0.3 release by commit 7e814190e




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 21 Jul 2020 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 273 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.