On Thu, Dec 25, 2008 at 6:29 PM, Ben Simon <span dir="ltr"><<a href="mailto:benjisimon@gmail.com">benjisimon@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On Thu, Dec 25, 2008 at 4:49 PM, Eli Barzilay <span dir="ltr"><<a href="mailto:eli@barzilay.org" target="_blank">eli@barzilay.org</a>></span> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div class="Ih2E3d">On Dec 25, Ben Simon wrote:<br></div><div class="Ih2E3d">
> I wonder if I'm hosing things up because I'm calling mysql_init without an<br>
> argument. The API says that if the argument is null, it returns back a fresh<br>
> mysql handle. That's what I was intending. But, by not explicitly handing<br>
> in NULL, i may be corrupting matters.<br>
<br>
</div></div><div class="Ih2E3d">That sounds very likely: if you omit the type from the interface, then<br>
the foreign function will just use whatever junk happens to be on the<br>
stack. And it sounds like mysql will just assume that it's a pointer<br>
to a struct to fill -- so it stores that information in that random<br>
place. (And it shouldn't be surprising that this leads to a crash at<br>
some later point.)</div></blockquote></div></blockquote><div><br>Whoo! That appears to be it. Since I've made that change, I've been crash free. <br><br>Thanks Eli!<br><br>-Ben<br></div></div><br>-- <br>Have an idea for software? I can make it happen - <a href="http://www.ideas2executables.com">http://www.ideas2executables.com</a><br>
My Blog: <a href="http://benjisimon.blogspot.com">http://benjisimon.blogspot.com</a><br>