Text.Regex crasher
I noticed that my Haskell program encountered a stack overflow when it called Data.String.Utils.splitW. Investigating further, I saw the following behavior.
In GHCI:
splitWs "foo bar"
<interactive>: memory allocation failed (requested 1581252608 bytes)
In splitWs's source code, it evaluates splitRegex (mkRegex "[ \t\n\r\v\f]+")
Evaluating this expression crashes GHCI:
*Main Text.Regex> splitRegex (mkRegex "[ \t\n\r\v\f]+") "foo bar"
Using the functions in Text.Regex, I tried:
splitRegex (mkRegex " ") "foo bar"
which correctly returns ["foo", "bar"]. The regex above seems to be the problem.
Running the latest GHC (7.0.1) on OS X Snow Leopard. Note that the original crash occurred in a compiled program - this is not GHCi only. Here is the original crash in the compiled application:
Stack space overflow: current size 8388608 bytes.
Use `+RTS -Ksize -RTS' to increase it.
Trac metadata
Trac field | Value |
---|---|
Version | 7.0.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | libraries/base |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |