[Haskell-cafe] Re: user error when using Text.Regex.PCRE

Olivier Boudry olivier.boudry at gmail.com
Tue Nov 20 10:17:08 EST 2007


On Nov 20, 2007 9:36 AM, ChrisK <haskell at list.mightyreason.com> wrote:

> Thank you very much for the error report.  I have tracked down the cause.
>
> You are searching against an empty Bytestring.  This is now represented by
>
> > -- | /O(1)/ The empty 'ByteString'
> > empty :: ByteString
> > empty = PS nullForeignPtr 0 0
>
> And while the useAsCString and useAsCStringLen functions never reveal the
> null
> pointer, the current library uses unsafeUseAsCStringLen, which returns the
> null
> pointer.
>
> And this is getting caught by a null pointer check resulting in your
> crash.  I
> will post a fix later tonight, and announce it.
>
> Which regex-prce version are you using?  Perhaps from hackage?  I want to
> prioritize the version you need fixed.
>
> The earlier repository holds up to version 0.81 at
> http://darcs.haskell.org/packages/regex-pcre/
> The newer repository holds up to version 0.92 at
>
> http://darcs.haskell.org/packages/regex-unstable/regex-pcre/regex-pcre.cabal
>
> Out of further curiosity:
>
> Which version of the pcre library does it use?
> And what version of ghc?
> Which version of Data.ByteString?
>
> Cheers,
>  Chris Kuklewicz
>


Hi Chris,

I'm using ghc-6.8.1, regex-pcre-0.92, bytestring-0.9.0.1 and libpcre-7.4.

Using your information, I might be able to workaround the problem by
filtering out empty bytestrings before applying the next regex.

Thanks for your reply,

Olivier.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20071120/585d760b/attachment.htm


More information about the Haskell-Cafe mailing list