sb-sprof self-test fails with FLOATING-POINT-INEXACT error on darwin

Bug #1092993 reported by Cyrus Harmon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Undecided
Unassigned

Bug Description

after building with lichtblau's recent changes (commit 2b29a7c2b236cfab1d4d06311e84414abba71b4c), I see the following when the build reaches the sb-sprof self test:

; SYS:CONTRIB;SB-SPROF;SB-SPROF.FASL.NEWEST written
; compilation finished in 0:00:00.938
* /Users/sly/projects/sbcl/sbcl/src/runtime/sbcl --noinform --core /Users/sly/projects/sbcl/sbcl/output/sbcl.core --lose-on-corruption --disable-debugger --no-sysinit --no-userinit --eval '(load (format nil "SYS:CONTRIB;~:@(~A~);TEST.LISP" "sb-sprof"))' </dev/null
unhandled FLOATING-POINT-INEXACT in thread #<SB-THREAD:THREAD
                                             "main thread" RUNNING
                                              {10029F9D03}>:
  arithmetic error FLOATING-POINT-INEXACT signalled

0: (SB-DEBUG::MAP-BACKTRACE
    #<CLOSURE (LAMBDA # :IN BACKTRACE) {1002C934FB}>
    :START
    0
    :COUNT
    128)
1: (BACKTRACE 128 #<SYNONYM-STREAM :SYMBOL SB-SYS:*STDERR* {1000174843}>)
2: (SB-DEBUG::DEBUGGER-DISABLED-HOOK
    #<FLOATING-POINT-INEXACT {1002C5DA13}>
    #<unavailable argument>)
3: (SB-DEBUG::RUN-HOOK
    *INVOKE-DEBUGGER-HOOK*
    #<FLOATING-POINT-INEXACT {1002C5DA13}>)
4: (INVOKE-DEBUGGER #<FLOATING-POINT-INEXACT {1002C5DA13}>)
5: (ERROR FLOATING-POINT-INEXACT)
6: (SB-VM:SIGFPE-HANDLER
    #<unavailable argument>
    #.(SB-SYS:INT-SAP #X011FE800)
    #<unavailable argument>)
7: ((FLET #:WITHOUT-INTERRUPTS-BODY-20 :IN SB-SYS:INVOKE-INTERRUPTION))
8: ((FLET SB-THREAD::EXEC :IN SB-SYS:INVOKE-INTERRUPTION))
9: ((FLET #:WITHOUT-INTERRUPTS-BODY-11 :IN SB-SYS:INVOKE-INTERRUPTION))
10: (SB-SYS:INVOKE-INTERRUPTION
     #<CLOSURE (FLET SB-UNIX::INTERRUPTION :IN SB-SYS:ENABLE-INTERRUPT)
       {11FE1EB}>)
11: (SB-SYS:INVOKE-INTERRUPTION
     #<CLOSURE (FLET SB-UNIX::INTERRUPTION :IN SB-SYS:ENABLE-INTERRUPT)
       {11FE1EB}>)[:EXTERNAL]
12: ((FLET SB-UNIX::RUN-HANDLER :IN SB-SYS:ENABLE-INTERRUPT)
     8
     #.(SB-SYS:INT-SAP #X011FE800)
     #.(SB-SYS:INT-SAP #X011FE868))
13: ("foreign function: call_into_lisp")
14: ("foreign function: funcall3")
15: ("foreign function: interrupt_handle_now")
16: ("foreign function: interrupt_handle_now_handler")
17: ("foreign function: _sigtramp")

to reproduce: make.sh

sbcl version: "1.1.2.35-2b29a7c"

(sly@orcia):~/projects/sbcl/sbcl$ uname -a
Darwin orcia 12.2.1 Darwin Kernel Version 12.2.1: Thu Oct 18 12:13:47 PDT 2012; root:xnu-2050.20.9~1/RELEASE_X86_64 x86_64

*features*

(:QUICKLISP :ASDF2 :ASDF :ASDF-UNICODE :ALIEN-CALLBACKS :ANSI-CL :BSD
 :C-STACK-IS-CONTROL-STACK :COMMON-LISP :COMPARE-AND-SWAP-VOPS
 :COMPLEX-FLOAT-VOPS :CYCLE-COUNTER :DARWIN :DARWIN9-OR-BETTER :FLOAT-EQL-VOPS
 :GENCGC :IEEE-FLOATING-POINT :INLINE-CONSTANTS :INODE64 :LINKAGE-TABLE
 :LITTLE-ENDIAN :MACH-EXCEPTION-HANDLER :MACH-O :MEMORY-BARRIER-VOPS
 :MULTIPLY-HIGH-VOPS :OS-PROVIDES-BLKSIZE-T :OS-PROVIDES-DLADDR
 :OS-PROVIDES-DLOPEN :OS-PROVIDES-PUTWC :OS-PROVIDES-SUSECONDS-T
 :RAW-INSTANCE-INIT-VOPS :SB-DOC :SB-EVAL :SB-LDB :SB-PACKAGE-LOCKS
 :SB-SOURCE-LOCATIONS :SB-TEST :SB-THREAD :SB-UNICODE :SBCL
 :STACK-ALLOCATABLE-CLOSURES :STACK-ALLOCATABLE-FIXED-OBJECTS
 :STACK-ALLOCATABLE-LISTS :STACK-ALLOCATABLE-VECTORS
 :STACK-GROWS-DOWNWARD-NOT-UPWARD :UD2-BREAKPOINTS :UNIX
 :UNWIND-TO-FRAME-AND-CALL-VOP :X86-64)

Tags: sb-sprof
Revision history for this message
David Lichteblau (david-lichteblau) wrote :

First of all, mea culpa that I've pushed a test (and enabled it) as part of a different commit. The sprof stuff should have come first as a separate change.

As to the failure mode though:

If you copy&paste the (defun consing-test ...) into test.lisp, you should get a stand-alone test case that is basically independent of the SBCL version. Does that test.lisp, if compiled and loaded, also fail in an older SBCL on Darwin, e.g. 1.1.2?

Revision history for this message
Paul Khuong (pvk) wrote :

FWIW, we have FP trap masking issues on OS X: division by zeros seem to be reported as inexact on recent darwin/x86-64. So, we get values from <sys/signal.h>, but we seem to be supposed to use the constants in <fenv.h> instead (because, of course, they don't coïncide).

Stas Boukarev (stassats)
tags: added: sb-sprof
Revision history for this message
Douglas Katzman (dougk) wrote :

sb-sprof is tested by parallel-exec as well as its own tests, and doesn't fail.
So this is "fixed" though it would be more accurate to say that this bug is simply obsolete. I have no idea when sprof started working better.

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

Other bug subscribers

Remote bug watches

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