Skip to content

filterPS fails if skips > 255 characters

The following program:

  import System         ( getArgs )
  import PackedString   ( filterPS, packString )

  main  = System.getArgs >>= realMain 
  realMain [c:[]] = print $ filterPS (c ==) (packString
str)
    where str = replicate 252 'y' ++ "abcdef"

will segmentation fault if given ["d"], ["e"], or ["f"]
as it's arguments.
Things work as expect with any other argument. 
Similarly, GHCi
segmentation faults when you try to evaluate realMain
["d"], etc.

This is 5.02.3 on Debian x86.

        thanks,
        mike
Trac metadata
Trac field Value
Version 5.02
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution ResolvedFixed
Component hslibs/lang
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information