indilib / indi

INDI Core Library Repository
https://www.indilib.org
GNU Lesser General Public License v2.1
363 stars 385 forks source link

After KStars last update, indi_scopedome_dome driver crash #2081

Closed Carlos-Vera-H closed 3 weeks ago

Carlos-Vera-H commented 1 month ago

Describe the bug After last update of KStars to version 3.7.1 (with INDI v. 2.0.8), indi_scopedome_dome driver crash (the other indi device drivers in my Ekos profile works properly).

The ScopeDome is Arduino version. After the crash, I have tested it in Windows, with Ascom driver, and works properly.


To Reproduce

  1. Start Kstars

  2. Start Ekos (INDI client)

  3. Execute any Ekos profile including indi_scopedome_dome driver.

  4. OBSERVED RESULT: All INDI services start properly, but indi_scopedome_dome driver crashes inmediately. Then it try to restart and crashes again and again ... (when on a very rare occasion, it has started normally, its operation remains normal and without interruptions.)

As you can see in the attached log files, the connection is established correctly, but the driver always fails in some step of its initialization.


Expected behavior That indi_scopedome_dome driver works properly, like before last update of KStars.


Desktop:

TallFurryMan commented 1 month ago

Thanks for this report. The interesting part of the (snipped) log is:

2024-07-09T21:29:45 - INDI Server:  "2024-07-09T20:29:45: Driver indi_scopedome_dome: Impossible ISState 96"
2024-07-09T21:29:45 - INDI Server:  ""
2024-07-09T21:29:45 - ScopeDome Dome :  "[INFO] Steps per revolution read as 3280 "
2024-07-09T21:29:45 - ScopeDome Dome : "[DEBUG] Dome position 7.804878, step count 32000 "
2024-07-09T21:29:45 - INDI Server:  "2024-07-09T20:29:45: Driver indi_scopedome_dome: read: Connection reset by peer"
2024-07-09T21:29:45 - INDI Server:  "<delProperty device=\"ScopeDome Dome\"/>"
2024-07-09T21:29:45 - INDI Server:  "2024-07-09T20:29:45: Driver indi_scopedome_dome: Terminated after #0 restarts."
2024-07-09T21:29:45 - INDI Server:  ""
2024-07-09T21:29:45 - Removing device "ScopeDome Dome"
2024-07-09T21:29:45 - INDI driver  "indi_scopedome_dome"  crashed!

What is the version of your indi package installation? Would you care to test with indi 2.0.8?

Carlos-Vera-H commented 1 month ago

The INDI library used in the referred test, where the ScopeDome driver failure occurs, is 2.0.8:

INDI library: 2.0.8 Code 2.0.8-tgz. Protocol 1.7.

INDI_Library_2 0 8 Thanks

knro commented 1 month ago

Can you run the driver in Ekos Debugger and submit the backtrace?

Carlos-Vera-H commented 1 month ago

Here you have two different reports, generated by Ekos Debugger:

indi_logs_24-07-15T17-53-34.zip indi_logs_24-07-15T18-03-14.zip

Thanks

Carlos-Vera-H commented 1 month ago

Snip_of_KStars-Ekos_log_21-28-59.txt

As we can see in the attached file (a commented clipping of the file generated by KStars), in the indi_scopedome_dome driver, there are two failures:

knro commented 1 month ago

Try deleting the config files under ~/.indi and restart the driver. Any better results? Also, do you have the Dome Intertia file that was referenced?

Carlos-Vera-H commented 1 month ago

I just did, several times, what you suggested (delete the config files), but the result has not changed at all (the driver is interrupted at the same point in the sequence).

... And yes, I have the inertia table generated by the Windows application provided by the manufacturer (copied in the linux .../.indi folder) and it has always worked well (before last update of indilib). ScopeDome_DomeInertia_Table.txt (The dome's diameter is 3 m)

Carlos-Vera-H commented 1 month ago

Could someone provide me, please, with an installation package containing only the indi_scopedome_dome driver and its dependencies (isolated from libindi), ready to compile and install? (indi_scopedome_dome.tar.xz).

This is to make it easier to me find the bug and try to fix it (because my programming knowledge and experience are quite limited).

Thank you.

Carlos-Vera-H commented 1 month ago

Some tests I have done on the INDI ScopeDome driver:

1.- Whitout uninstalling anything, I have compiled  the package libindi_2.0.2+202305311719~ubuntu22.10.1.tar.xz
   and installed it by “cmake install”.
   Result: the  ScopeDome driver always works fine on the second try, but fails the Zwo Asi cameras and the Starlight Xpress AO drivers.

2.- I have compiled  the package libindi_2.0.5+202312021714~ubuntu23.04.1.tar.xz
   and installed it by “cmake install”.
   Result: the  ScopeDome driver always works fine on the second try, but fails the Zwo Asi cameras and the Starlight Xpress AO drivers.

3.- I have completely uninstalled indi-full and kstars-bleeding, then I have updated it to the last version (with indi-full 2.0.9).
   Result: only the ScopeDome driver almost always fails (the errors mentioned are still there). All other drivers works fine again.

Can you tell me, please, how can I do a complete installation of an early version of this software? (when I try it in the conventional recommended way, the system always installs the last version, including the ScopeDome driver with its bugs).

Thank you.

Carlos-Vera-H commented 1 month ago

By QT Creator > Tools > Diff > Diff external files, I have compared the source files of ScopeDome driver versions 2.0.5 and 2.0.8 (in libindi), and I have found a lot of differences only in the file scopedome_dome.cpp; so I think that might be where the bug is. Now, the challenge remains to find and fix it.

QT_diff_scopedome_dome cpp_2 0 5-2 0 8 In this screenshot you can only see the beginning of the list of differences.

(There is no difference between versions 2.0.8 and 2.0.9)

knro commented 1 month ago

I think it is best if install Rustdesk and then I can remotely login to debug this. Send the details to my email (mutlaqja AT ikarustech DOT com)

Carlos-Vera-H commented 4 weeks ago

I've installed Rustdesk and send the details to your email. Thank you.

Carlos-Vera-H commented 3 weeks ago

After a rebuild and reinstall of indi core and drivers, made by knro, I've tested the driver, connecting and disconnecting it a few times, and it has always started well. So I think that now the bug is fixed.

(Only remains the mentioned failure of connection in the first attempt, which is solved on the second attempt without any crash of the driver; but this is another less important issue).

Thank you very much.

Best regards

Carlos Vera Hernández.