Thanks Marc,
I figured out you are very busy and I tried to find exactly why it happens but it wasn't too obvious for me. I just thought maybe someone else more experienced than me (especially looking at assembly code) had the same problem.
It's very good news it's on your list.
I also have an unrelated question regarding the limitations for the C-Scheme interface in a multithreading environment.
I read that there is a problem with multithreading when calling C to Scheme and back to C due to stack cleanup. I would like to know what are the safe scenarios.
Would it also happen in a chain like Scheme to C and back to Scheme?
I assume that calling just Scheme to C or just C from Scheme in a multithreaded environment would be ok. Is that the case?
Regards,
Dan.
-----Original Message-----
From: Marc Feeley [mailto:feeley@IRO.UMontreal.CA]
Sent: Wednesday, March 16, 2005 6:58 PM
To: dhristodorescu@borderfree.com
Subject: Re: [gambit-list] Calling from C on Windows
> Hello,
>
>
>
> Does anyone have any luck in calling Gambit4b12 from a C function on a
> non-console Windows application?
>
> I tried it with both mingw and VS6 and while it works fine in a console
> application it crashes when compiled for the graphical subsystem.
>
> In debugger it seems that inside the Scheme function a parameter retrieved
> from the stack doesn't have the proper value and I get a segfault.
>
> I think it has something to do with the stack frame alignment but I couldn't
> figure out how to avoid it.
>
>
>
> I would appreciate any hints on how to make it work.
Sorry, I've been very busy lately and couldn't look into it.
I'll do that first thing tomorrow morning. It appears the
problem also exists with Linux.
Marc