[bugs:#818] Segfault in polled device at startup
Status: open
Created: Thu Oct 06, 2016 02:09 PM UTC by Johan Forsberg
Last Updated: Thu Oct 06, 2016 02:09 PM UTC
Owner: nobody
Attachments:
I have run into a segfault that seems to be related to the fix of bug #814. So it might not happen if that patch is not applied, I have not tested that.
The problem can be reproduced by these steps:
I'm attaching a short python script that performs this test. It probably needs to be run a few times before it catches the problem. It assumes the TangoTest device to be available in the path.
By some debugging, I've come to the conclusion that the issue comes from line 641 in blackbox.cpp. It assumes that if the call does not come from polling or from an user thread, it's from a client. But the host may also be "init" under some circumstances (I guess right after startup) and in that case a null pointer error happens a bit later. At least, modifying the line to something like:
~~~
if (box[insert_elt].host_ip_str[0] == 'p' || box[insert_elt].host_ip_str[0] == 'u' ||
box[insert_elt].host_ip_str[0] == 'i') // this is the new part
~~~
appears to solve the problem.
Sent from sourceforge.net because Tango-cs...@lists.sf.net is subscribed to https://sourceforge.net/p/tango-cs/bugs/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/tango-cs/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.
It appears that this bug is harder to provoke if the TANGO database is not running on the same host, I suppose because of the extra time it takes to get the information.
The context is that I'm trying to script some automatic tests where TANGO servers are created and removed all the time, and the database is local. So it may be that this bug almost never appears in "real" cases, but it's very annoying in this particular case.
Hi Johan,
There is a bug fix commited in the SVN repo. Hoping this help
Emmanuel
[bugs:#818] Segfault in polled device at startup
Status: open
Created: Thu Oct 06, 2016 02:09 PM UTC by Johan Forsberg
Last Updated: Thu Oct 06, 2016 02:33 PM UTC
Owner: nobody
Attachments: