×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

EQMOD driver causing phd2 to segfault

  • Posts: 269
  • Thank you received: 53
I did a test and the issue with the SIMULATOR properties has been fixed. But there is still an issue with all the other EQMOD properties which is why I made some other changes. Here is the sequence:
Start Phd2 in a terminal session
Click the Connect button to connect devices
Select INDI camera and INDI Mount
Clcik the setup button for either the camera or mount
Click the INDI button to start INDI control panel
On the EQMOD tab click Disconnect (Note: the mount is already disconnected)
With the latest version of PHD2 there is no issue but I put in a trace to detect when a null property was received. My attached log shows a remove property being received with a null pointer. When I remove the patch for nul pointer I get a segfault.

This happens because in the align.cpp, scope-limits.cpp and eqmod.cpp clicking the disconnect button before connecting calls updateProperties(). In each case it only defines the properties if the mount is connected (which it isn't yet). Instead they then check one of the pointers to the skeleton file properties and if set they then invoke deleteProperty (in the case of eqmod.cpp this is unconditional) But at this point the properties have not yet been defined as this only happens after a connect.
Furthermore, the pointer that is checked is ALWAYS set in initProperties so the deleteProperty may as well be invoked unconditionally.

The use case is unusual (user clicks disconnect when the mount is already disconnected) but is inevitable and the resulting segfault is not graceful.
Attached log from the terminal sessions shows first the result of clicking Disconnect with the Phd2 null property patch in place along with some trace messages I added. The multitude of null properties are quite obvious. After connecting and then disconnecting the null properties are gone. Following that I removed the null property patch from Phd2 (which I think we all agree should not be necessary) and the Disconnect causes a segfault.

File Attachment:

File Name: phd2_indi-test.log
File Size:31 KB
Last edit: 6 years 6 months ago by Ken Self.
6 years 6 months ago #19130
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 269
  • Thank you received: 53
The continuing segfaulting in PHD2 (without the null property patch) has been bothering me so I've looked more deeply. What is especially odd is that it onlyseems to affect the EQMOD driver. Nevertheless I tracked down the cause to defaultdevice which calls updateProperties on a disconnect even if the device was not connected. I've developed a patch which addresses this but I'm not sure if it is consistent with INDI philosophy and affects all drivers. Raising a Pull Request for your careful consideration.
6 years 6 months ago #19248

Please Log in or Create an account to join the conversation.

Time to create page: 0.393 seconds