<div dir="ltr">Hey everyone, it appears after a lot of well-placed (format t)(force-output) statements, the problem isn't in the callback mechanism, but instead in tcp-connect function itself (or rather, cl-async-util::ip-str-to-sockaddr which seems to be overwriting its own return address somehow). This is another problem entirely and I assume it's something dumb I'm doing. Sorry for the false report!<br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jun 20, 2014 at 12:15 PM, Andrew Lyon <span dir="ltr"><<a href="mailto:orthecreedence@gmail.com" target="_blank">orthecreedence@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Right you are, I edited the example. And as you suspected, the issue still happens =]. Any pointers on where I would start look for something like adding :stdcall convention support to the compiler/CFFI? Thanks!<span class="HOEnZb"><font color="#888888"><br>
<br>Andrew<br></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jun 20, 2014 at 11:50 AM, Matthew Mondor <span dir="ltr"><<a href="mailto:mm_lists@pulsar-zone.net" target="_blank">mm_lists@pulsar-zone.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On Fri, 20 Jun 2014 11:19:00 -0700<br>
Andrew Lyon <<a href="mailto:orthecreedence@gmail.com" target="_blank">orthecreedence@gmail.com</a>> wrote:<br>
<br>
> Hello all. I'm the author of cl-async (<br>
> <a href="https://github.com/orthecreedence/cl-async" target="_blank">https://github.com/orthecreedence/cl-async</a>) and I'm getting segfaults when<br>
> using it in Windows with ECL (Windows 7 x64, ECL git (52bbd351500), libffi<br>
> 3.0.11, libevent 2.0.21, all compiled via 32bit MinGW gcc 4.8.1. I'm using<br>
> ECL's c compiler for everything (same mingw).<br>
><br>
> Everything compiles and runs fine, until I do anything with socket IO, then<br>
> I get a segfault.<br>
<br>
> See <a href="https://gist.github.com/orthecreedence/a2b666419fe220bfae31" target="_blank">https://gist.github.com/orthecreedence/a2b666419fe220bfae31</a> (backtrace<br>
> in comments)<br>
<br>
</div>This is probably irrelevant to the issue you're experiencing (please<br>
disreguard if you intended to compile as a test, but not to use the<br>
compiled versions in the above):<br>
<br>
I'm not sure that the COMPILE calls do what you intend there... From<br>
the HyperSpec:<br>
<br>
"If the name is nil, the resulting compiled function is returned<br>
directly as the primary value. If a non-nil name is given, then the<br>
resulting compiled function replaces the existing function definition<br>
of name and the name is returned as the primary value; if name is a<br>
symbol that names a macro, its macro function is updated and the name<br>
is returned as the primary value."<br>
<br>
So the functions would be compiled but reference to the compiled<br>
versions discarded unless you used funcall on the return value or<br>
assigned it yourself using (setf (symbol-function <symbol>)), which<br>
would be the same as using (compile 'delay) for instance.<br>
<div><br>
> I believe this *may* be related to a bug I reported a while back (<br>
> <a href="https://sourceforge.net/p/ecls/bugs/204/" target="_blank">https://sourceforge.net/p/ecls/bugs/204/</a>) because the backtrace on the<br>
> segfault is completely empty (like in the bug). However it's off that some<br>
> callbacks work and others don't because they all make use of arguments.<br>
<br>
</div>My experience with ECL or CFFI on Windows are NIL, unfortunately.<br>
<div><br>
> Instead of just whining and hoping someone fixes it, I'd like to jump in<br>
> and give it a shot myself (unless it's a quick fix that someone can make<br>
> easily). I've been meaning to get to know ECL better because I'm trying to<br>
> use it for a largish project and I think knowing the internals better would<br>
> help me out. I'd also like to eventually get to the point where I can help<br>
> out with various contributions when I have time. I'm ok with C but have<br>
> never touched a compiler before, so any sort of guidance I can get on<br>
> solving this issue would be great.<br>
<br>
</div>This list is for that, among other things, you're welcome to ask<br>
questions and we'll help as we can. Contributions to ECL (and to<br>
ECL-specific CFFI backend) are also welcome.<br>
<br>
--<br>
Matt<br>
<br>
------------------------------------------------------------------------------<br>
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions<br>
Find What Matters Most in Your Big Data with HPCC Systems<br>
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.<br>
Leverages Graph Analysis for Fast Processing & Easy Data Exploration<br>
<a href="http://p.sf.net/sfu/hpccsystems" target="_blank">http://p.sf.net/sfu/hpccsystems</a><br>
_______________________________________________<br>
Ecls-list mailing list<br>
<a href="mailto:Ecls-list@lists.sourceforge.net" target="_blank">Ecls-list@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/ecls-list" target="_blank">https://lists.sourceforge.net/lists/listinfo/ecls-list</a><br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>