rlancaste / stellarsolver

GNU General Public License v3.0
88 stars 47 forks source link

Crash on internal solver start (KStars) #104

Closed Jusas closed 2 years ago

Jusas commented 2 years ago

Hi Rob, sorry for posting this here but the Indilib forums are somehow broken and I can't seem to reply to the StellarSolver 2.0 thread no matter what I do. Referring to https://indilib.org/forum/ekos/11388-announcing-stellarsolver-2-0/81108.html#81108

So I decided to bring my business here ;)

I just ran the scenarios again. The crash when using external solver and stopping Indi has been fixed by the changes. šŸ‘

The new Watney settings look good as well. šŸ‘

The crash using the internal solver changed a bit:

Steps to reproduce:

    - Go to Ekos
    - Start simulators
    - Go to Align tab
    - Capture & Solve (using: BuiltIn method for solver, Internal Solver)
    - First solve succeeded, target is off, it tries to run another one

--> SIGSEGV

1 ??                                                                                                                                  0x7ffff1bcd7df
2 QObject::disconnectImpl(QObject const *, void * *, QObject const *, void * *, QMetaObject const *)                                  0x7ffff1bce10f
3 QObject::disconnect<void (AstrometryLogger:: *)(QString), void (ExtractorSolver:: *)(QString)>     qobject.h                   366  0x7ffff329f64f
4 InternalExtractorSolver::runInternalSolver                                                         internalextractorsolver.cpp 1123 0x7ffff3293fa0
5 InternalExtractorSolver::run                                                                       internalextractorsolver.cpp 132  0x7ffff328ed1e
6 ??                                                                                                                                  0x7ffff19d69d2
7 start_thread                                                                                       pthread_create.c            477  0x7ffff6b03609
8 clone                                                                                              clone.S                     95   0x7ffff12a1163

The line in question:

    if(m_AstrometryLogLevel != SSolver::LOG_NONE && !this->isChildSolver && astroLogger)
 ->       disconnect(astroLogger, &AstrometryLogger::logOutput, this, &ExtractorSolver::logOutput);

Also weirdly enough as I now tried to reproduce it a second time, it already crashes on first solve. Not sure how it managed to run the first solve the first time just fine.

rlancaste commented 2 years ago

Yes, I think Jasem needs to fix the forum. I don't know what happened. We have been using it for years with no issues. . .

I will definitely check out this one. Actually, Wolfgang mentioned it to me this morning as well where it crashes in the same spot. So it definitely needs to be addressed. But so far, I can't seem to replicate it myself. Every time it solves just fine for me.

rlancaste commented 2 years ago

Ok I understand what was going now now. On some systems the pointer wasn't initialized to a nullptr, but on mine it was. So I didn't see any crashes but others did sometimes. As a solution, I got rid of the new keyword and made it not a pointer, so now there should be no issue.

rlancaste commented 2 years ago

Please check

Jusas commented 2 years ago

Yeah that was it, it works now! No more crashes. Perfect!

Jusas commented 2 years ago

Oh and for the record, I'm testing in Linux (Kubuntu 20.04). I'm guessing you're running MacOS.

rlancaste commented 2 years ago

Correct.

rlancaste commented 2 years ago

ok glad to hear it. Keep testing. We want to release the next version of KStars soon, and so want to make sure everything is good first.

rlancaste commented 2 years ago

I think Jasem has fixed the forum as well.