[GHC] #7655: 7.4.2 Segmentation Fault/Bus Error in large exponentation

#7655: 7.4.2 Segmentation Fault/Bus Error in large exponentation -----------------------+---------------------------------------------------- Reporter: Doug310 | Owner: Type: bug | Status: new Priority: normal | Component: GHCi Version: 7.4.2 | Keywords: Os: MacOS X | Architecture: x86_64 (amd64) Failure: GHCi crash | Blockedby: Blocking: | Related: -----------------------+---------------------------------------------------- Mac OS X 10.8.2. Haskell Platform 2012.4, 64-bit. GHCI 7.4.2. Large exponentations cause bus errors or segmentation faults. Examples: {{{ ~/src/haskell$ ghci GHCi, version 7.4.2: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Prelude> 12345678901234567890 ^ 12345 Bus error: 10 ~/src/haskell$ ghci GHCi, version 7.4.2: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Prelude> 2384729837498237^23455 Segmentation fault: 11 }}} -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7655 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7655: 7.4.2 Segmentation Fault/Bus Error in large exponentation -------------------------------+-------------------------------------------- Reporter: Doug310 | Owner: Type: bug | Status: closed Priority: normal | Component: GHCi Version: 7.4.2 | Resolution: fixed Keywords: | Os: MacOS X Architecture: x86_64 (amd64) | Failure: GHCi crash Blockedby: | Blocking: Related: | -------------------------------+-------------------------------------------- Changes (by monoidal): * status: new => closed * resolution: => fixed Comment: This is fixed in GHC 7.6.1, according to http://www.reddit.com/r/haskell/comments/17jyw9/announce_ghc_version_762/c86... If you can reproduce the bug in 7.6, please reopen. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7655#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7655: 7.6.2 Segmentation Fault/Bus Error in large exponentation
-------------------------------+--------------------------------------------
Reporter: Doug310 | Owner:
Type: bug | Status: new
Priority: normal | Component: GHCi
Version: 7.6.2 | Resolution:
Keywords: | Os: MacOS X
Architecture: x86_64 (amd64) | Failure: GHCi crash
Blockedby: | Blocking:
Related: |
-------------------------------+--------------------------------------------
Changes (by Doug310):
* status: closed => new
* version: 7.4.2 => 7.6.2
* resolution: fixed =>
Comment:
Unfortunately, I am able to reproduce this partially in 7.6.2 for x86_64
using the available binary distribution: ghc-7.6.2-x86_64-apple-
darwin.tar.bz2.
{{{
~/src/haskell/ghc/ghc-7.6.2$ ghci
GHCi, version 7.6.2: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude> 12345678901234567890 ^ 12345
Bus error: 10
}}}
However, my second example works:
{{{
~/src/haskell/ghc/ghc-7.6.2$ ghci
GHCi, version 7.6.2: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude> 2384729837498237 ^ 23455
6856427983194016568523 .... (goes on for hundreds of lines)
}}}
The full Bus Error crash report is:
{{{
Process: ghc [27889]
Path: /opt/ghc-7.6.2-x86_64/*/ghc
Identifier: ghc
Version: ???
Code Type: X86-64 (Native)
Parent Process: bash [24202]
User ID: 501
Date/Time: 2013-02-04 00:01:12.441 -0500
OS Version: Mac OS X 10.8.2 (12C60)
Report Version: 10
Interval Since Last Report: 3611040 sec
Crashes Since Last Report: 696
Per-App Crashes Since Last Report: 7
Anonymous UUID: 145798BC-982C-D5DB-8C3A-18EA16FAB47B
Crashed Thread: 1
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x000000011203c998
VM Regions Near 0x11203c998:
MALLOC metadata 000000011203b000-000000011203c000 [ 4K]
r--/rwx SM=PRV
--> Stack 000000011203c000-000000011203d000 [ 4K]
---/rwx SM=NUL
Stack 000000011203d000-00000001120bf000 [ 520K]
rw-/rwx SM=COW
Thread 0:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff8bbae0fa __psynch_cvwait
+ 10
1 libsystem_c.dylib 0x00007fff93534f89
_pthread_cond_wait + 869
2 ghc 0x00000001100e16c9 waitCondition +
9
3 ghc 0x00000001100be8ab yieldCapability
+ 395
4 ghc 0x00000001100cd382 schedule + 386
5 ghc 0x00000001100cddf4
scheduleWaitThread + 164
6 ghc 0x00000001100c878e real_main + 68
7 ghc 0x00000001100c8896 hs_main + 93
8 ghc 0x000000010e0d44f9 main + 73
9 ghc 0x000000010e00dbb4 start + 52
Thread 1 Crashed:
0 ??? 0x00000001129c3d3c 0 + 4607196476
1 ??? 0x00000001129f44b3 0 + 4607394995
2 ??? 0x00000001129dbbe4 0 + 4607294436
3 ??? 0x00000001129f119c 0 + 4607381916
4 ??? 0x00000001129cc8f2 0 + 4607232242
5 ??? 0x00000001129c74fa 0 + 4607210746
6 ??? 0x00000001129ab454 0 + 4607095892
7 ghc 0x00000001100f38c8
stg_marked_upd_frame_info_dsp + 16
8 ??? 0x058d482177000000 0 +
400055250473451520
Thread 2:
0 libsystem_kernel.dylib 0x00007fff8bbaed2a kevent64 + 10
1 ghc 0x000000011006c8f2 s52S_info + 170
2 ghc 0x000000011006ca48 s6qO_info_dsp +
24
Thread 3:
0 libsystem_kernel.dylib 0x00007fff8bbae0fa __psynch_cvwait
+ 10
1 libsystem_c.dylib 0x00007fff93534f89
_pthread_cond_wait + 869
2 ghc 0x00000001100e16c9 waitCondition +
9
3 ghc 0x00000001100be8ab yieldCapability
+ 395
4 ghc 0x00000001100cd382 schedule + 386
5 ghc 0x00000001100cdccb scheduleWorker
+ 27
6 libsystem_c.dylib 0x00007fff93530742 _pthread_start
+ 327
7 libsystem_c.dylib 0x00007fff9351d181 thread_start +
13
Thread 1 crashed with X86 Thread State (64-bit):
rax: 0x00000000000a5771 rbx: 0x0000000000000560 rcx:
0x00000000ffffffeb rdx: 0x00000000000000ac
rdi: 0x000000011203c440 rsi: 0x0000000113b24680 rbp:
0x00000001120312c0 rsp: 0x0000000112031248
r8: 0x000000000018192d r9: 0x00000000000000a9 r10:
0xe7d24d796c78192d r11: 0x41430d29ed17e85b
r12: 0x0000000000000007 r13: 0x00000000000000a9 r14:
0x0000000000000003 r15: 0x00000000000000ac
rip: 0x00000001129c3d3c rfl: 0x0000000000010286 cr2:
0x000000011203c998
Logical CPU: 4
Binary Images:
0x10e00d000 - 0x1101c0fe7 +ghc (???) <1010B9EB-C2AF-
32E2-AD15-CEB7B26CA475> /opt/ghc-7.6.2-x86_64/*/ghc
0x7fff6dc0d000 - 0x7fff6dc4193f dyld (210.2.3)
<A40597AA-5529-3337-8C09-D8A014EB1578> /usr/lib/dyld
0x7fff8787a000 - 0x7fff87880fff libmacho.dylib (829)

#7655: 7.6.2 Segmentation Fault/Bus Error in large exponentation -------------------------------+-------------------------------------------- Reporter: Doug310 | Owner: Type: bug | Status: new Priority: normal | Component: GHCi Version: 7.6.2 | Resolution: Keywords: | Os: MacOS X Architecture: x86_64 (amd64) | Failure: GHCi crash Blockedby: | Blocking: Related: | -------------------------------+-------------------------------------------- Comment(by Doug310): I downloaded the i386 Mac OS X binary of 7.6.2 and tested both these exponentiations, and one more (with another digit in the exponent just for good measure). They all worked fine. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7655#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7655: 7.6.2 Segmentation Fault/Bus Error in large exponentation -------------------------+-------------------------------------------------- Reporter: Doug310 | Owner: igloo Type: bug | Status: new Priority: normal | Milestone: 7.8.1 Component: GHCi | Version: 7.6.2 Resolution: | Keywords: Os: MacOS X | Architecture: x86_64 (amd64) Failure: GHCi crash | Difficulty: Unknown Testcase: | Blockedby: Blocking: | Related: -------------------------+-------------------------------------------------- Changes (by igloo): * owner: => igloo * difficulty: => Unknown * milestone: => 7.8.1 Comment: Thanks for the report. I'll see if I can reproduce the problem. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7655#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC