[erlang-questions] erl_interface issue

Davide Marquês <>
Mon May 11 13:41:06 CEST 2009


Hi all,

Just wanted to let you know that I found out what was preventing
erl_interface from working on windows! :)
The solution had already been shared on the mailing lists:
    http://erlang.org/pipermail/erlang-questions/2004-April/012097.html
    http://www.erlang.org/ml-archive/erlang-questions/200305/msg00259.html
It's just a matter of setting stdin/out to binary mode and voilá: working code!

We have Serge Aleynikov to thank for figuring out the solution to this
problem and
for a great tutorial on using ei:
  http://www.trapexit.org/How_to_use_ei_to_marshal_binary_terms_in_port_programs
Thanks wherever you are! :)

The erl_interface examples complex/echo
(http://github.com/davide/erl_interface-examples/tree/master)
are now working. :)

Cheers,
:Davide

2009/5/4 Davide Marquês <>:
> Hi all,
>
> erl_interface help wanted! :)
>
> I'm getting a consistent failure under certain inputs:
> 1> echo:start("../../MSVC/Release/echo.exe").
> <0.33.0>
> 2> echo:echo("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").
> sending to port: {echo,{"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}}
> {ok,"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}
> 3> echo:echo("aaaaa").
> sending to port: {echo,{"aaaaa"}}
> {ok,"aaaaaaaaa"}
> 4> echo:echo("aaa aaaaaa").
> sending to port: {echo,{"aaa aaaaaa"}}
>
> =ERROR REPORT==== 4-May-2009::16:11:15 ===
> catch: error:badarg
>
> As far as I can tell it's not an issue with the size of the message but with
> the actual data being passed. I first spotted this problem with the
> "New Folder" string. But the problem is not "string" specific... exchanging
> a 'New Folder' atom or <<"New Folder">> binary will also fail.
>
> At first I thought this problem could have been the result of using broken
> erl_interface libraries (built with MinGW), but I've since started using MSVC
> to link my program with the libraries that are bundled in the windows
> erlang distribution and the problem remains.
>
> I've made all the code necessary to replicate this issue available here:
> http://github.com/davide/erl_interface-examples/tree/master
>
> At this point I have absolutely no idea how to proceed into debugging this.
> Any tips are welcome! ;)
>
> Cheers,
> :Davide
>



More information about the erlang-questions mailing list