[Tango-cs-bug-info] [tango-cs:bugs] #818 Segfault in polled device at startup

0 views
Skip to first unread message

tango-cs...@lists.sourceforge.net

unread,
Oct 6, 2016, 11:00:06 AM10/6/16
to Tango-cs...@lists.sf.net

[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:

  • Add a new server and device to the DB (I have not been able to make it happen unless it's the first time the server is run after being added)
  • Configure polling on e.g. State, by writing the "polled_attr" property. The interval does not seem to matter.
  • Start the server. It will sometimes (maybe 1 time out of 10) immediately segfault.

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.

message-footer.txt

tango-cs...@lists.sourceforge.net

unread,
Oct 6, 2016, 11:15:23 AM10/6/16
to Tango-cs...@lists.sf.net

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.

message-footer.txt

tango-cs...@lists.sourceforge.net

unread,
Oct 10, 2016, 11:02:32 AM10/10/16
to Tango-cs...@lists.sf.net

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:

message-footer.txt
Reply all
Reply to author
Forward
0 new messages