On 9/6/07, Luc Holtkamp <lholtkamp / moog-fcs.com> wrote:
> Jano Svitok wrote:
> > On 9/5/07, Luc Holtkamp <lholtkamp / moog-fcs.com> wrote:
> Hi Jano,
> Yes, the 1.3.29 is indeed SWIG, sorry for the confusion
> We use:
> SWIG Version 1.3.29 Compiled with g++ [i686-pc-cygwin]
> ruby 1.8.1 (2003-12-25) [i386-mswin32]
>
> The script itself is very simple, just one line:
>
> Fcstest::Log ("Test 123")
>
> The Fcstest::Log function was wrapped with SWIG. When I tested with this
> script I got error such as:
>  #<Errno::EBADF: (eval):190:in `write'Bad file descriptor>
>  #<Errno::EBADF: (eval):380:in `write'Bad file descriptor>
>
> If a add more lines to the script I get the errors more often, and the
> numbers tend to be higher.
>
> Maybe ruby tries to write to the console? It's a windows app, so it has
> no console. But normally the calls to puts() don't cause any problems if
> you have no console, at least not in C++.
>
> Luc

Ok, I'm lost ;-) Anyway, two hints:

1. Ruby redefines write/read functions. (#define write(f,x,y)
rb_write(f,x,y) or similar) That meas, if you use I/O, you might end
using ruby output routines. Check that. (see win32.h)

2. Try to find out how eval numbers code lines, and find the wrong
one. I guess it will be something involving IO.

If that doesn't help (desperate scenario :-), build your own ruby,
find in sources where it might be thrown, and set breakpoint there
(most probably file.c or io.c).