Ticket #452 (closed bug: Fixed)

Opened 8 years ago

Last modified 43 years ago

+RTS -xc and SIGINT handler gives seg fault

Reported by: fergus Owned by: nobody
Priority: normal Milestone:
Component: Profiling Version: None
Keywords: Cc:
Operating System: Architecture:
Type of failure: Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description

To reproduce this bug, save the attached file Bug.hs, 
run the following commands

  ghc -package posix -prof -auto-all Bug.hs
  ./a.out +RTS -xc

and then hit control-C.  The result is a SIGSEGV inside
fprintCCS().

Attachments

Bug.2.hs Download (0.7 KB) - added by fergus 8 years ago.

Change History

Changed 8 years ago by fergus

Changed 8 years ago by fergus

  • status changed from assigned to closed

Changed 8 years ago by fergus

Logged In: YES 
user_id=135331

The crash is a null pointer dereference in fprintCCS().
Here's a gdb stack trace

(gdb) where
#0  0x08072cbf in fprintCCS ()
#1  0x00000000 in ?? ()
#2  0x08077fa1 in raiseAsyncWithLock ()
#3  0x402b60f0 in ?? ()
#4  0x0809f3e8 in MainCapability ()
#5  0x402c2014 in ?? ()
#6  0x0807b2d2 in raisezh_fast ()
#7  0x401a3440 in _IO_2_1_stdout_ () from /lib/libc.so.6
#8  0x0809f174 in hp_file ()
#9  0x402c2024 in ?? ()
#10 0x00000000 in ?? ()
#11 0x00000001 in ?? ()
#12 0x402c2024 in ?? ()
#13 0x00000002 in ?? ()
#14 0x00000000 in ?? ()
#15 0x0000001c in ?? ()
#16 0x08099314 in Main_CAFs_cc ()
#17 0x01db846e in ?? ()
#18 0x08099334 in Main_CAFs_cc_ccs ()

The crash occurs at fprintCCS+44:
0x08072c93 <fprintCCS+0>:       push   %esi
0x08072c94 <fprintCCS+1>:       push   %ebx
0x08072c95 <fprintCCS+2>:       sub    $0x14,%esp
0x08072c98 <fprintCCS+5>:       mov    0x20(%esp),%esi
0x08072c9c <fprintCCS+9>:       mov    0x24(%esp),%ebx
0x08072ca0 <fprintCCS+13>:      mov    %esi,0x4(%esp)
0x08072ca4 <fprintCCS+17>:      movl   $0x3c,(%esp)
0x08072cab <fprintCCS+24>:      call   0x80492c8 <_init+712>
0x08072cb0 <fprintCCS+29>:      test   %ebx,%ebx
0x08072cb2 <fprintCCS+31>:      je     0x8072d0e <fprintCCS+123>
0x08072cb4 <fprintCCS+33>:      cmp    $0x809d100,%ebx
0x08072cba <fprintCCS+39>:      je     0x8072d0e <fprintCCS+123>
0x08072cbc <fprintCCS+41>:      mov    0x4(%ebx),%eax
0x08072cbf <fprintCCS+44>:      mov    0x4(%eax),%eax

eax is zero.

Changed 8 years ago by simonmar

  • status changed from assigned to closed
Logged In: YES 
user_id=48280

This one has been fixed in 6.4.1 (out soon).
Note: See TracTickets for help on using tickets.