any advice for debugging crashing Alien FFI callbacks?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

any advice for debugging crashing Alien FFI callbacks?

ccrraaiigg

Hi--

     I've got basic FFI connectivity going between Squeak 5 and a C
library I want to use, via Alien. Callouts seem to work, and some
callbacks. Other callbacks crash, though. I know which callback isn't
successfully called, but I don't have the library source, so I'm not
entirely sure what it's trying to do at that point. I'm on Mac OS 10.11.
I attached lldb before the crash and am staring at the library's
disassembled instructions.

     Does anyone have any advice for how to debug?


     thanks,

-C

--
Craig Latta
netjam.org
+31   6 2757 7177 (SMS ok)
+ 1 415  287 3547 (no SMS)


Reply | Threaded
Open this post in threaded view
|

Re: any advice for debugging crashing Alien FFI callbacks?

Eliot Miranda-2
Hi Craig,

    the four key questions I can think of are
a) what is the signature of the callback?
b) where does the crash occur (which instruction in which function) and why?
c) what is the state of the stack and register arguments when the callback enters thunkEntry (which is where all callbacks come in)
d) (if things get that far) what is the state of the system after the longjmp back into thunkEntry as the system attempts to return from the callback

_,,,^..^,,,_ (phone)

> On Sep 28, 2015, at 7:33 AM, Craig Latta <[hidden email]> wrote:
>
>
> Hi--
>
>     I've got basic FFI connectivity going between Squeak 5 and a C
> library I want to use, via Alien. Callouts seem to work, and some
> callbacks. Other callbacks crash, though. I know which callback isn't
> successfully called, but I don't have the library source, so I'm not
> entirely sure what it's trying to do at that point. I'm on Mac OS 10.11.
> I attached lldb before the crash and am staring at the library's
> disassembled instructions.
>
>     Does anyone have any advice for how to debug?
>
>
>     thanks,
>
> -C
>
> --
> Craig Latta
> netjam.org
> +31   6 2757 7177 (SMS ok)
> + 1 415  287 3547 (no SMS)
>
>