<div dir="ltr">Jasem,<div><br></div><div>I not even solving. I'm just star-detecting, and getting faults.</div><div>Faults are likely double free-ing memory, or the like.</div><div>I think I've improved things by zero'ing when memory is freed--it runs longer--but it still crashes.</div><div>I've been setting my test to run 3000, 3000, 400 iterations. Now I'm getting to 1200 or so before crashes.</div><div><br></div><div>Hy</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 4, 2022 at 11:54 PM Jasem Mutlaq <<a href="mailto:mutlaqja@ikarustech.com">mutlaqja@ikarustech.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Thank you Hy for the tests. I haven't run it yet, but I wonder if perhaps there is an issue with wcs library... is that thread safe? Can you try disabling all wcs related code and see if that makes any difference?<div><br clear="all"><div><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div>--</div><div>Best Regards,<br>Jasem Mutlaq<br></div><div><br></div></div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 5, 2022 at 5:55 AM Hy Murveit <<a href="mailto:murveit@gmail.com" target="_blank">murveit@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Folks,</div><div><br></div><div>I believe there are rare but often-enough memory issues when running stellarsolver.</div><div>I can't track it down, so I created this test to help us debug it.</div><div><br></div><div>If you have time, could you take a look?</div><div><br></div><div>I've create a branch with a test which runs stellarsolver star detection in 3 parallel threads<br></div><div><a href="https://invent.kde.org/murveit/kstars/-/tree/solver-test1" target="_blank">https://invent.kde.org/murveit/kstars/-/tree/solver-test1</a><br></div><div>(if you uncomment some code, a 4th thread with a solver will run too).</div><div><br></div><div>To run this, you need to also download some data that it points to:</div><div>See the google drive folder: </div><div><a href="https://drive.google.com/drive/folders/1eUrcJd1IENvcRUtnwsaUNWKwKuj5G077?usp=sharing" target="_blank">https://drive.google.com/drive/folders/1eUrcJd1IENvcRUtnwsaUNWKwKuj5G077?usp=sharing</a><br></div><div>Download those files into some directory on your machine.</div><div><br></div><div>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.</div><div><br></div><div>Then you can compile testfitsdata and run it as:</div><div>bin/testfitsdata testParallelSolvers</div><div><br></div><div>It will detect stars for 3 sets of data. </div><div><ul><li>200 guider files in thread 1</li><li>200 more guider files in thread 2</li><li>30 subs in thread3</li><li>(commented out) 30 guider files using the solver</li></ul></div><div>It takes a minute or two.</div><div><br></div><div>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.</div><div><br></div><div>Here's an example of one run that failed:</div><div><br></div><div>> bin/testfitsdata testParallelSolvers<br>********* Start testing of TestFitsData *********<br>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)<br>PASS   : TestFitsData::initTestCase()<br>QINFO  : TestFitsData::testParallelSolvers() org.kde.kstars.fits: Loading file  "/home/hy/Desktop/SharedFolder/DEBUG-solver/guide_frame_00-20-08.fits"<br>QINFO  : TestFitsData::testParallelSolvers() org.kde.kstars.fits: Loading file  "/home/hy/Desktop/SharedFolder/DEBUG-solver/guide_frame_00-20-30.fits"<br>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"<br>Found one coordinate representation.<br>Found one coordinate representation.<br>QINFO  : TestFitsData::testParallelSolvers() "#0: /home/hy/Desktop/SharedFolder/DEBUG-solver/guide_frame_00-20-08.fits HFR 1.98326"<br>QINFO  : TestFitsData::testParallelSolvers() org.kde.kstars.fits: Loading file  "/home/hy/Desktop/SharedFolder/DEBUG-solver/guide_frame_00-20-12.fits"<br>QINFO  : TestFitsData::testParallelSolvers() "#0: /home/hy/Desktop/SharedFolder/DEBUG-solver/guide_frame_00-20-30.fits HFR 2.0226"<br>QINFO  : TestFitsData::testParallelSolvers() org.kde.kstars.fits: Loading file  "/home/hy/Desktop/SharedFolder/DEBUG-solver/guide_frame_00-20-34.fits"<br></div><div>...</div><div>QINFO  : TestFitsData::testParallelSolvers() org.kde.kstars.fits: Loading file  "/home/hy/Desktop/SharedFolder/DEBUG-solver/guide_frame_00-20-46.fits"<br>Found one coordinate representation.<br>Found one coordinate representation.<br>QINFO  : TestFitsData::testParallelSolvers() "#102: /home/hy/Desktop/SharedFolder/DEBUG-solver/guide_frame_00-20-21.fits HFR 1.9854"<br>QINFO  : TestFitsData::testParallelSolvers() org.kde.kstars.fits: Loading file  "/home/hy/Desktop/SharedFolder/DEBUG-solver/guide_frame_00-20-24.fits"<br>QINFO  : TestFitsData::testParallelSolvers() "#101: /home/hy/Desktop/SharedFolder/DEBUG-solver/guide_frame_00-20-46.fits HFR 2.04488"<br>QINFO  : TestFitsData::testParallelSolvers() org.kde.kstars.fits: Loading file  "/home/hy/Desktop/SharedFolder/DEBUG-solver/guide_frame_00-20-30.fits"<br>Found one coordinate representation.<br>corrupted size vs. prev_size<br>Found 0 coordinate representations.<br>Aborted (core dumped)<br></div></div>
</blockquote></div>
</blockquote></div>