Menu

#651 PyTango segmentation fault when run a DS that use attr_data.py

closed-fixed
None
PyTango
5
2014-02-24
2014-02-19
No

The code has been changed, seems to be that now the dictionary extra_info return bool instead of string

In DynamicDSClass.new(<class '__main__.pyalbaemclass'="">): updating properties
DynamicSpectrumSize property NOT found in database
In PyAlbaEmClass constructor
-------> Received a DevFailed exception: DevFailed[
DevError[
desc = AttributeError: 'bool' object has no attribute 'lower'</class>

origin = File "/homelocal/sicilia/lib/python/site-packages/PyTango/device_class.py", line 315, in attribute_factory
attr_data = AttrData(attr_name, self.get_name(), attr_info)
File "/homelocal/sicilia/lib/python/site-packages/PyTango/attr_data.py", line 59, in __init
self.from_attr_info(attr_info)
File "/homelocal/sicilia/lib/python/site-packages/PyTango/attr_data.py", line 278, in from_attr_info
memorized = extra_info.get("memorized", "false").lower()

reason = PyDs_PythonError
severity = ERR]
]
Segmentation fault (core dumped)

Discussion

  • Tiago Coutinho

    Tiago Coutinho - 2014-02-20

    Hi Carlos,

    Your report is a little hard to understand.
    Can you explain what you are doing (i imagine you are running a Python DS)
    I don't know what is a DynamicDSClass. It is not part of PyTango.

    Can you tell me which version of PyTango you are using? Was it working with a previous version of PyTango?

    Thanks in advance

     
  • Carlos Falcon

    Carlos Falcon - 2014-02-20

    Sorry Tiago, I could not write you yesterday. We realized that is not at all a PyTango's bug, the behavior of the device had changed and it causes the PyTango error.

    In fact, it happens when in a ds you set attributes like it example:

        'ChannelsNames':
            [[PyTango.DevString,
            PyTango.SPECTRUM,
            PyTango.READ_WRITE, 4],
            {
                'description':"Channels names. Must be the same names that already exists for pool channels.",
                'memorized': True        <-- HERE
            }
            ],
    

    instead of

        'ChannelsNames':
            [[PyTango.DevString,
            PyTango.SPECTRUM,
            PyTango.READ_WRITE, 4],
            {
                'description':"Channels names. Must be the same names that already exists for pool channels.",
                'memorized': "True"      <-- HERE
            }
            ],
    

    On the one hand , PyTango could avoid the segmentation fault doing a cast or protect the code with a try.

    And on the other hand, one question Are the attributes (PyTango.SPECTRUM ) memorized?

    Thanks in advance

     
  • Carlos Falcon

    Carlos Falcon - 2014-02-20

    I forgot to say is PyTango 8.1.1

     
  • Tiago Coutinho

    Tiago Coutinho - 2014-02-24

    Thanks for the information.

    The seg. fault is explained by bug #623. I prefer to fix the seg fault at its origin. I agree the trace is not very readable so we could raise a more clear exception. I would to restrict and allow only strings. Think of this as an enumeration with possible values: "false, "true", "true_without_hard_applied".
    I'll make the change.

    Spectrum attributes cannot be memorized.

     
  • Tiago Coutinho

    Tiago Coutinho - 2014-02-24
    • status: open --> closed-fixed
    • assigned_to: Coutinho
     
  • Tiago Coutinho

    Tiago Coutinho - 2014-02-24

    Fixed in PyTango SVN trunk since revision 25039.
    Will become visible in next PyTango 8.1.2

    Thanks for reporting.

     

Log in to post a comment.

MongoDB Logo MongoDB