Segmentation Fault and small files for errors

Sep 01, 2009 08:44

I don't know if I should be proud of myself or not... but my toy application has Seg Faulted ghc :/

I found to suspicious things
  • Calling commit on a connection that had already been disconnected
  • Trying read an int out of the textual representation of a
    Data.ByteString.Lazy.Char8 and insert it into the database

I'm not quite sure, but fixing those two things have fixed the issue.

Another thing I'm noticing is to keep files extremely small, because while compile errors are verbose, runtime error reporting in ghci is very weak. Seg Fault gave me nothing... The error

Prelude.read: no parse
Gives me just a filename and no line number.

I'm excited I've reached a milestone in my toy application... I can
  • Send out HTML
  • Include data from the Database in the HTML
  • Process input from a form
  • Save the data to the db
  • Do a redirect
It's taken quite a few hours in 30 minute chunks to get this far. It's a good problem for exercising basic Haskell knowledge.

debugging, errors, haskell, haskwhal

Previous post Next post
Up