rlancaste / stellarsolver

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

SIGFPE on i386 #23

Closed TallFurryMan closed 4 years ago

TallFurryMan commented 4 years ago

Capturing a single frame in Focus:

Thread 22 "SextractorSolve" received signal SIGFPE, Arithmetic exception.
[Switching to Thread 0xa1d7fb40 (LWP 2531)]
0xb518c6db in InternalSextractorSolver::runSEPSextractor (this=0xae178e20)
    at /var/jenkins_home/workspace/kstars-ci_i386-stellarsolver/stellarsolver/internalsextractorsolver.cpp:252
252 /var/jenkins_home/workspace/kstars-ci_i386-stellarsolver/stellarsolver/internalsextractorsolver.cpp: No such file or directory.
(gdb) bt
#0  0xb518c6db in InternalSextractorSolver::runSEPSextractor() (this=0xae178e20)
    at /var/jenkins_home/workspace/kstars-ci_i386-stellarsolver/stellarsolver/internalsextractorsolver.cpp:252
#1  0xb518e63e in InternalSextractorSolver::extract() (this=0xae178e20)
    at /var/jenkins_home/workspace/kstars-ci_i386-stellarsolver/stellarsolver/internalsextractorsolver.cpp:99
#2  0xb518e63e in InternalSextractorSolver::run() (this=<optimized out>)
    at /var/jenkins_home/workspace/kstars-ci_i386-stellarsolver/stellarsolver/internalsextractorsolver.cpp:141
#3  0xb581fdcc in  () at /usr/lib/i386-linux-gnu/sse2/libQt5Core.so.5
#4  0xb52a43bd in start_thread (arg=0xa1d7fb40) at pthread_create.c:463
#5  0xb483bfe6 in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:108

This is an Atom i386 cpu with 1GB.

TallFurryMan commented 4 years ago

This is with d1de2f7b.

TallFurryMan commented 4 years ago

https://github.com/rlancaste/stellarsolver/blob/60165c5881499a616ea6e8a4baa88c0f35e747ea/stellarsolver/internalsextractorsolver.cpp#L252

In my case QThread::idealThreadCount() returns 2.

rlancaste commented 4 years ago

Thanks for the info, this is in the code that Jasem was just working on recently.

rlancaste commented 4 years ago

We will check into it.

rlancaste commented 4 years ago

I guess this is a single core computer?

knro commented 4 years ago

Alright, minimum should be 4.

TallFurryMan commented 4 years ago

Alright, minimum should be 4.

Why this restriction? Does this impact performance or is this a hard stop for any single core host?

knro commented 4 years ago

I submitted PR #26 to fix this. This also grantees that only threads multiple of 4 are accepted to avoid any weird partitioning. If this is not met, it just runs it single-threaded like before.

TallFurryMan commented 4 years ago

My obs is testing #25 right now. I'll test #26 shortly afterwards. I suppose it's better to remain on a single thread to avoid locking kstars up on the other.

TallFurryMan commented 4 years ago

EDIT: moved to #26

25 closed, uneeded. #26 accepts frames.

This is related to KStars/Ekos, but part of my test on #26, so I'll put it here for completeness:

knro commented 4 years ago

How does Centeroid algorithm fares in comparison? You can hardcode it in FITSData::findStar and re-test on the same frame.

TallFurryMan commented 4 years ago

Will try. It is not that easy to do this in the UI, there should be a test doing a benchmark of each method. Any comparison done on the KStars UI Focus test? I've not done that myself.