Backtrace cut-off when interrupting syscall on Linux x86-32

Bug #549673 reported by Tobias C. Rittweiler
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Medium
Unassigned

Bug Description

(let ((m (sb-thread:make-mutex))
       (q (sb-thread:make-waitqueue)))
  (sb-thread:with-mutex (m)
     (format t "~&Press C-c C-c now.~%")
     (sb-thread:condition-wait q m)))

results in the following backtrace with 1.0.36.34 on Linux x86-32:

Interrupt from Emacs
   [Condition of type SIMPLE-ERROR]

Restarts:
 0: [CONTINUE] Continue from break.
 1: [RETRY] Retry SLIME REPL evaluation request.
 2: [ABORT] Return to SLIME's top level.
 3: [TERMINATE-THREAD] Terminate this thread (#<THREAD "repl-thread" RUNNING {B117561}>)

Backtrace:
  0: ((FLET SWANK-BACKEND:CALL-WITH-DEBUGGING-ENVIRONMENT) #<FUNCTION (LAMBDA #) {C24FC65}>)
  1: (SWANK::DEBUG-IN-EMACS #<SIMPLE-ERROR {BCA0311}>)
  2: (SWANK:INVOKE-SLIME-DEBUGGER #<SIMPLE-ERROR {BCA0311}>)
  3: (SWANK:SIMPLE-BREAK "Interrupt from Emacs")
  4: ((FLET #:WITHOUT-INTERRUPTS-BODY-[WITH-SYSTEM-MUTEX-THUNK]410))
  5: ((FLET #:WITHOUT-INTERRUPTS-BODY-[WITHOUT-INTERRUPTS-BODY-[INVOKE-INTERRUPTION]11]18))
  6: ((FLET #:WITHOUT-INTERRUPTS-BODY-[INVOKE-INTERRUPTION]11))
  7: (SB-SYS:INVOKE-INTERRUPTION #<CLOSURE (FLET SB-UNIX::INTERRUPTION) {B5BAE19D}>)
  8: (SB-SYS:INVOKE-INTERRUPTION #<CLOSURE (FLET SB-UNIX::INTERRUPTION) {B5BAE19D}>)[:EXTERNAL]
  9: ((FLET SB-UNIX::RUN-HANDLER) 13 #.(SB-SYS:INT-SAP #XB5BAE3CC) #.(SB-SYS:INT-SAP #XB5BAE44C))
 10: ((FLET SB-UNIX::RUN-HANDLER) 13 #.(SB-SYS:INT-SAP #XB5BAE3CC) #.(SB-SYS:INT-SAP #XB5BAE44C))[:OPTIONAL]
 11: ((FLET SB-UNIX::RUN-HANDLER))[:EXTERNAL]
 12: ("foreign function: #x806738B")
 13: ("foreign function: #x8052C8E")
 14: ("foreign function: #x8057C8B")
 15: ("foreign function: #x8057E26")

Whereas on Linux x86-64, we get the full backtrace:

Interrupt from Emacs
   [Condition of type SIMPLE-ERROR]

Restarts:
 0: [CONTINUE] Continue from break.
 1: [RETRY] Retry SLIME REPL evaluation request.
 2: [ABORT] Return to SLIME's top level.
 3: [TERMINATE-THREAD] Terminate this thread (#<THREAD "repl-thread" RUNNING {1$

Backtrace:
  0: ("bogus stack frame")
  1: ((FLET #:WITHOUT-INTERRUPTS-BODY-[CONDITION-WAIT]159))
  2: (SB-THREAD:CONDITION-WAIT #S(SB-THREAD:WAITQUEUE :NAME NIL :DATA NIL) #S(S$
  3: (SB-THREAD:CONDITION-WAIT #S(SB-THREAD:WAITQUEUE :NAME NIL :DATA NIL) #S(S$
  4: ((FLET #:WITHOUT-INTERRUPTS-BODY-[CALL-WITH-MUTEX]293))
  5: (SB-THREAD::CALL-WITH-MUTEX #<CLOSURE (FLET SB-THREAD::WITH-MUTEX-THUNK) {$
  6: ((LAMBDA ()))
  7: (SB-INT:SIMPLE-EVAL-IN-LEXENV ..)
  8: (SWANK::EVAL-REGION ..)
  9: ((LAMBDA ()))
 10: (SWANK::TRACK-PACKAGE #<CLOSURE (LAMBDA #) {100472FCD9}>)
 11: (SWANK::CALL-WITH-RETRY-RESTART "Retry SLIME REPL evaluation request." #<C$
 12: (SWANK::CALL-WITH-BUFFER-SYNTAX NIL #<CLOSURE (LAMBDA #) {100472FBC9}>)
 13: (SWANK::REPL-EVAL ..)
 14: (SB-INT:SIMPLE-EVAL-IN-LEXENV ..)
 15: (SWANK::EVAL-FOR-EMACS ..)
 16: (SWANK::PROCESS-REQUESTS NIL)
 17: ((LAMBDA ()))
18: (SWANK-BACKEND::CALL-WITH-BREAK-HOOK #<FUNCTION SWANK:SWANK-DEBUGGER-HOOK>$
 19: ((FLET SWANK-BACKEND:CALL-WITH-DEBUGGER-HOOK) #<FUNCTION SWANK:SWANK-DEBUG$
 20: (SWANK::CALL-WITH-BINDINGS ((*STANDARD-OUTPUT* . #) (*STANDARD-INPUT* . #)$
 21: (SWANK::CALL-WITH-CONNECTION #<SWANK::CONNECTION {1004206851}> #<CLOSURE ($
 22: (SWANK::HANDLE-REQUESTS #<SWANK::CONNECTION {1004206851}> NIL)
 23: (SWANK::CALL-WITH-BINDINGS NIL #<CLOSURE (LAMBDA #) {100400F0F9}>)
 24: ((FLET #:WITHOUT-INTERRUPTS-BODY-[BLOCK358]363))
 25: ((FLET SB-THREAD::WITH-MUTEX-THUNK))
 26: ((FLET #:WITHOUT-INTERRUPTS-BODY-[CALL-WITH-MUTEX]293))
 27: (SB-THREAD::CALL-WITH-MUTEX ..)
 28: (SB-THREAD::INITIAL-THREAD-FUNCTION)
 29: ("foreign function: #x4223A0")
 30: ("foreign function: #x419277")

Changed in sbcl:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Nikodemus Siivola (nikodemus) wrote :

See also Bug #798848.

Changed in sbcl:
status: Confirmed → In Progress
assignee: nobody → Nikodemus Siivola (nikodemus)
Revision history for this message
Nikodemus Siivola (nikodemus) wrote :

commit e7b2c507c364da9395ad1f9591210dac44f24afd
Author: Nikodemus Siivola <email address hidden>
Date: Mon Aug 1 16:46:26 2011 +0300

    more robust backtraces for syscalls on x86

     * new optimization policy: ALIEN-FUNCALL-SAVES-FP-AND-PC Set to 3 for
       self-build on x86 to get reliable more backtraces there, and 0 for
       other platforms. (1 matches the old SPEED <= DEBUG behaviour.)

     * When using a saved FP, and an interrupt context has a bogus
       FP, assume it is an interrupted syscall frame.

Changed in sbcl:
assignee: Nikodemus Siivola (nikodemus) → nobody
status: In Progress → Fix Committed
Revision history for this message
Tobias C. Rittweiler (tcr) wrote :

Thanks nikodemus.

Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.