crash in sb-concurrency tests after r216641 on x86-64/freebsd9/sb-thread

From: Nali Toja <nalitoja_at_gmail.com>
Date: Wed, 12 Oct 2011 00:00:07 +0000
After r216641 sbcl built with sb-thread dies on mailbox tests. It also
dies when I try to complete a symbol in slime. The workaround seems to
be to revert libthr to r216640.

  http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/154050
  http://svn.freebsd.org/changeset/base/216641
  http://www.freshports.org/lang/sbcl # or see ports/161444 for sbcl-1.0.52

Any clue whether it's a FreeBSD bug or a SBCL bug? I've Bcc'd sbcl-bugs_at_
in case it's the latter one.

  $ cd lang/sbcl
  $ rm files/patch-disable-failing-tests
  $ make # it should fail
  $ cd $(make -V WRKSRC)
  $ SBCL_HOME=contrib/ ./src/runtime/sbcl \
      --core output/sbcl.core --no-userinit --no-sysinit \
      --eval "(require 'sb-concurrency)" \
      --eval "(asdf:oos 'asdf:test-op :sb-concurrency-tests)"
  This is SBCL 1.0.52, an implementation of ANSI Common Lisp.
  More information about SBCL is available at <http://www.sbcl.org/>.

  SBCL is free software, provided as is, with absolutely no warranty.
  It is mostly in the public domain; some portions are provided under
  BSD-style licenses.  See the CREDITS and COPYING files in the
  distribution for more information.
  Doing 16 pending tests of 16 tests total.
   SB-CONCURRENCY-TEST::QUEUE.1 SB-CONCURRENCY-TEST::QUEUE.2
   SB-CONCURRENCY-TEST::QUEUE.3 SB-CONCURRENCY-TEST::QUEUE.4
   SB-CONCURRENCY-TEST::QUEUE.5 SB-CONCURRENCY-TEST::QUEUE.T.1
   SB-CONCURRENCY-TEST::QUEUE.T.2 SB-CONCURRENCY-TEST::QUEUE.T.3
   SB-CONCURRENCY-TEST::MAILBOX-TRIVIA.1 SB-CONCURRENCY-TEST::MAILBOX-TRIVIA.2
   SB-CONCURRENCY-TEST::MAILBOX-TRIVIA.3
   SB-CONCURRENCY-TEST::MAILBOX.SINGLE-PRODUCER-SINGLE-CONSUMER
   SB-CONCURRENCY-TEST::MAILBOX.SINGLE-PRODUCER-MULTIPLE-CONSUMERS
  FFatal error 'thread was already on queue.' at atal error 'thread was already on queue.' at line 222 in file /usr/src/lib/libthr/thread/thr_cond.c (errno = 0)
  FaFtfatal error encounteredalal error 'thread was already on queue.' at line 222 in file /usr/src/lib/libthr/thread/thr_cond.c (errno = 0)
  Fatal error 'thread was already on queue.' at line 222 in tal error 'thread was already on queue.' at line 222 in file /usr/src/lib/libthr/thread/thr_cond.c (errno = 0)
  ine 222 in file /usr/src/lib/libthr/thread/thr_cond.c (erf in SBCL pid 1993rfatal error encounteredFatal error 'thread was already on queue.' at line infatal error encountered222 in file /usr/src/lib/libthr/thread/thr_cond.c (errnole /usr/src/lib/libthr/thread/thr_cond.c (errno = 0)
  o = 0)
  (tid 34384826368)  in SBCL pid 1993= 0F)fatal error encounteredaFFataltfatal error encounteredatal error 'thread was already on queue.' at line 222 in file /usr/src/lib/libthr/thread/thr_cond.c (errno = 0)
   error 'thread was already on queue.' aa
   in SBCL pid 1993t lFataFl error 'thread was already on queue.' at line 222 in file /usr/src/lib/libthr/thread/thr_cond.c (errno = 0)
  l error 'thread was already on queue.' at line 222 in file /usr/src/lib/libthr/thread/thr_cond.c (errno = 0)
  ine 222 in file /usr/src/lib/libthr/thread/thr_cond.c (errno = 0)
  :
  (tid 34384824320) in SBCL pid 1993fatal error encounteredfatal error encounteredfatal error encountered in SBCL pid 1993fatal error encounteredfatal error encountered in SBCL pid 1993(tid 34384815104):
  SIGABRT received.
  atal error 'thread was already on queue.' at line 222 in file /usr/src/lib/libthr/thread/thr_cond.c (errno = 0)

  fatal error encountered(tid 34384823296)SIGABRT received.
  :
  (tid 34384822272) in SBCL pid 1993 in SBCL pid 1993 in SBCL pid 1993(tid 34384828416) in SBCL pid 1993(tid 34384813056)FFaFatal error 'thread was already on queue.' t
  at line 222 in file /usr/src/lib/libthr/thread/thr_cond.c (errno = 0)
  al error 'thread was already on queue.' at line 222 in file /usr/src/lib/libthr/thread/thr_cond.c (errno = 0)
  aFatal error 'thread was already on queue.' at line 222 in file /usr/src/lib/libthr/thread/thr_cond.c (errno = 0)
  Fatal error 'thread was already on queue.' at line 222 Fatal error 'thread was already on queue.' at lFine 222 in file /usr/src/lib/libthr/thread/thr_cond.c (errno = 0)
  in file /usr/src/lib/libthr/thread/thr_cond.c (errno = 0)
  Fatal error 'thread was already on queue.' at line 222 in file /usr/src/lib/libthr/thread/thr_cond.c (errno = 0)
  Fatal error 'thread was already on queue.' at line 222 in file /usr/src/lib/libthr/thread/thr_cond.c (errno = 0)
  Fatal error 'thread was already on queue.' at line 222 in file /usr/src/lib/libthr/thread/thr_cond.c (errno = 0)
  Fatal error 'thread was already on queue.' at line 222 in file /usr/src/lib/libthr/thread/thr_cond.c (errno = 0)
  Fatal error 'thread was already on queue.' at line 222 in file /usr/src/lib/libthr/thread/thr_cond.c (errno = 0)
  Fatal error 'thread was already on queue.' at line 222 in file /usr/src/lib/libthr/thread/thr_cond.c (errno = 0)
  Fatal error 'thread was already on queue.' at line 222 in file /usr/src/lib/libthr/thread/thr_cond.c (err in SBCL pid 1993:

  SIGABRT received.
  :
  (tid 34384816128)(tid 34384819200)(tid 34384817152):
  :
  fatal error encounteredfatal error encounteredfatal error encounteredfatal error encounteredfatal error encounteredfatal error encounteredfatal error encounteredfatal error encounteredfatal error encounteredfatal error encounteredfatal error encountered in SBCL pid 1993(tid 34381009920):
  SIGABRT received.


  tal error 'thread was already on queue.' at line 222 in file /usr/src/lib/libthr/thread/thr_cond.c (errno = 0)
  fatal error encountered in SBCL pid 1993(tid 34384812032):
  SIGABRT received.


  atal error 'thread was already on queue.' at line 222 in file /usr/src/lib/libthr/thread/thr_cond.c (errno = 0)
  fatal error encountered in SBCL pid 1993(tid 34384803840):
  SIGABRT received.


  (tid 34384814080):
  SIGABRT received.


  SIGABRT received.





  SIGABRT received.


  :
  SIGABRT received.


  :
  SIGABRT received.


  :
  SIGABRT received.


  SIGABRT received.


  SIGABRT received.


   in SBCL pid 1993(tid 34384806912):
  SIGABRT received.


   in SBCL pid 1993(tid 34384808960):
  SIGABRT received.


   in SBCL pid 1993(tid 34381020160):
  SIGABRT received.


   in SBCL pid 1993(tid 34384804864):
  SIGABRT received.


   in SBCL pid 1993(tid 34381018112):
  SIGABRT received.


   in SBCL pid 1993(tid 34381016064):
  SIGABRT received.


   in SBCL pid 1993(tid 34381015040):
  SIGABRT received.


   in SBCL pid 1993(tid 34381014016):
  SIGABRT received.


   in SBCL pid 1993(tid 34381010944):
  SIGABRT received.


   in SBCL pid 1993(tid 34381011968):
  SIGABRT received.


  no = 0)
  fatal error encountered in SBCL pid 1993(tid 34381007872):
  SIGABRT received.


  Fatal error 'thread was already on queue.' at line 222 in file /usr/src/lib/libthr/thread/thr_cond.c (errno = 0)
  fatal error encountered in SBCL pid 1993(tid 34381003776):
  SIGABRT received.


  Fatal error 'thread was already on queue.' at line 222 in file /usr/src/lib/libthr/thread/thr_cond.c (errno = 0)
  fatal error encountered in SBCL pid 1993(tid 34381002752):
  SIGABRT received.


  Fatal error 'thread was already on queue.' at line 222 in file /usr/src/lib/libthr/thread/thr_cond.c (errno = 0)
  fatal error encountered in SBCL pid 1993(tid 34381001728):
  SIGABRT received.


  Fatal error 'thread was already on queue.' at line 222 in file /usr/src/lib/libthr/thread/thr_cond.c (errno = 0)
  fatal error encountered in SBCL pid 1993(tid 34380999680):
  SIGABRT received.


  Fatal error 'thread was already on queue.' at line 222 in file /usr/src/lib/libthr/thread/thr_cond.c (errno = 0)
  fatal error encountered in SBCL pid 1993(tid 34380792832):
  SIGABRT received.


  Fatal error 'thread was already on queue.' at line 222 in file /usr/src/lib/libthr/thread/thr_cond.c (errno = 0)
  fatal error encountered in SBCL pid 1993(tid 34380749824):
  SIGABRT received.


  Welcome to LDB, a low-level debugger for the Lisp runtime environment.
  Welcome to LDB, a low-level debugger for the Lisp runtime environment.
  Welcome to LDB, a low-level debugger for the Lisp runtime environment.
  Welcome to LDB, a low-level debugger for the Lisp runtime environment.
  Welcome to LDB, a low-level debugger for the Lisp runtime environment.
  Welcome to LDB, a low-level debugger for the Lisp runtime environment.
  Welcome to LDB, a low-level debugger for the Lisp runtime environment.
  Welcome to LDB, a low-level debugger for the Lisp runtime environment.
  Welcome to LDB, a low-level debugger for the Lisp runtime environment.
  Welcome to LDB, a low-level debugger for the Lisp runtime environment.
  Welcome to LDB, a low-level debugger for the Lisp runtime environment.
  Welcome to LDB, a low-level debugger for the Lisp runtime environment.
  Welcome to LDB, a low-level debugger for the Lisp runtime environment.
  Welcome to LDB, a low-level debugger for the Lisp runtime environment.
  Welcome to LDB, a low-level debugger for the Lisp runtime environment.
  Welcome to LDB, a low-level debugger for the Lisp runtime environment.
  Welcome to LDB, a low-level debugger for the Lisp runtime environment.
  Welcome to LDB, a low-level debugger for the Lisp runtime environment.
  ldb> ldb> ldb> ldb> ldb> ldb> ldb> ldb> ldb> ldb> ldb> ldb> ldb> ldb> ldb> ldb> ldb> Welcome to LDB, a low-level debugger for the Lisp runtime environment.
  ldb> Welcome to LDB, a low-level debugger for the Lisp runtime environment.
  ldb> Welcome to LDB, a low-level debugger for the Lisp runtime environment.
  ldb> Welcome to LDB, a low-level debugger for the Lisp runtime environment.
  ldb> Welcome to LDB, a low-level debugger for the Lisp runtime environment.
  ldb> Welcome to LDB, a low-level debugger for the Lisp runtime environment.
  ldb> Welcome to LDB, a low-level debugger for the Lisp runtime environment.
  ldb> Welcome to LDB, a low-level debugger for the Lisp runtime environment.
  ldb> Welcome to LDB, a low-level debugger for the Lisp runtime environment.
  ldb> Welcome to LDB, a low-level debugger for the Lisp runtime environment.
  ldb> Welcome to LDB, a low-level debugger for the Lisp runtime environment.
  ldb> Welcome to LDB, a low-level debugger for the Lisp runtime environment.
  ldb> Welcome to LDB, a low-level debugger for the Lisp runtime environment.
  ldb> backtrace
  Backtrace:
     0: Foreign function handle_trap, fp = 0x832e561b0, ra = 0x415040
     1: Foreign function handle_trap, fp = 0x832e56310, ra = 0x4152f8
     2: Foreign function ldb_monitor, fp = 0x832e56380, ra = 0x415344
     3: Foreign function monitor_or_something, fp = 0x832e56390, ra = 0x41539e
     4: Foreign function lose, fp = 0x832e563a0, ra = 0x41146d
     5: Foreign function lose, fp = 0x832e56490, ra = 0x41145d
     6: Foreign function sigabrt_handler, fp = 0x832e564c0, ra = 0x4144d2
     7: Foreign function handle_guard_page_triggered, fp = 0x832e56500, ra = 0x41427d
     8: Foreign fp = 0x832e56980, ra = 0x7ffffffff023
     9: Foreign function abort, fp = 0x832e569b0, ra = 0x8009e6063
    10: Foreign function _pthread_attr_getaffinity_np, fp = 0x832e569e0, ra = 0x800c61479
    11: Foreign function pthread_cond_destroy, fp = 0x832e56a30, ra = 0x800c5f548
    12: Foreign function pthread_cond_destroy, fp = 0x832e56a80, ra = 0x800c5f856
    13: Foreign function pthread_cond_wait, fp = 0x832e56aa0, ra = 0x800c5f8b7
    14: Foreign function pthread_cond_wait, fp = 0x832e56ad0, ra = 0x8009e9fa0
    15: Foreign function sig_stop_for_gc_handler, fp = 0x832e56af0, ra = 0x413574
    16: Foreign function sig_stop_for_gc_handler, fp = 0x832e56b30, ra = 0x4133a8
    17: Foreign function handle_guard_page_triggered, fp = 0x832e56b70, ra = 0x41427d
    18: Foreign fp = 0x832e57040, ra = 0x7ffffffff023
    19: Foreign function _pthread_kill, fp = 0x832e57070, ra = 0x800c5c04b
    20: Foreign function pthread_cond_destroy, fp = 0x832e570c0, ra = 0x800c5f5dd
    21: Foreign function pthread_cond_destroy, fp = 0x832e57110, ra = 0x800c5f856
    22: Foreign function pthread_cond_wait, fp = 0x832e57130, ra = 0x800c5f8b7
    23: Foreign function pthread_cond_wait, fp = 0x832e57160, ra = 0x8009e9fa0
    24: Foreign function lutex_wait, fp = 0x832e571a0, ra = 0x41804f
    25: (COMMON-LISP::FLET WITHOUT-INTERRUPTS-BODY-[CONDITION-WAIT]230)
    26: (SB-C::TL-XEP SB-THREAD::CONDITION-WAIT)
    27: (COMMON-LISP::FLET SB-THREAD::WITH-SYSTEM-MUTEX-THUNK)
    28: (COMMON-LISP::FLET WITHOUT-INTERRUPTS-BODY-[CALL-WITH-SYSTEM-MUTEX/ALLOW-WITH-INTERRUPTS]206)
    29: SB-THREAD::WAIT-ON-SEMAPHORE
    30: (COMMON-LISP::FLET WITHOUT-INTERRUPTS-BODY-[RECEIVE-MESSAGE]139)
    31: (SB-C::VARARGS-ENTRY SB-CONCURRENCY::RECEIVE-MESSAGE)
    32: (COMMON-LISP::LAMBDA ())
    33: (COMMON-LISP::FLET WITHOUT-INTERRUPTS-BODY-[BLOCK443]448)
    34: (COMMON-LISP::FLET SB-THREAD::WITH-MUTEX-THUNK)
    35: (COMMON-LISP::FLET WITHOUT-INTERRUPTS-BODY-[CALL-WITH-MUTEX]309)
    36: SB-THREAD::CALL-WITH-MUTEX
    37: SB-THREAD::INITIAL-THREAD-FUNCTION
    38: Foreign function call_into_lisp, fp = 0x832e57f30, ra = 0x426920
    39: Foreign function funcall0, fp = 0x832e57f60, ra = 0x40d61d
    40: Foreign function funcall0, fp = 0x832e57f90, ra = 0x40d5e6
    41: Foreign function new_thread_trampoline, fp = 0x832e57fc0, ra = 0x41ab26
    42: Foreign function pthread_create, fp = 0x832e57ff0, ra = 0x800c523fe
  ldb> kill 11
  Program received signal SIGSEGV, Segmentation fault.
  0x0000000800c5c7ec in _umtx_op_err () at /usr/src/lib/libthr/arch/amd64/amd64/_umtx_op_err.S:37
  37      RSYSCALL_ERR(_umtx_op)
  Current language:  auto; currently asm
  (gdb) bt
  #0  0x0000000800c5c7ec in _umtx_op_err () at /usr/src/lib/libthr/arch/amd64/amd64/_umtx_op_err.S:37
  #1  0x0000000800c5423e in _thr_umtx_timedwait_uint (mtx=0x8006d4ea8, id=0, clockid=0, abstime=0x0, shared=0) at /usr/src/lib/libthr/thread/thr_umtx.c:214
  #2  0x0000000800c5c04b in _thr_sleep (curthread=0x828d5d400, clockid=0, abstime=0x0) at /usr/src/lib/libthr/thread/thr_kern.c:212
  #3  0x0000000800c5f5dd in cond_wait_user (cvp=0x828fdf850, mp=0x828fe0970, abstime=0x0, cancel=1) at /usr/src/lib/libthr/thread/thr_cond.c:243
  #4  0x0000000800c5f856 in cond_wait_common (cond=0x8480f0008, mutex=0x8480f0000, abstime=0x0, cancel=1) at /usr/src/lib/libthr/thread/thr_cond.c:299
  #5  0x0000000800c5f8b7 in __pthread_cond_wait (cond=0x8480f0008, mutex=0x8480f0000) at /usr/src/lib/libthr/thread/thr_cond.c:313
  #6  0x00000008009e9fa0 in pthread_cond_wait_exp (p0=0x8480f0008, p1=0x8480f0000) at /usr/src/lib/libc/gen/_pthread_stubs.c:217
  #7  0x0000000000413574 in wait_for_thread_state_change (thread=0x8480f0010, state=16) at thread.h:53
  #8  0x00000000004133a8 in sig_stop_for_gc_handler (signal=31, info=0x847eef630, context=0x847eef2c0) at interrupt.c:1265
  #9  0x000000000041427d in low_level_handle_now_handler (signal=31, info=0x847eef630, void_context=0x847eef2c0) at interrupt.c:1729
  #10 0x00007ffffffff023 in ?? ()
  #11 0x0000000000414220 in low_level_unblock_me_trampoline () at interrupt.c:1723
  #12 0x000000100154c990 in ?? ()
  #13 0x000000000063eaa0 in interrupt_handlers ()
  #14 0x0000000200411d4f in ?? ()
  #15 0x0000001003375721 in ?? ()
  #16 0x38b485040000001a in ?? ()
  #17 0x00000000000a81f0 in ?? ()
  #18 0x0000000000000000 in ?? ()
  #19 0x0000000847eef840 in ?? ()
  #20 0x0000001003af2a2f in ?? ()
  #21 0x0000002004e9c3e1 in ?? ()
  #22 0x0000000800c58570 in _sigprocmask (how=Could not find the frame base for "_sigprocmask".
  ) at /usr/src/lib/libthr/thread/thr_sig.c:584
  Previous frame inner to this frame (corrupt stack?)
  (gdb) f 7
  #7  0x0000000000413574 in wait_for_thread_state_change (thread=0x8480f0010, state=16) at thread.h:53
  53              pthread_cond_wait(thread->state_cond, thread->state_lock);
  (gdb) l
  48      static inline void
  49      wait_for_thread_state_change(struct thread *thread, lispobj state)
  50      {
  51          pthread_mutex_lock(thread->state_lock);
  52          while (thread->state == state)
  53              pthread_cond_wait(thread->state_cond, thread->state_lock);
  54          pthread_mutex_unlock(thread->state_lock);
  55      }
  56
  57      extern pthread_key_t lisp_thread;
Received on Tue Oct 11 2011 - 22:01:31 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:19 UTC