Opened 12 years ago

Closed 12 years ago

Last modified 5 years ago

#1067 closed bug (fixed)

assertion failure in Schedule.c

Reported by: ms43 Owned by: simonmar
Priority: normal Milestone: 6.6.1
Component: Runtime System Version: 6.6
Keywords: Cc:
Operating System: Linux Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

the following program triggers an assertion failure. this is with ghc 6.6 (built on debian 3.1 from the debian unstable source package) on both x86 and powerpc.

import Control.Concurrent
import Control.Exception

main = do
        master <- myThreadId
        handle (const main) $ do
                sequence $ replicate 10 $
                        forkIO $ do
                                putStrLn $ replicate 400000 'X'
                                throwTo master NonTermination
                putStrLn $ replicate 4000000 'X'
                threadDelay 1000000
[0] ms@isis:/tmp/chr > uname -a
Linux isis 2.6.15-1-powerpc #2 Mon Mar 6 12:39:17 CET 2006 ppc GNU/Linux
[0] ms@isis:/tmp/chr > gcc -v
Reading specs from /usr/lib/gcc-lib/powerpc-linux/3.3.5/specs
Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --enable-__cxa_atexit --with-system-zlib --enable-nls --without-included-gettext --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc --disable-multilib powerpc-linux
Thread model: posix
gcc version 3.3.5 (Debian 1:3.3.5-13)
[0] ms@isis:/tmp/chr > ghc --make -debug -v Assert.hs
Glasgow Haskell Compiler, Version 6.6, for Haskell 98, compiled by GHC version 6.2.2
Using package config file: /usr/lib/ghc-6.6/package.conf
wired-in package base mapped to base-2.0
wired-in package rts mapped to rts-1.0
wired-in package haskell98 mapped to haskell98-1.0
wired-in package template-haskell mapped to template-haskell-2.0
Hsc static flags: -funregisterised -static
*** Chasing dependencies:
Chasing modules from: Assert.hs
Stable obj: []
Stable BCO: []
compile: input file Assert.hs
Created temporary directory: /tmp/ghc2366_0
*** Checking old interface for main:Main:
[1 of 1] Compiling Main             ( Assert.hs, Assert.o )
*** Parser:
*** Renamer/typechecker:
*** Desugar:
    Result size = 94
*** Simplify:
    Result size = 111
    Result size = 102
*** Tidy Core:
    Result size = 102
*** CorePrep:
    Result size = 146
*** Stg2Stg:
*** CodeGen:
*** CodeOutput:
*** C Compiler:
gcc -x c /tmp/ghc2366_0/ghc2366_0.hc -o /tmp/ghc2366_0/ghc2366_0.s -fno-strict-aliasing -v -S -Wimplicit -O -D__GLASGOW_HASKELL__=606 -DNO_REGS -DUSE_MINIINTERPRETER -I . -I /usr/lib/ghc-6.6/include
Reading specs from /usr/lib/gcc-lib/powerpc-linux/3.3.5/specs
Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --enable-__cxa_atexit --with-system-zlib --enable-nls --without-included-gettext --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc --disable-multilib powerpc-linux
Thread model: posix
gcc version 3.3.5 (Debian 1:3.3.5-13)
 /usr/lib/gcc-lib/powerpc-linux/3.3.5/cc1 -quiet -v -I . -I /usr/lib/ghc-6.6/include -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=5 -D__unix__ -D__gnu_linux__ -D__linux__ -Dunix -D__unix -Dlinux -D__linux -Asystem=unix -Asystem=posix -D__GLASGOW_HASKELL__=606 -DNO_REGS -DUSE_MINIINTERPRETER /tmp/ghc2366_0/ghc2366_0.hc -quiet -dumpbase ghc2366_0.hc -auxbase-strip /tmp/ghc2366_0/ghc2366_0.s -O -Wimplicit -version -fno-strict-aliasing-o /tmp/ghc2366_0/ghc2366_0.s
GNU C version 3.3.5 (Debian 1:3.3.5-13) (powerpc-linux)
        compiled by GNU C version 3.3.5 (Debian 1:3.3.5-13).
GGC heuristics: --param ggc-min-expand=72 --param ggc-min-heapsize=80502
ignoring nonexistent directory "/usr/powerpc-linux/include"
#include "..." search starts here:
#include <...> search starts here:
 .
 /usr/lib/ghc-6.6/include
 /usr/local/include
 /usr/lib/gcc-lib/powerpc-linux/3.3.5/include
 /usr/include
End of search list.
*** Assembler:
gcc -I. -c /tmp/ghc2366_0/ghc2366_0.s -o Assert.o
*** Deleting temp files:
Deleting: /tmp/ghc2366_0/ghc2366_0.s /tmp/ghc2366_0/ghc2366_0.hc
Upsweep completely successful.
*** Deleting temp files:
Deleting:
link: linkables are ...
LinkableM (Thu Dec 21 16:53:18 CET 2006) main:Main
   [DotO Assert.o]
Linking Assert ...
*** Linker:
gcc -v -o Assert Assert.o -L/usr/lib/ghc-6.6 -lHSbase -lHSbase_cbits -lHSrts_debug -lm -lgmp -ldl -lrt -u base_GHCziBase_Izh_static_info -u base_GHCziBase_Czh_static_info -u base_GHCziFloat_Fzh_static_info -u base_GHCziFloat_Dzh_static_info -u base_GHCziPtr_Ptr_static_info -u base_GHCziWord_Wzh_static_info -u base_GHCziInt_I8zh_static_info -u base_GHCziInt_I16zh_static_info -u base_GHCziInt_I32zh_static_info -u base_GHCziInt_I64zh_static_info -u base_GHCziWord_W8zh_static_info -u base_GHCziWord_W16zh_static_info -u base_GHCziWord_W32zh_static_info -u base_GHCziWord_W64zh_static_info -u base_GHCziStable_StablePtr_static_info -u base_GHCziBase_Izh_con_info -u base_GHCziBase_Czh_con_info -u base_GHCziFloat_Fzh_con_info -u base_GHCziFloat_Dzh_con_info -u base_GHCziPtr_Ptr_con_info -u base_GHCziPtr_FunPtr_con_info -u base_GHCziStable_StablePtr_con_info -u base_GHCziBase_False_closure -u base_GHCziBase_True_closure -u base_GHCziPack_unpackCString_closure -u base_GHCziIOBase_stackOverflow_closure -u base_GHCziIOBase_heapOverflow_closure -u base_GHCziIOBase_NonTermination_closure -u base_GHCziIOBase_BlockedOnDeadMVar_closure -u base_GHCziIOBase_BlockedIndefinitely_closure -u base_GHCziIOBase_Deadlock_closure -u base_GHCziIOBase_NestedAtomically_closure -u base_GHCziWeak_runFinalizzerBatch_closure -u base_GHCziConc_ensureIOManagerIsRunning_closure -lbfd -liberty
Reading specs from /usr/lib/gcc-lib/powerpc-linux/3.3.5/specs
Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --enable-__cxa_atexit --with-system-zlib --enable-nls --without-included-gettext --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc --disable-multilib powerpc-linux
Thread model: posix
gcc version 3.3.5 (Debian 1:3.3.5-13)
 /usr/lib/gcc-lib/powerpc-linux/3.3.5/collect2 --eh-frame-hdr -V -Qy -m elf32ppclinux -dynamic-linker /lib/ld.so.1 -o Assert -u base_GHCziBase_Izh_static_info -u base_GHCziBase_Czh_static_info -u base_GHCziFloat_Fzh_static_info -u base_GHCziFloat_Dzh_static_info -u base_GHCziPtr_Ptr_static_info -u base_GHCziWord_Wzh_static_info -u base_GHCziInt_I8zh_static_info -u base_GHCziInt_I16zh_static_info -u base_GHCziInt_I32zh_static_info -u base_GHCziInt_I64zh_static_info -u base_GHCziWord_W8zh_static_info -u base_GHCziWord_W16zh_static_info -u base_GHCziWord_W32zh_static_info -u base_GHCziWord_W64zh_static_info -u base_GHCziStable_StablePtr_static_info -u base_GHCziBase_Izh_con_info -u base_GHCziBase_Czh_con_info -u base_GHCziFloat_Fzh_con_info -u base_GHCziFloat_Dzh_con_info -u base_GHCziPtr_Ptr_con_info -u base_GHCziPtr_FunPtr_con_info -u base_GHCziStable_StablePtr_con_info -u base_GHCziBase_False_closure -u base_GHCziBase_True_closure -u base_GHCziPack_unpackCString_closure -u base_GHCziIOBase_stackOverflow_closure -u base_GHCziIOBase_heapOverflow_closure-u base_GHCziIOBase_NonTermination_closure -u base_GHCziIOBase_BlockedOnDeadMVar_closure-u base_GHCziIOBase_BlockedIndefinitely_closure -u base_GHCziIOBase_Deadlock_closure -u base_GHCziIOBase_NestedAtomically_closure -u base_GHCziWeak_runFinalizzerBatch_closure -ubase_GHCziConc_ensureIOManagerIsRunning_closure /usr/lib/gcc-lib/powerpc-linux/3.3.5/../../../crt1.o /usr/lib/gcc-lib/powerpc-linux/3.3.5/../../../crti.o /usr/lib/gcc-lib/powerpc-linux/3.3.5/crtbegin.o -L/usr/lib/ghc-6.6 -L/usr/lib/gcc-lib/powerpc-linux/3.3.5 -L/usr/lib/gcc-lib/powerpc-linux/3.3.5/../../.. Assert.o -lHSbase -lHSbase_cbits -lHSrts_debug -lm -lgmp -ldl -lrt -lbfd -liberty -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc-lib/powerpc-linux/3.3.5/crtsavres.o /usr/lib/gcc-lib/powerpc-linux/3.3.5/crtend.o /usr/lib/gcc-lib/powerpc-linux/3.3.5/../../../crtn.o
GNU ld version 2.15
  Supported emulations:
   elf32ppclinux
   elf32ppc
   elf32ppcsim
   elf64ppc
link: done
*** Deleting temp files:
Deleting:
*** Deleting temp dirs:
Deleting: /tmp/ghc2366_0
[0] ms@isis:/tmp/chr > gdb ./Assert
GNU gdb 6.3-debian
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "powerpc-linux"...Using host libthread_db library "/lib/tls/libthread_db.so.1".

(gdb) run > /dev/null
Starting program: /tmp/chr/Assert > /dev/null
[Thread debugging using libthread_db enabled]
[New Thread 805412480 (LWP 2375)]
Assert: internal error: ASSERTION FAILED: file Schedule.c, line 1774

    (GHC version 6.6 for powerpc_unknown_linux)
    Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

Program received signal SIGABRT, Aborted.
[Switching to Thread 805412480 (LWP 2375)]
0x0fccf590 in raise () from /lib/tls/libc.so.6
(gdb) q
The program is running.  Exit anyway? (y or n) n
Not confirmed.
(gdb) bt
#0  0x0fccf590 in raise () from /lib/tls/libc.so.6
#1  0x0fcd0f8c in abort () from /lib/tls/libc.so.6
#2  0x102859a0 in rtsFatalInternalErrorFn ()
#3  0x10285638 in barf ()
#4  0x1028568c in _assertFail ()
#5  0x10287178 in scheduleHandleThreadBlocked ()
#6  0x10286a1c in schedule ()
#7  0x10287b24 in scheduleWaitThread ()
#8  0x10284428 in rts_evalLazyIO ()
#9  0x10283a70 in main ()

Change History (5)

comment:1 Changed 12 years ago by igloo

Milestone: 6.6.1

This bug is also present in the HEAD. Here's a less noisy testcase:

import Control.Concurrent
import Control.Exception

main = do
        master <- myThreadId
        handle (const main) $ do
                sequence $ replicate 3 $
                        forkIO $ do t <- myThreadId
                                    putStrLn ("Start " ++ show t)
                                    threadDelay one_second
                                    putStrLn ("End " ++ show t)
                                    throwTo master NonTermination
                                    putStrLn ("Thrown " ++ show t)
                threadDelay (10 * one_second)

one_second :: Int
one_second = 1000000

comment:2 Changed 12 years ago by simonmar

Owner: set to simonmar

I'll take it.

comment:3 Changed 12 years ago by simonmar

Resolution: fixed
Status: newclosed

Fixed, thanks.

comment:4 Changed 10 years ago by simonmar

Architecture: MultipleUnknown/Multiple

comment:5 Changed 5 years ago by Simon Marlow <simonmar@…>

Note: See TracTickets for help on using tickets.