
Hi all, doing some work with a regex library I stumbled over some segmentation faults due to illegal byte combinatations. Looking for a way to get this caught some way, I failed in finding any place at GHC (6.10.1) or Hackage libraries where this is covered -- a quick check with HUnit revealed it to be crashing by this phenomenon. So I would like to ask about the state of this issue, o Is there principally no way to (generally) catch segmentation faults?? (This would be hard to believe, as the described kind of noise is to be expected at production systems, especially with user generated content.) o Are segmentation faults «prohibited» in Haskell so the advice is just to change the used library and forget the whole stuff?? o Did I oversee the generic mechanism for catching of segmentation faults?? (If yes, do you please give me a hint??) o If no, is there a workaround which might be practicable?? Thanks a lot in advance, Dorinho

On 2009 Mar 18, at 19:44, Nick Rudnick wrote:
o Is there principally no way to (generally) catch segmentation faults?? (This would be hard to believe, as the described kind of noise is to be expected at production systems, especially with user generated content.)
System.Posix.Signals. But your assumption is wrong, considering that after a segfault occurs there are no guarantees that the runtime (whether for Haskell or C) is in a sane state. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH
participants (2)
-
Brandon S. Allbery KF8NH
-
Nick Rudnick