[Pkg-haskell-maintainers] Bug#786727: crashes with segfault when drawLineH is called

John Millikin jmillikin at gmail.com
Sun Jun 7 01:49:02 UTC 2015


I've verified the crash occurs when building with c2hs-0.25.2, and does not
occur when building with c2hs-0.18.2.

The generated code for withGlyph in 0.18.2 is:

        (\(CCharT ptr) val -> do {pokeByteOff ptr 0 (val::CULong)}) (CCharT
pBuf) cAttrs
        (\(CCharT ptr) val -> do {pokeByteOff ptr 8 (val::(CWString))})
(CCharT pBuf) (wordPtrToPtr (fromIntegral (ord char)))
        io (CCharT pBuf)

The generated code for withGlyph in 0.25.2 is:

        (\(CCharT ptr) val -> do {pokeByteOff ptr 0 (val :: CULong)})
(CCharT pBuf) cAttrs
        (\(CCharT ptr) val -> do {copyArray (ptr `plusPtr` 8) (val ::
(CWString)) 5}) (CCharT pBuf) (wordPtrToPtr (fromIntegral (ord char)))
        io (CCharT pBuf)

The 0.25.2 code is definitely not going to work.

Looking through the c2hs changelog, there are a number of
suspicious-sounding entries that could be related:

* [0.21.1] Fix treatment of arrays within structs [#115]
* [0.21.1] Add default marshallers for C types [#83]
* [0.22.1] Default marshallers for Char types [#98]
* [0.24.1] Arrays in structuress bug [#123]

My recommendation is to revert to an older c2hs version, because any
package that uses c2hs to set the contents of an array is likely to be
silently broken right now.

Some time in the next few days, I will build a bunch of c2hs binaries and
run that crash test to see which version in particular needs to be ifdef'd
in haskell-ncurses.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-haskell-maintainers/attachments/20150606/f65f1858/attachment.html>


More information about the Pkg-haskell-maintainers mailing list