On Nov 20, 2007 9:36 AM, ChrisK &lt;<a href="mailto:haskell@list.mightyreason.com">haskell@list.mightyreason.com</a>&gt; wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thank you very much for the error report. &nbsp;I have tracked down the cause.<br><br>You are searching against an empty Bytestring. &nbsp;This is now represented by<br><br>&gt; -- | /O(1)/ The empty &#39;ByteString&#39;<br>&gt; empty :: ByteString
<br>&gt; empty = PS nullForeignPtr 0 0<br><br>And while the useAsCString and useAsCStringLen functions never reveal the null<br>pointer, the current library uses unsafeUseAsCStringLen, which returns the null<br>pointer.<br>
<br>And this is getting caught by a null pointer check resulting in your crash. &nbsp;I<br>will post a fix later tonight, and announce it.<br><br>Which regex-prce version are you using? &nbsp;Perhaps from hackage? &nbsp;I want to<br>prioritize the version you need fixed.
<br><br>The earlier repository holds up to version 0.81 at<br><a href="http://darcs.haskell.org/packages/regex-pcre/" target="_blank">http://darcs.haskell.org/packages/regex-pcre/</a><br>The newer repository holds up to version 
0.92 at<br><a href="http://darcs.haskell.org/packages/regex-unstable/regex-pcre/regex-pcre.cabal" target="_blank">http://darcs.haskell.org/packages/regex-unstable/regex-pcre/regex-pcre.cabal</a><br><br>Out of further curiosity:
<br><br>Which version of the pcre library does it use?<br>And what version of ghc?<br>Which version of Data.ByteString?<br><br>Cheers,<br> &nbsp;Chris Kuklewicz<br></blockquote></div><br><br>Hi Chris,<br>
<br>
I&#39;m using ghc-6.8.1, regex-pcre-0.92, bytestring-0.9.0.1 and libpcre-7.4.<br>
<br>
Using your information, I might be able to workaround the problem by
filtering out empty bytestrings before applying the next regex.<br>
<br>
Thanks for your reply,<br>
<br>
Olivier.<br>
<br>