shirok / Gauche

Scheme Scripting Engine
https://practical-scheme.net/gauche
Other
823 stars 82 forks source link

SRFI test aborts on OpenBSD-current #334

Open zmyrgel opened 6 years ago

zmyrgel commented 6 years ago

Hi,

Just did a test on gauche master branch and the SRFI test has started to fail.

...
Testing load ...                                                 passed.
Testing SRFIs ...                                                Abort trap (core dumped) 
Testing object system ...                                        passed.
Testing exceptions ...                                           passed.
...

Looking at the test.log it shows as follows:

...
<srfi-155>---------------------------------------------------------------------
testing bindings in #<module srfi-155> ... ok
<SRFI 155: Promises>-----------------------------------------------------------
test (force (delay (+ 1 2))), expects 3 ==> Testing object system =========================================================
<class definition>-------------------------------------------------------------
test define-class <x>, expects <x> ==> ok
test define-class <x>, expects 3 ==> ok
...

The backtrace from core file:

(gdb) bt
#0  thrkill () at -:3
#1  0x00000a5cfa74e97e in _libc_abort () at /usr/src/lib/libc/stdlib/abort.c:51
#2  0x00000a5cfa79bcc6 in _libc_pthread_mutex_unlock (mutexp=0xa5cdf2308e0) at /usr/src/lib/libc/thread/rthread_mutex.c:266
#3  0x00000a5d21577665 in force_cc (result=0x0, data=Variable "data" is not available.
) at lazy.c:166
#4  0x00000a5d215235a0 in run_loop () at vmcall.c:196
#5  0x00000a5d21523946 in user_eval_inner (program=0xa5d21a58a20, codevec=0x7f7ffffdb620) at vm.c:1489
#6  0x00000a5d2152489c in apply_rec (vm=Variable "vm" is not available.
) at vm.c:1582
#7  0x00000a5d215762bc in Scm_Load (cpath=Variable "cpath" is not available.
) at load.c:223
#8  0x00000a5a7ef00ad1 in execute_script (scriptfile=Variable "scriptfile" is not available.
) at main.c:545
#9  0x00000a5a7ef019e9 in main (ac=2130727824, av=0xa5a7f37bcc0) at main.c:746
Current language:  auto; currently asm
(gdb)

The SRFI tests used to work on older checkouts and work on latest release.

shirok commented 6 years ago

Hmm, the code around force_cc was last changed in 2013, so right now I can't guess what went wrong. Could you tell me which latest commit it worked? (No need to pinpoint the exact commit that broke it; just let me know a general idea.)

zmyrgel commented 6 years ago

Hmm, seems that my installations base files and packages are out-of-sync a bit which might cause the issue. I'll get back to this once I get those synced.

zmyrgel commented 6 years ago

Hmm, after syncing packages with base system I still get the error so its something else.

I'm guessing that something has changed on OpenBSD's side which causes the regression. I'll try to make reduced test case so I can get more accurate debugging going on.

zmyrgel commented 6 years ago

I've made reduced test file:

;;
;; Test for SRFIs
;;

(use gauche.test)
(use gauche.parameter)

(test-start "SRFIs")

;;-----------------------------------------------------------------------
(test-section "srfi-155")
(use srfi-155)
(test-module 'srfi-155)

(define-module srfi-155-tests
  (use srfi-64)
  (use srfi-154)
  (use srfi-155)
  (use gauche.parameter)
  (use compat.r7rs-srfi-tests)
  (include "include/srfi-155-tests.scm")
  (run-tests))

(test-end)

I've run the test with "ktrace ./gosh -ftest -I../test ../test/srfi-debug.scm" Here's the trail of kdump:

 93705 gosh     GIO   fd 1 wrote 80 bytes
       "<SRFI 155: Promises>-----------------------------------------------------------
       "
 93705 gosh     RET   write 80/0x50
 93705 gosh     CALL  kbind(0x7f7fffecaec0,24,0x6a5a9f203775a9de)
 93705 gosh     RET   kbind 0
 93705 gosh     CALL  write(1,0x480d3c22000,0x2c)
 93705 gosh     GIO   fd 1 wrote 44 bytes
       "test (force (delay (+ 1 2))), expects 3 ==> "
 93705 gosh     RET   write 44/0x2c
 93705 gosh     CALL  sigprocmask(SIG_SETMASK,~0x20<SIGABRT>)
 93705 gosh     RET   sigprocmask 0<>
 93705 gosh     CALL  thrkill(0,SIGABRT,0)
 93705 gosh     PSIG  SIGABRT SIG_DFL code <10197915>
 93705 gosh     NAMI  "gosh.core"