Opened 16 months ago

Last modified 3 months ago

#7789 new bug

GHCI core dumps when used with VTY

Reported by: timthelion Owned by:
Priority: normal Milestone: 7.10.1
Component: GHCi Version: 7.4.2-rc1
Keywords: core dump Cc: hvr, george.colpitts@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: GHCi crash Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

Load the attached script in ghci:

$ghci ghci-coredumper.hs

(you need the vty-menu package from hackage) and type die

>die

You may see a menu with a set of ten numbers. If you do press enter repeatedly. Eventually it will core dump(at least it does for me) Unfortunately I have been unable to collect this core dump, but here is the output at least:

7f7ad1fc4000-7f7ad1fc5000 rwxp 000fd000 00:10 2839271                    /usr/lib/libm-2.17.so
7f7ad1fc5000-7f7ad2032000 r-xp 00000000 00:10 3028085                    /usr/lib/libgmp.so.10.1.1
7f7ad2032000-7f7ad2231000 ---p 0006d000 00:10 3028085                    /usr/lib/libgmp.so.10.1.1
7f7ad2231000-7f7ad2232000 r-xp 0006c000 00:10 3028085                    /usr/lib/libgmp.so.10.1.1
7f7ad2232000-7f7ad223b000 rwxp 0006d000 00:10 3028085                    /usr/lib/libgmp.so.10.1.1
7f7ad223b000-7f7ad2252000 r-xp 00000000 00:10 2839310                    /usr/lib/libpthread-2.17.so
7f7ad2252000-7f7ad2451000 ---p 00017000 00:10 2839310                    /usr/lib/libpthread-2.17.so
7f7ad2451000-7f7ad2452000 r-xp 00016000 00:10 2839310                    /usr/lib/libpthread-2.17.so
7f7ad2452000-7f7ad2453000 rwxp 00017000 00:10 2839310                    /usr/lib/libpthread-2.17.so
7f7ad2453000-7f7ad2457000 rwxp 00000000 00:00 0 
7f7ad2457000-7f7ad245a000 r-xp 00000000 00:10 2839316                    /usr/lib/libdl-2.17.so
7f7ad245a000-7f7ad2659000 ---p 00003000 00:10 2839316                    /usr/lib/libdl-2.17.so
7f7ad2659000-7f7ad265a000 r-xp 00002000 00:10 2839316                    /usr/lib/libdl-2.17.so
7f7ad265a000-7f7ad265b000 rwxp 00003000 00:10 2839316                    /usr/lib/libdl-2.17.so
7f7ad265b000-7f7ad265d000 r-xp 00000000 00:10 2839280                    /usr/lib/libutil-2.17.so
7f7ad265d000-7f7ad285c000 ---p 00002000 00:10 2839280                    /usr/lib/libutil-2.17.so
7f7ad285c000-7f7ad285d000 r-xp 00001000 00:10 2839280                    /usr/lib/libutil-2.17.so
7f7ad285d000-7f7ad285e000 rwxp 00002000 00:10 2839280                    /usr/lib/libutil-2.17.so
7f7ad285e000-7f7ad2865000 r-xp 00000000 00:10 2839273                    /usr/lib/librt-2.17.so
7f7ad2865000-7f7ad2a64000 ---p 00007000 00:10 2839273                    /usr/lib/librt-2.17.so
7f7ad2a64000-7f7ad2a65000 r-xp 00006000 00:10 2839273                    /usr/lib/librt-2.17.so
7f7ad2a65000-7f7ad2a66000 rwxp 00007000 00:10 2839273                    /usr/lib/librt-2.17.so
7f7ad2a66000-7f7ad2ac0000 r-xp 00000000 00:10 3403181                    /usr/lib/libncursesw.so.5.9
7f7ad2ac0000-7f7ad2cbf000 ---p 0005a000 00:10 3403181                    /usr/lib/libncursesw.so.5.9
7f7ad2cbf000-7f7ad2cc3000 r-xp 00059000 00:10 3403181                    /usr/lib/libncursesw.so.5.9
7f7ad2cc3000-7f7ad2cc5000 rwxp 0005d000 00:10 3403181                    /usr/lib/libncursesw.so.5.9
7f7ad2cc5000-7f7ad2ce6000 r-xp 00000000 00:10 2839312                    /usr/lib/ld-2.17.so
7f7ad2e39000-7f7ad2eba000 rwxp 00000000 00:00 0 
7f7ad2ee4000-7f7ad2ee6000 rwxp 00000000 00:00 0 
7f7ad2ee6000-7f7ad2ee7000 r-xp 00021000 00:10 2839312                    /usr/lib/ld-2.17.so
7f7ad2ee7000-7f7ad2ee8000 rwxp 00022000 00:10 2839312                    /usr/lib/ld-2.17.so
7f7ad2ee8000-7f7ad2ee9000 rwxp 00000000 00:00 0 
7fff979b8000-7fff979d9000 rwxp 00000000 00:00 0                          [stack]
7fff979fe000-7fff97a00000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
Neúspěšně ukončen (SIGABRT) (core dumped [obraz paměti uložen])

Sometimes it dumps immediately, sometimes it takes a while.

Sometimes the errors are different:

*** Exception: user error (Terminal does not define required capability "cup")
*Main> 

*** Exception: user error (Terminal does not define required capability "setab")
*Main> 
<stdin>: hWaitForInput: end of file

But mostly it just core dumps.

Attachments (2)

ghci-coredumper.hs (78 bytes) - added by timthelion 16 months ago.
File that causes core dump
bug-report.txt (18.0 KB) - added by George 3 months ago.
Problem report on Apple

Download all attachments as: .zip

Change History (9)

Changed 16 months ago by timthelion

File that causes core dump

comment:1 Changed 16 months ago by timthelion

Replacing "die" with "main" and compiling that as a normal program produces a non-core-dumping executable.

comment:2 Changed 16 months ago by timthelion

$ ghci -fno-ghci-sandbox ghci-coredumper.hs

also core dumps

comment:3 Changed 15 months ago by igloo

  • Difficulty set to Unknown
  • Milestone set to 7.8.1
  • Owner set to igloo

Thanks for the report. I'll see if I can reproduce it.

comment:4 Changed 12 months ago by igloo

  • Owner igloo deleted

comment:5 Changed 3 months ago by George

  • Cc hvr added

On 7.8.2 on Mac OS 10.9.2 compiling and loading this gives:

ghc(57163,0x10f787000) malloc: *** error for object 0x7f9ffa501270: 
pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6

stack trace for thread that crashes

Thread 3 Crashed:
0   libsystem_kernel.dylib        	0x00007fff8c173866 __pthread_kill + 10
1   libsystem_pthread.dylib       	0x00007fff8b9cd35c pthread_kill + 92
2   libsystem_c.dylib             	0x00007fff8aeb9b1a abort + 125
3   libsystem_malloc.dylib        	0x00007fff9070207f free + 411
4   libncurses.5.4.dylib          	0x00007fff896771c6 del_curterm + 52
5   libHSrts_thr-ghc7.8.2.dylib   	0x000000010f466194 scheduleFinalizers + 132

See attachment bug-report.txt below for more details.

I sometimes get a segmentation fault also. When I tried this with

ghci -fno-ghci-sandbox ghci-coredumper.hs

I also got a segmentation violation.

Last edited 3 months ago by George (previous) (diff)

Changed 3 months ago by George

Problem report on Apple

comment:6 Changed 3 months ago by George

  • Cc george.colpitts@… added

comment:7 Changed 3 months ago by thoughtpolice

  • Milestone changed from 7.8.3 to 7.10.1

Moving to 7.10.1

Note: See TracTickets for help on using tickets.