Opened 3 years ago

Closed 19 months ago

#7043 closed bug (fixed)

32-bit GHC ceiling of negative float SEGFAULT: 11

Reported by: DrGodCarl Owned by:
Priority: high Milestone: 7.8.1
Component: Compiler Version: 7.4.1
Keywords: Segfault, ceiling, segmentation fault Cc: pho@…, kazu@…, bgamari@…
Operating System: MacOS X Architecture: Other
Type of failure: GHCi crash Test Case: arith005(ghci), num010(ghci)
Blocked By: Blocking:
Related Tickets: Differential Revisions:


When taking the ceiling of a negative float (like -0.8) with GHCi installed by the 32-bit .dmg provided on there is a Segmentation Fault: 11 that occurs. This does not happen in the 64-bit version, which works properly.

Change History (15)

comment:1 Changed 3 years ago by igloo

  • difficulty set to Unknown
  • Milestone set to 7.6.2
  • Owner set to igloo
  • Priority changed from normal to high

Thanks for the report. I can reproduce this:

$ inplace/bin/ghc-stage2 --interactive
GHCi, version 7.7.20121013:  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude> ceiling (-0.8)
Segmentation fault: 11

comment:2 Changed 3 years ago by lelf

it is in integer-gmp internals of encodeDouble#. I will look at it

comment:3 Changed 2 years ago by igloo

  • Blocked By 3658 added

This doesn't happen if dynamic-by-default is enabled.

comment:4 Changed 2 years ago by igloo

Also reported as #7449.

comment:5 Changed 2 years ago by igloo

See also #7475

comment:6 Changed 2 years ago by igloo

  • Test Case changed from ceiling (-0.8) to arith005(ghci)

comment:7 Changed 2 years ago by igloo

  • Test Case changed from arith005(ghci) to arith005(ghci), num010(ghci)

comment:8 Changed 2 years ago by PHO

  • Cc pho@… added

comment:9 Changed 2 years ago by kazu-yamamoto

  • Cc kazu@… added

comment:10 Changed 21 months ago by igloo

  • Owner igloo deleted

comment:11 Changed 20 months ago by kazu-yamamoto

Can anyone reproduce this with the latest GHC head?
3e598fe0b01f4692f50c377ac91010040227e7ce may fix this problem.

comment:12 Changed 20 months ago by jstolarek

I can only say that this bug is not reproducible with 32 & 64 bit *Linux* builds of HEAD compiled on 2nd July.

comment:13 Changed 19 months ago by bgamari

  • Milestone changed from 7.6.2 to 7.8.1
  • Status changed from new to infoneeded

Could someone verify that this is also fixed in HEAD on OS X (DrGodCarl perhaps)?

comment:14 Changed 19 months ago by kazu-yamamoto

Yes. I did. This was fixed in 32bit GHC on OS X.

> ceiling (-0.8)

comment:15 Changed 19 months ago by bgamari

  • Blocked By 3658 removed
  • Cc bgamari@… added
  • Resolution set to fixed
  • Status changed from infoneeded to closed

In that case I'm going to close this. If someone can reproduce the issue with HEAD feel free to reopen.

Note: See TracTickets for help on using tickets.