#4860: Text.Regex crasher
------------------------+---------------------------------------------------
    Reporter:  batkins  |       Owner:                
        Type:  bug      |      Status:  new           
    Priority:  normal   |   Component:  libraries/base
     Version:  7.0.1    |    Keywords:  regex crash   
    Testcase:           |   Blockedby:                
          Os:  MacOS X  |    Blocking:                
Architecture:  x86      |     Failure:  Runtime crash 
------------------------+---------------------------------------------------
 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.
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4860>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to