[GHC] #14669: 32-bit binaries sometimes throw a stack overflow on shutdown.
GHC
ghc-devs at haskell.org
Wed Jan 24 07:03:33 UTC 2018
#14669: 32-bit binaries sometimes throw a stack overflow on shutdown.
-----------------------------------+----------------------------------
Reporter: sergv | Owner: (none)
Type: bug | Status: infoneeded
Priority: normal | Milestone:
Component: Runtime System | Version: 8.2.1
Resolution: | Keywords:
Operating System: Windows | Architecture: x86
Type of failure: Runtime crash | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-----------------------------------+----------------------------------
Comment (by Phyx-):
hmm, ok. Looking closer, the issue is that at `-O1` and higher the
compiler notices the space isn't used. Because it's stack allocated it
won't be valid outside the frame anyway so it correctly optimizes away the
allocation.
I have to wait till the weekend to look at it, but things to try if you
wish:
- try marking the function `volatile`;
- try adding `__attribute__((optimize("O0")))` to the function to disable
optimizations.
Second one will probably work, but isn't very portable. so I'll likely go
with inline assembly.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14669#comment:23>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list