Subject: | Segfault/free() error upon exit after contractDetails event |
Date: | Tue, 8 Jul 2014 18:36:15 -0600 |
To: | bug-Finance-InteractiveBrokers-SWIG [...] rt.cpan.org |
From: | Glenn Golden <gdg [...] zplane.com> |
Hi Jason,
Recently started playing around with the contractDetails() event for the first
time, and am running into an intermittent segfault/free() error that was never
seen prior to installing the code that does the contractDetails() requests
and services the associated events.
The contractDetails() event itself seems to work fine: Upon receiving the
event, am able to interrogate the returned data structure using the various
swig_xxxx_get() methods. All such data looks fine, nothing unusual. And my
client continues normally indefinitely after the event.
However, on roughly half the occasions when I later ^C out of the client and
my SIGINT handler runs, I sometimes see a segfault or a free() error, the
backtrace of which seems to suggest that something didn't go quite right in
destroying the ContractDetails object. (See attached "segfault.txt".) Of course
it's entirely possible it's user braindamage on my part too, perhaps not
cleaning up properly or something...?
The SIGINT handler seems benign; all it does is whine to stderr that SIGINT
was received (and that report does appear on stderr, prior to the system
segfault barfage) and then does eDisconnect() on the IBAPI object, followed
by exit(0).
The event handler for contractDetails() is also trivial at this time; it does
nothing other than swig_xxxx_get() one of the values from the object, then
prints the value, that's all. I even tried eliminating the get() call,
to see if that was possibly related to the segfault. No joy. And with the
get() call commented out, the event handler is essentially doing nothing other
than sucking three parms from @_.
Let me know if you have any ideas on this. If not I'll try to gen up a minimal
example for you.
Version info: perl 5.20.0, F::IB::SWIG 0.13.
Thanks,
Glenn
Message body is not shown because sender requested not to inline it.