[Haskell-beginners] "Segmentation fault/access violation" when working with FFI

Leza Morais Lutonda leza.ml at fecrd.cujae.edu.cu
Mon Jan 6 11:23:28 UTC 2014


El 1/4/2014 23:50, Henk-Jan van Tuyl escribió:
> As far as I can tell, there is no good solution for this. You can try 
> to get a stack trace[0][1], or, at Haskell level, find the location 
> error with the GHCi debugger[2]
>
> Check if you have the correct versions of dynamic libraries, if 
> applicable. Note, that a missing dynamic library is not always 
> reported properly; sometimes, GHCi mentions a missing dynamic library, 
> while this is not reported when running a compiled program. For 
> Windows, there are cygcheck and Dependency Walker to get an overview 
> of the DLL dependencies.
>
> Another problem, that might arise, is a changed calling convention; 
> the Haskell binding to PortAudio uses ccall, the PortAudio C software 
> might have recently adopted a different calling convention.
>
> Regards,
> Henk-Jan van Tuyl
>
Thanks for the answer.

Fortunately I could solve the problem (infortunately without knowing 
exactly what was causing it). I guess there is a bug in Sound.PortAudio 
module that causes the problem.
What I did is to work directly with the bindings functions to the C Api 
in module Sound.PortAudio.Base and make my own `play` function (maybe 
some day publishing a package for easily playing and recording sound).

-- 
Leza Morais Lutonda
https://github.com/lemol


More information about the Beginners mailing list