debugging instructions

Hy Murveit murveit at gmail.com
Wed May 25 20:52:54 BST 2022


I am reviving this thread, since I still am crashing in what looks like
memory issues.

Note that the test I described above is now submitted into KStars source,
but needs to be enabled. Here are the new debugging instructions.

*Edit the test so that it is enabled, can find the data it needs, runs for
10000 iterations, and runs solving as well as star detection:*

1) Using the latest KStars, edit Tests/fitsviewer/testfitsdata.cpp and
comment out the line below (around line 532 in the file) so that the test
is enabled:

#define SKIP_PARALLEL_SOLVERS_TEST


2) You can find the data I provided in
https://drive.google.com/drive/folders/1eUrcJd1IENvcRUtnwsaUNWKwKuj5G077?usp=sharing
Download it and put it in some directory on your machine. Then change the
line (around line 539)

QString dir = "/home/hy/Desktop/SharedFolder/DEBUG-solver";

to point to where you put the data.

3) Around line 590, change "num = 3000" to "num = 10000"

4) Uncomment the 3 lines that have to do with loop4 so you run the solver
as well.

5) compile the test: "make -j12 testfitsdata"

6) run the test: "bin/testfitsdata testParallelSolvers"

This is not a "test" in the sense that it doesn't check any computations.
Rather, passing is simply not crashing.

This is what happened when I just ran it:

> bin/testfitsdata testParallelSolvers
********* Start testing of TestFitsData *********
Config: Using QtTest library 5.12.8, Qt 5.12.8 (x86_64-little_endian-lp64
shared (dynamic) release build; by GCC 9.3.0)
PASS   : TestFitsData::initTestCase()
Running solver with
/home/hy/Desktop/SharedFolder/DEBUG-solver/guide_frame_00-20-08.fits
QINFO  : TestFitsData::testParallelSolvers() "#0:
/home/hy/Desktop/SharedFolder/DEBUG-solver/guide_frame_00-20-30.fits HFR
2.0226"
QINFO  : TestFitsData::testParallelSolvers() "#0:
/home/hy/Desktop/SharedFolder/DEBUG-solver/guide_frame_00-20-08.fits HFR
1.98326"
QINFO  : TestFitsData::testParallelSolvers() "#1:
/home/hy/Desktop/SharedFolder/DEBUG-solver/guide_frame_00-20-34.fits HFR
2.19655"
QINFO  : TestFitsData::testParallelSolvers() "#1:
/home/hy/Desktop/SharedFolder/DEBUG-solver/guide_frame_00-20-12.fits HFR
1.96469"

...

QINFO  : TestFitsData::testParallelSolvers() "#669:
/home/hy/Desktop/SharedFolder/DEBUG-solver/guide_frame_00-20-21.fits HFR
1.9854"
QINFO  : TestFitsData::testParallelSolvers() "#673:
/home/hy/Desktop/SharedFolder/DEBUG-solver/guide_frame_00-20-34.fits HFR
2.19655"
QINFO  : TestFitsData::testParallelSolvers() "#670:
/home/hy/Desktop/SharedFolder/DEBUG-solver/guide_frame_00-20-24.fits HFR
2.08071"
QINFO  : TestFitsData::testParallelSolvers() "#674:
/home/hy/Desktop/SharedFolder/DEBUG-solver/guide_frame_00-20-37.fits HFR
2.03938"


=== Received signal at function time: 300012ms, total time: 300013ms,
dumping stack ===
QINFO  : TestFitsData::testParallelSolvers() "#671:
/home/hy/Desktop/SharedFolder/DEBUG-solver/guide_frame_00-20-27.fits HFR
2.08168"
QINFO  : TestFitsData::testParallelSolvers() "#675:
/home/hy/Desktop/SharedFolder/DEBUG-solver/guide_frame_00-20-40.fits HFR
2.12139"
GNU gdb (Ubuntu 9.2-0ubuntu1~20.04.1) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html
>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.


For help, type "help".
Type "apropos word" to search for commands related to "word".
Attaching to process 37916
(gdb) === End of stack trace ===
QFATAL : TestFitsData::testParallelSolvers() Test function timed out
FAIL!  : TestFitsData::testParallelSolvers() Received a fatal error.
   Loc: [Unknown file(0)]
Totals: 1 passed, 1 failed, 0 skipped, 0 blacklisted, 300315ms
********* Finished testing of TestFitsData *********
Aborted (core dumped)



FWIW, I found this page that may be useful in finding memory issues.
(Valgrind has not helped when I've tried in the past).
https://www.ics.com/blog/explore-memory-and-resource-leak-detection-tools



On Mon, Apr 4, 2022 at 7:54 PM Hy Murveit <murveit at gmail.com> wrote:

> Folks,
>
> I believe there are rare but often-enough memory issues when running
> stellarsolver.
> I can't track it down, so I created this test to help us debug it.
>
> If you have time, could you take a look?
>
> I've create a branch with a test which runs stellarsolver star detection
> in 3 parallel threads
> https://invent.kde.org/murveit/kstars/-/tree/solver-test1
> (if you uncomment some code, a 4th thread with a solver will run too).
>
> To run this, you need to also download some data that it points to:
> See the google drive folder:
>
> https://drive.google.com/drive/folders/1eUrcJd1IENvcRUtnwsaUNWKwKuj5G077?usp=sharing
> Download those files into some directory on your machine.
>
> You'd then edit near the end of kstars/Tests/fitsviewer/testfitsdata.cpp
> at the start of the test testParallelSolvers and change the directory there
> where you've put the files from my drive folder.
>
> Then you can compile testfitsdata and run it as:
> bin/testfitsdata testParallelSolvers
>
> It will detect stars for 3 sets of data.
>
>    - 200 guider files in thread 1
>    - 200 more guider files in thread 2
>    - 30 subs in thread3
>    - (commented out) 30 guider files using the solver
>
> It takes a minute or two.
>
> If I run this a few times, I usually get some kind of memory corruption
> error. Can't seem to figure it out yet, though. I've compiled with the
> latest KStars, stellarsolver and indi-core.
>
> Here's an example of one run that failed:
>
> > bin/testfitsdata testParallelSolvers
> ********* Start testing of TestFitsData *********
> Config: Using QtTest library 5.12.8, Qt 5.12.8 (x86_64-little_endian-lp64
> shared (dynamic) release build; by GCC 9.3.0)
> PASS   : TestFitsData::initTestCase()
> QINFO  : TestFitsData::testParallelSolvers() org.kde.kstars.fits: Loading
> file  "/home/hy/Desktop/SharedFolder/DEBUG-solver/guide_frame_00-20-08.fits"
> QINFO  : TestFitsData::testParallelSolvers() org.kde.kstars.fits: Loading
> file  "/home/hy/Desktop/SharedFolder/DEBUG-solver/guide_frame_00-20-30.fits"
> QINFO  : TestFitsData::testParallelSolvers() org.kde.kstars.fits: Loading
> file
>  "/home/hy/Desktop/SharedFolder/DEBUG-solver/m5_Light_LPR_120_secs_2022-03-12T04-44-56_201.fits"
> Found one coordinate representation.
> Found one coordinate representation.
> QINFO  : TestFitsData::testParallelSolvers() "#0:
> /home/hy/Desktop/SharedFolder/DEBUG-solver/guide_frame_00-20-08.fits HFR
> 1.98326"
> QINFO  : TestFitsData::testParallelSolvers() org.kde.kstars.fits: Loading
> file  "/home/hy/Desktop/SharedFolder/DEBUG-solver/guide_frame_00-20-12.fits"
> QINFO  : TestFitsData::testParallelSolvers() "#0:
> /home/hy/Desktop/SharedFolder/DEBUG-solver/guide_frame_00-20-30.fits HFR
> 2.0226"
> QINFO  : TestFitsData::testParallelSolvers() org.kde.kstars.fits: Loading
> file  "/home/hy/Desktop/SharedFolder/DEBUG-solver/guide_frame_00-20-34.fits"
> ...
> QINFO  : TestFitsData::testParallelSolvers() org.kde.kstars.fits: Loading
> file  "/home/hy/Desktop/SharedFolder/DEBUG-solver/guide_frame_00-20-46.fits"
> Found one coordinate representation.
> Found one coordinate representation.
> QINFO  : TestFitsData::testParallelSolvers() "#102:
> /home/hy/Desktop/SharedFolder/DEBUG-solver/guide_frame_00-20-21.fits HFR
> 1.9854"
> QINFO  : TestFitsData::testParallelSolvers() org.kde.kstars.fits: Loading
> file  "/home/hy/Desktop/SharedFolder/DEBUG-solver/guide_frame_00-20-24.fits"
> QINFO  : TestFitsData::testParallelSolvers() "#101:
> /home/hy/Desktop/SharedFolder/DEBUG-solver/guide_frame_00-20-46.fits HFR
> 2.04488"
> QINFO  : TestFitsData::testParallelSolvers() org.kde.kstars.fits: Loading
> file  "/home/hy/Desktop/SharedFolder/DEBUG-solver/guide_frame_00-20-30.fits"
> Found one coordinate representation.
> corrupted size vs. prev_size
> Found 0 coordinate representations.
> Aborted (core dumped)
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kstars-devel/attachments/20220525/edca4326/attachment.htm>


More information about the Kstars-devel mailing list