Hi there,
I'm trying to use cffi to write some bindings for libsane. Having quite some success, but for the following (rather bizarre) problem. libsane expects: sane_init(), do some stuff, sane_exit() but when I call sane_exit after having done anything non-trivial (for example, called sane_get_devices), sbcl segfaults and dies.
I realise that that's not the sort of question for the cffi list, _but_ I wrote a trivial C program that I think should be equivalent and it doesn't die. I can't work out *how* libsane can work in one case and not the other (!) so I was wondering if anyone could make any suggestions. I'm attaching the two source files here.
The other piece of information is that I asked about this on #lisp a few minutes ago, and hefner very kindly tested it out, with no segfault at his end. I've had the same symptom with both the asdf-installed cffi and the darcs lotsastuff branch. I presume there's an error somewhere in my libsane config which explains why it's dying, but I'm hoping that someone can explain how it can fail in the lisp program and not in the C one.
Oh, it's linux i386 with SBCL from CVS this evening.
Thanks,
Rupert