From: mortee on
> Make sure to run your ruby code in only one thread at a time and only
> from the "main" thread (?)

Well, I'm making sure to call it from a single thread, but I can't force
to do it from the main one. I'm writing an extension for a 3rd party
app, which calls my code from whatever thread it wants to, and it's
definitely not the main one.

> You could post backtraces, as well.

I'd be glad to, but as I've said already, I have no logs (at least not
at this level), and no terminal output from the app involved. All I get
is a dialog window from the MS Visual Runtime telling me about the
crash, without any usable details.

The weird part is that non-network code (even usong multiple ruby
threads) runs without problems.


From: Luis Lavena on
On Apr 8, 8:01 pm, mortee <mortee.li...(a)kavemalna.hu> wrote:
> > You could post backtraces, as well.
>
> I'd be glad to, but as I've said already, I have no logs (at least not
> at this level), and no terminal output from the app involved. All I get
> is a dialog window from the MS Visual Runtime telling me about the
> crash, without any usable details.
>
> The weird part is that non-network code (even usong multiple ruby
> threads) runs without problems.

Is the application you're embedding/calling ruby library compiled with
a newer version of Microsoft C? Can you verify it links to MSVCRT and
*not* MSVCR80.DLL or MSVCR90.DLL?

--
Luis Lavena
From: mortee on
> Is the application you're embedding/calling ruby library compiled with
> a newer version of Microsoft C? Can you verify it links to MSVCRT and
> *not* MSVCR80.DLL or MSVCR90.DLL?

It seems to load both msvcrt.dll and msvcr80.dll, even before hitting
any of my code. It also loads msvcp80.dll, for that matter.

mortee


From: Caleb Clausen on
On 4/8/10, mortee <mortee.lists(a)kavemalna.hu> wrote:
>> Make sure to run your ruby code in only one thread at a time and only
>> from the "main" thread (?)
>
> Well, I'm making sure to call it from a single thread, but I can't force
> to do it from the main one. I'm writing an extension for a 3rd party
> app, which calls my code from whatever thread it wants to, and it's
> definitely not the main one.

Calling out to the ruby interpreter from a program whose source you
don't control and not from the program's main thread... definitely
sounds dangerous. Now that redmine is back, I went and found the bug I
mentioned before, but upon reading, that problems seems to have been
with invoking ruby from the main thread only. So, it may not help you,
directly, but maybe these bug reports will stimulate some ideas:

http://redmine.ruby-lang.org/issues/show/2258
http://redmine.ruby-lang.org/issues/show/2294

> I'd be glad to, but as I've said already, I have no logs (at least not
> at this level), and no terminal output from the app involved. All I get
> is a dialog window from the MS Visual Runtime telling me about the
> crash, without any usable details.

You need to get some visibility into this problem. Maybe you can run
the program within a debugger, and extract a stack dump from that when
it crashes?

> The weird part is that non-network code (even usong multiple ruby
> threads) runs without problems.