Opened 5 years ago

Closed 4 years ago

#10154 closed bug (invalid)

strange closure type 983040 (GHC version 7.8.3 for x86_64_unknown_linux)

Reported by: masterdezign Owned by:
Priority: high Milestone:
Component: Compiler Version: 7.8.3
Keywords: strange closure type Cc:
Operating System: Linux Architecture: Unknown/Multiple
Type of failure: Runtime crash Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description (last modified by masterdezign)

After compiling project with RTS options

$ ghc --make -threaded Simul.hs -fforce-recomp -O2

and running it on Ubuntu 12.04

$ time ./Simul +RTS -N6

repeatedly received this message:

Simul: internal error: evacuate: strange closure type 983040

(GHC version 7.8.3 for x86_64_unknown_linux) Please report this as a GHC bug:

Command terminated by signal 6 2131.46user 45.57system 6:13.95elapsed 582%CPU (0avgtext+0avgdata 185328maxresident)k 248inputs+0outputs (2major+11705minor)pagefaults 0swaps

$ ghc --info

[("Project name","The Glorious Glasgow Haskell Compilation System") ,("GCC extra via C opts"," -fwrapv") ,("C compiler command","/usr/bin/gcc") ,("C compiler flags"," -fno-stack-protector") ,("C compiler link flags","") ,("Haskell CPP command","/usr/bin/gcc") ,("Haskell CPP flags","-E -undef -traditional") ,("ld command","/usr/bin/ld") ,("ld flags","") ,("ld supports compact unwind","YES") ,("ld supports build-id","YES") ,("ld supports filelist","NO") ,("ld is GNU ld","YES") ,("ar command","/usr/bin/ar") ,("ar flags","q") ,("ar supports at file","YES") ,("touch command","touch") ,("dllwrap command","/bin/false") ,("windres command","/bin/false") ,("libtool command","libtool") ,("perl command","/usr/bin/perl") ,("target os","OSLinux") ,("target arch","ArchX86_64") ,("target word size","8") ,("target has GNU nonexec stack","True") ,("target has .ident directive","True") ,("target has subsections via symbols","False") ,("Unregisterised","NO") ,("LLVM llc command","llc") ,("LLVM opt command","opt") ,("Project version","7.8.3") ,("Booter version","7.4.1") ,("Stage","2") ,("Build platform","x86_64-unknown-linux") ,("Host platform","x86_64-unknown-linux") ,("Target platform","x86_64-unknown-linux") ,("Have interpreter","YES") ,("Object splitting supported","YES") ,("Have native code generator","YES") ,("Support SMP","YES") ,("Tables next to code","YES") ,("RTS ways","l debug thr thr_debug thr_l thr_p dyn debug_dyn thr_dyn thr_debug_dyn l_dyn thr_l_dyn") ,("Support dynamic-too","YES") ,("Support parallel --make","YES") ,("Dynamic by default","NO") ,("GHC Dynamic","YES") ,("Leading underscore","NO") ,("Debug on","False") ,("LibDir","/usr/local/haskell/ghc-7.8.3-x86_64/lib/ghc-7.8.3") ,("Global Package DB","/usr/local/haskell/ghc-7.8.3-x86_64/lib/ghc-7.8.3/package.conf.d") ]

Linux 3.2.0-54-generic #82-Ubuntu SMP Tue Sep 10 20:08:42 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

$ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.1-2ubuntu1~12.04' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 4.8.1 (Ubuntu 4.8.1-2ubuntu1~12.04)

Attachments (1)

code.tar.gz (84.8 KB) - added by masterdezign 5 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 5 years ago by masterdezign

Description: modified (diff)

Linux 3.2.0-54-generic #82-Ubuntu SMP Tue Sep 10 20:08:42 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

comment:2 Changed 5 years ago by masterdezign

Description: modified (diff)

comment:3 Changed 5 years ago by simonmar

Status: newinfoneeded

Please provide the source code so that we can reproduce the problem.

comment:4 Changed 5 years ago by masterdezign

Attaching the code.

It is hard to determine the piece of code which fails, since it might take several hours until the problem appears.

There is a clue what might be related to the problem, if you replace

  _ <- A.mapConcurrently calcWithMsg grid

in the main module (Simul.hs) with

mapM calcWithMsg grid

then the program does not seem to fail (I am checking if that is always the case).

Also, I am not sure if Data.Vector.Unboxed behaves well when using it unsafely (see Rk.hs).

Thank you.

Last edited 5 years ago by masterdezign (previous) (diff)

Changed 5 years ago by masterdezign

Attachment: code.tar.gz added

comment:5 Changed 5 years ago by masterdezign

Status: infoneedednew

comment:6 Changed 5 years ago by simonmar

If there are unsafe operations being used, could you try with the safe versions and see if it still reproduces?

Also, do you have any ways to reduce the repro case, or make it fail more quickly?

comment:7 Changed 5 years ago by simonmar

Status: newinfoneeded

comment:8 Changed 4 years ago by rwbarton

Resolution: invalid
Status: infoneededclosed

I tried building with -debug -rtsopts and running with +RTS -DS under gdb and sure enough, many hours later, I got this:

Running epsilon=5.0e-3 delta=1.8e-2
Running epsilon=5.0e-3 delta=1.9e-2
Running epsilon=5.0e-3 delta=2.0e-2
[New Thread 0x7fffa53ff700 (LWP 18847)]
epsilon=2.0e-2 delta=1.0e-3	=>	0 head(s) (92.3%)
Simul: internal error: ASSERTION FAILED: file rts/sm/Storage.c, line 789

    (GHC version 7.8.4 for x86_64_unknown_linux)
    Please report this as a GHC bug:

Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffe5dfc700 (LWP 18737)]
0x00007ffff6798077 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56	../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff6798077 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff6799458 in __GI_abort () at abort.c:89
#2  0x00000000007e5087 in rtsFatalInternalErrorFn (s=0x854810 "ASSERTION FAILED: file %s, line %u\n", ap=0x7fffe5df7cd8) at rts/RtsMessages.c:170
#3  0x00000000007e4cbf in barf (s=0x854810 "ASSERTION FAILED: file %s, line %u\n") at rts/RtsMessages.c:42
#4  0x00000000007e4d22 in _assertFail (filename=0x85a1c8 "rts/sm/Storage.c", linenum=789) at rts/RtsMessages.c:57
#5  0x0000000000804d69 in allocate (cap=0xacec60, n=8) at rts/sm/Storage.c:789
#6  0x000000000080f522 in stg_newByteArrayzh ()
#7  0x0000000000000000 in ?? ()

The failed assertion is at the end of allocate:

    IF_DEBUG(sanity, ASSERT(*((StgWord8*)p) == 0xaa));

Inspecting the memory before p (the pointer that allocate has just allocated, and is about to return) I see

(gdb) x/ga p-8
0x7ffff42ec9c0:	0x812e60 <stg_ARR_WORDS_info>
0x7ffff42ec9c8:	0x30
0x7ffff42ec9d0:	0x30002e0030002d
0x7ffff42ec9d8:	0x30003000300030
0x7ffff42ec9e0:	0x30003200300031
0x7ffff42ec9e8:	0x33003200340038
0x7ffff42ec9f0:	0x31003100340032
0x7ffff42ec9f8:	0x33003500380035
0x7ffff42eca00:	0xaaaaaaaaaaaa0032

so, I strongly suspect that something in the C++ code in the double-conversion library is writing past the end of an allocated array.

It's quite a lot of C++ code though, so I don't particularly want to investigate further. I'll file a bug with double-conversion.

Note: See TracTickets for help on using tickets.