<div dir="ltr">I've verified the crash occurs when building with c2hs-0.25.2, and does not occur when building with c2hs-0.18.2.<div><br></div><div>The generated code for withGlyph in 0.18.2 is:</div><div><br></div><div><div>        (\(CCharT ptr) val -> do {pokeByteOff ptr 0 (val::CULong)}) (CCharT pBuf) cAttrs</div><div>        (\(CCharT ptr) val -> do {pokeByteOff ptr 8 (val::(CWString))}) (CCharT pBuf) (wordPtrToPtr (fromIntegral (ord char)))</div><div>        io (CCharT pBuf)</div></div><div><br></div><div>The generated code for withGlyph in 0.25.2 is:</div><div><br></div><div><div>        (\(CCharT ptr) val -> do {pokeByteOff ptr 0 (val :: CULong)}) (CCharT pBuf) cAttrs</div><div>        (\(CCharT ptr) val -> do {copyArray (ptr `plusPtr` 8) (val :: (CWString)) 5}) (CCharT pBuf) (wordPtrToPtr (fromIntegral (ord char)))</div><div>        io (CCharT pBuf)</div></div><div><br></div><div>The 0.25.2 code is definitely not going to work.</div><div><br></div><div>Looking through the c2hs changelog, there are a number of suspicious-sounding entries that could be related:</div><div><br></div><div>* [0.21.1] Fix treatment of arrays within structs [#115]</div><div>* [0.21.1] Add default marshallers for C types [#83]</div><div>* [0.22.1] Default marshallers for Char types [#98]</div><div>* [0.24.1] Arrays in structuress bug [#123]</div><div><br></div><div>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.</div><div><br></div><div>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.</div></div>