[GHC] #9446: Segfault when using unsafe vector operations

#9446: Segfault when using unsafe vector operations ----------------------------------+---------------------------------------- Reporter: snoyberg | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.3 Keywords: | Operating System: Linux Architecture: x86_64 (amd64) | Type of failure: Runtime crash Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: ----------------------------------+---------------------------------------- I was working on some benchmarks and I ran into this issue. It's actually very difficult to reproduce; changing the attached file in different ways makes the bug go away quite quickly. But with the attached file, I regularly get a `internal error: evacuate: strange closure type 0` message, though on more complicated versions of the code I was working on, the integer would change for each run. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9446 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9446: Segfault when using unsafe vector operations ----------------------------------------+---------------------------------- Reporter: snoyberg | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.8.3 Resolution: invalid | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: Runtime crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: Differential Revisions: | ----------------------------------------+---------------------------------- Changes (by rwbarton): * status: new => closed * resolution: => invalid Comment: `slice` is non-copying, and so `unsafeFreeze` on a `slice` freezes the underlying vector. You can't then later write to the mutable vector that has been frozen without confusing the GC. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9446#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9446: Segfault when using unsafe vector operations ----------------------------------------+---------------------------------- Reporter: snoyberg | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.8.3 Resolution: invalid | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: Runtime crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: Differential Revisions: | ----------------------------------------+---------------------------------- Changes (by klao): * cc: klao@… (added) Comment: Hmm, this sounds quite restrictive. So, do I understand correctly that there is no way to freeze a part of a mutable vector? Even if I know that that part will not change? Can you point to a relevant description of this part of the GC? I'd like to understand the situation better to figure out what kind of work-around is possible (if at all). Thank you! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9446#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9446: Segfault when using unsafe vector operations ----------------------------------------+---------------------------------- Reporter: snoyberg | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.8.3 Resolution: invalid | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: Runtime crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: Differential Revisions: | ----------------------------------------+---------------------------------- Comment (by snoyberg): I've attached a new file, vector-bug-fixed.hs, which (inspired by some attoparsec code) thaws an immutable vector before writing to it, which seems to address the issue. I have not investigated the performance impact of this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9446#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC