[GHC] #9728: ghci: internal error: ASSERTION FAILED: file rts/Interpreter.c, line 773

GHC ghc-devs at haskell.org
Sun Oct 26 16:41:05 UTC 2014


#9728: ghci: internal error: ASSERTION FAILED: file rts/Interpreter.c, line 773
-------------------------------------+-------------------------------------
       Reporter:  slyfox             |                   Owner:
           Type:  bug                |                  Status:  new
       Priority:  normal             |               Milestone:
      Component:  GHCi               |                 Version:  7.9
       Keywords:                     |        Operating System:
   Architecture:  Unknown/Multiple   |  Unknown/Multiple
     Difficulty:  Unknown            |         Type of failure:  Runtime
     Blocked By:                     |  crash
Related Tickets:                     |               Test Case:  ghcirun002
                                     |                Blocking:
                                     |  Differential Revisions:
-------------------------------------+-------------------------------------
 It's a ghc-HEAD on amd64 ./configure --enable-unregisterised.

 One of faulty tests is a:
 {{{
 ghc-unreg/testsuite/tests/ghci/should_run $ '/home/slyfox/dev/git/ghc-
 unreg/inplace/bin/ghc-stage2' -fforce-recomp -dcore-lint -dcmm-lint -dno-
 debug-output -no-user-package-db -rtsopts -optc-fno-builtin -fno-warn-tabs
 -fno-ghci-history ghcirun002.hs --interactive -v0 -ignore-dot-ghci +RTS
 -I0.1 -RTS

 *Main> main

 (<interactive>: internal error: ASSERTION FAILED: file rts/Interpreter.c,
 line 773

     (GHC version 7.9.20141020 for x86_64_unknown_linux)
     Please report this as a GHC bug:
 http://www.haskell.org/ghc/reportabug
 Aborted
 }}}

 The assertion failure is triggered by stack overflow check
 when handling ... stack overflow!
 {{{
     // Stack check
     if (Sp - INTERP_STACK_CHECK_THRESH < SpLim) {
         Sp -= 2;
         Sp[1] = (W_)obj;
         Sp[0] = (W_)&stg_apply_interp_info; // placeholder, really
 /* 773 */ RETURN_TO_SCHEDULER(ThreadInterpret, StackOverflow);
     }

 /* ... RETURN_TO_SCHEDULER decl: */
 #define RETURN_TO_SCHEDULER(todo,retcode)       \
 /* this triggers assert */   SAVE_STACK_POINTERS; \
    cap->r.rCurrentTSO->what_next = (todo);      \
    threadPaused(cap,cap->r.rCurrentTSO);                \
    cap->r.rRet = (retcode);                     \
    return cap;

 /* ... SAVE_STACK_POINTERS decl: */
 #define SAVE_STACK_POINTERS                     \
     ASSERT(Sp > SpLim); \
     cap->r.rCurrentTSO->stackobj->sp = Sp
 }}}

 In our case '''Sp == SpLim'''. That means
 we have written one word out-of-stack-bounds, right?

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9728>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list