<div dir="ltr"><div>Final update - issue sorted. Purely related to StellarSolver and not KStars whatsoever.</div><div><br></div><div>While cross-compiling for armhf target on x86_64 host, a user needs to set RUN_RESULT_2 and RUN_RESULT_2 variables appropriately. Otherwise a user can end up with conflicting declaration of C function qsort_r, which is visible only if BUILD_TESTER=ON. Otherwise (stellarmate lib only) compilation completes silently.</div><div>In summary the solution is:</div><div>1. debian/rules must contain DEB_CMAKE_EXTRA_FLAGS += -C/tmp/TryRunResults.cmake</div><div>2. /tmp/TryRunResults.cmake must contain:</div><div>set (RUN_RESULT_2 "0" CACHE STRING "Result from TRY_RUN" FORCE)<br>set (RUN_RESULT_3 "0" CACHE STRING "Result from TRY_RUN" FORCE)<br></div><div><br></div><div>Best regards</div><div><br></div><div>Radek Kaczorek<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 17 Aug 2022 at 18:38, Radek Kaczorek <<a href="mailto:rkaczorek@gmail.com">rkaczorek@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>Just to add the full stack trace with libstellarsolver-dbg:</div><div><br></div><div>Thread 27 "ExtractorSolver" received signal SIGSEGV, Segmentation fault.<br>[Switching to Thread 0x9476c040 (LWP 3110)]<br>0x9476b6a8 in ?? ()<br>(gdb) bt<br>#0 0x9476b6a8 in ?? ()<br>#1 0xb39177ac in msort_with_tmp (p=0x9476b658, b=0x9476b6f0, n=2490808048) at msort.c:65<br>#2 0xb391760c in msort_with_tmp (n=2, b=0x9476b6f0, p=0x9476b658) at msort.c:53<br>#3 msort_with_tmp (p=0x9476b658, b=0x9476b6f0, n=2490808048) at msort.c:53<br>#4 0xb3917a30 in msort_with_tmp (n=4, b=0x9476b6f0, p=0x9476b658) at msort.c:297<br>#5 __GI___qsort_r (b=b@entry=0x9476b6f0, n=n@entry=4, s=s@entry=4, cmp=cmp@entry=0x9476b6a8, arg=0xb5738ba9 <compare_permuted>) at msort.c:297<br>#6 0xb5738ca6 in permuted_sort (realarray=realarray@entry=0x9476b758, array_stride=array_stride@entry=8, compare=<optimized out>, perm=perm@entry=0x9476b6f0, N=N@entry=4) at ./stellarsolver/astrometry/util/permutedsort.c:86<br>#7 0xb5738752 in healpix_distance_to_xyz (closestxyz=<optimized out>, xyz=<optimized out>, Nside=<optimized out>, hp=<optimized out>) at ./stellarsolver/astrometry/util/healpix.c:1347<br>#8 healpix_distance_to_xyz (hp=11, Nside=1, xyz=0x9476b7e8, closestxyz=0x9476b800) at ./stellarsolver/astrometry/util/healpix.c:1314<br>#9 0xb57389fe in healpix_distance_to_radec (hp=11, Nside=1, ra=<optimized out>, dec=<optimized out>, closestradec=closestradec@entry=0x0) at ./stellarsolver/astrometry/util/healpix.c:1411<br>#10 0xb57249ee in index_is_within_range (meta=meta@entry=0xa77ca2c8, ra=<optimized out>, dec=<optimized out>, radius_deg=15) at ./stellarsolver/astrometry/util/index.c:32<br>#11 0xb571d88a in engine_run_job (engine=engine@entry=0xa771fd48, job=0x5f72728) at ./stellarsolver/astrometry/blind/engine.c:520<br>#12 0xb56f5d10 in InternalExtractorSolver::runInternalSolver (this=this@entry=0x5f72458) at ./stellarsolver/internalextractorsolver.cpp:1238<br>#13 0xb56f8852 in InternalExtractorSolver::run (this=0x5f72458) at ./stellarsolver/internalextractorsolver.cpp:169<br>#14 0xb429cb58 in ?? () from /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5<br>#15 0xb5798494 in start_thread (arg=0x9476c040) at pthread_create.c:486<br>Backtrace stopped: Cannot access memory at address 0x174</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 17 Aug 2022 at 17:46, Radek Kaczorek <<a href="mailto:rkaczorek@gmail.com" target="_blank">rkaczorek@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>Hi there</div><div>Could you please take a look at this?</div><div>Just to add some details to the message below. I cross-compile to armhf on x86_64 using Debian Buster as a base OS.</div><div>Kind regards</div><div>Radek<br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">---------- Forwarded message ---------<br>From: <b class="gmail_sendername" dir="auto">Jasem Mutlaq</b> <span dir="auto"><<a href="mailto:mutlaqja@ikarustech.com" target="_blank">mutlaqja@ikarustech.com</a>></span><br>Date: Wed, 17 Aug 2022 at 17:39<br>Subject: Re: KStars 3.6.0 crash<br>To: Radek Kaczorek <<a href="mailto:rkaczorek@gmail.com" target="_blank">rkaczorek@gmail.com</a>><br></div><br><br><div dir="ltr">Hello Radek,<div><br></div><div>We also use the latest (2.4) without issues. Can you please send this to <a href="mailto:kstars-devel@kde.org" target="_blank">kstars-devel@kde.org</a> so that other developer take a look at it and might have some ideas?</div><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 Wed, Aug 17, 2022 at 6:37 PM Radek Kaczorek <<a href="mailto:rkaczorek@gmail.com" target="_blank">rkaczorek@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>Hi Jasem</div><div><br></div><div>I have recently repackaged KStars 3.6.0 for astroberry and apparently it crashes at plate-solving with stellarsolver. I have used stable-3.6.0 branch of KStars as a source and the latest Stellarsolver, which probably introduces a bug.Which stellarsolver version/commit do you use for compilation?</div><div><br></div><div>So far I get:</div><div>Thread 37 "ExtractorSolver" received signal SIGSEGV, Segmentation fault.<br>[Switching to Thread 0x70498040 (LWP 1965)]<br>0x704976a8 in ?? ()<br>(gdb) bt<br>#0 0x704976a8 in ?? ()<br>#1 0xb39177ac in msort_with_tmp (p=0x70497658, b=0x704976f0, n=1883862768) at msort.c:65<br>#2 0xb391760c in msort_with_tmp (n=2, b=0x704976f0, p=0x70497658) at msort.c:53<br>#3 msort_with_tmp (p=0x70497658, b=0x704976f0, n=1883862768) at msort.c:53<br>#4 0xb3917a30 in msort_with_tmp (n=4, b=0x704976f0, p=0x70497658) at msort.c:297<br>#5 __GI___qsort_r (b=0x704976f0, n=4, s=4, cmp=0x704976a8, arg=0xb5738ba9) at msort.c:297<br>#6 0xb5738ca6 in permuted_sort () from /usr/lib/arm-linux-gnueabihf/libstellarsolver.so.2<br>#7 0xb5738752 in healpix_distance_to_xyz () from /usr/lib/arm-linux-gnueabihf/libstellarsolver.so.2<br>#8 0x44aec64c in ?? ()<br>Backtrace stopped: previous frame identical to this frame (corrupt stack?)</div><div><br></div><div>Best regards</div><div><br></div><div>Radek<br></div></div>
</blockquote></div>
</div></div></div>
</blockquote></div>
</blockquote></div>