×

INDI Library v2.0.7 is Released (01 Apr 2024)

Bi-monthly release with minor bug fixes and improvements

KStars memory leak and crash

  • Posts: 3
  • Thank you received: 0
Ian, I had the identical scenario last night. My crash appeared to be around the meridian flip period too but I was noticing a gradual memory leak building up on my RPi 4 (4gb) until when it gets to around 50% of available is when it seem to crash. Between targets I even restarted it to try and avoid issues but this morning I awoke to find everything running, except KStars of course, so imaging seemed to stop around the time I was expecting the meridian flip (about 20 mins after I went to bed on a fantastic clear & good seeing night - it was watching me lol).
I do not use the fits viewer once imaging as I have seen similar in the previous versions cause this same issue.

My setup is similar (but different)
IOptron CEM60
ASI 2600mm and guide ASI174mm mini with ASI EFW.
All runs on Astroberry...

My workflow is very similar to yours

I did notice memory increasing when focusing (anecdotal of course)

Did not have this issue with prior version, ran all night no issues, no memory incremental over time, only since upgrading to 3.5.5 which I now wish I hadn't...
Anyone know how to downgrade without losing all my carefully honed settings?

All verbose logging is now on to try and isolate when it exactly happens.

Jonathan
2 years 4 months ago #78316
The topic has been locked.
  • Posts: 9
  • Thank you received: 0

Replied by Ian on topic KStars memory leak and crash

Jonathan, that's interesting. Sounds like it might be the same cause.

I was able to image last night without crashing, with KStars ending up at ~1GB reserved memory in the morning. I left Ekos on the Analyze tab, you're probably on to something with the tab being relevant. I think I left it on the Guiding tab last time, I'll try that tonight.

Downgrading might be possible if the packages are still in the apt cache, but I would be worried about settings not being compatible with older versions.
2 years 4 months ago #78326
The topic has been locked.
  • Posts: 9
  • Thank you received: 0

Replied by Ian on topic KStars memory leak and crash

Update: I didn't end up imaging, however yesterday I tested a few cases:

1. Leaving KStars open without starting Ekos: no memory increase
2. Leaving KStars open with Ekos started, mount parked, guiding set to "loop": slow memory increase from 205MB to 355MB from 8:50AM to 10:50AM (1.25MB/min). No log messages about swig/python.
3. Building master (e7bc2c83c6d2975e049019d2b01fd16ff4e45625), stable-3.5.2, and 3.5.0 from source and repeating #2: same behavior.

This makes it seem like either a. it's not KStars, maybe an indi/astroberry issue or b. it's KStars, and either been around for a while or there's always been a slow leak and occasionally there's a larger leak that leads to the crash I experienced or c. it's KStars, and a recent indi/astroberry change has exposed an underlying issue.

Additonally, when closing KStars after #2 /usr/bin/indi_eqmod_telescope crashed. Looking back this happened twice on Dec 2nd as well. Not sure if it's related. Journalctl:
ec 05 10:50:13 astroberry systemd[1]: Created slice system-systemd\x2dcoredump.slice.
Dec 05 10:50:13 astroberry systemd[1]: Started Process Core Dump (PID 20598/UID 0).
Dec 05 10:50:13 astroberry systemd-coredump[20599]: Process 17270 (indi_eqmod_tele) of user 1001 dumped core.                                                                                                      
 
                                                    Stack trace of thread 17270:
                                                    #0  0x00000000b63faf14 __GI_raise (libc.so.6)
                                                    #1  0x00000000b63e6230 __GI_abort (libc.so.6)
                                                    #2  0x00000000b66408d8 _ZN9__gnu_cxx27__verbose_terminate_handlerEv (libstdc++.so.6)                                                                           
Dec 05 10:50:13 astroberry systemd[1]: systemd-coredump@0-20598-0.service: Succeeded.

Core dump:
Core was generated by `indi_eqmod_telescope'.
Program terminated with signal SIGABRT, Aborted.
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50      ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0xb63e6230 in __GI_abort () at abort.c:79
#2  0xb66408d8 in __gnu_cxx::__verbose_terminate_handler() ()
   from /usr/lib/arm-linux-gnueabihf/libstdc++.so.6
#3  0xb663e5b0 in ?? () from /usr/lib/arm-linux-gnueabihf/libstdc++.so.6
#4  0xb663d56c in ?? () from /usr/lib/arm-linux-gnueabihf/libstdc++.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
2 years 4 months ago #78401
The topic has been locked.
  • Posts: 104
  • Thank you received: 21
As are running Astroberry, all of the python processes you report at the top are panels that are available from left hand pop-out menu in the web interface (when you open Astroberry.local in the browser). You can take all of them out of the equation by

sudo systemctl stop <…>.service
sudo systemctl disable <…>.service

See /etc/systemd/system/*.service
2 years 4 months ago #78438
The topic has been locked.
  • Posts: 9
  • Thank you received: 0

Replied by Ian on topic KStars memory leak and crash

Good idea. I've tested by
sudo systemctl stop astropanel.service indiwebmanager.service indi-mqtt.service
and verifying the processes stopped. Unfortunately, still seeing a leak.

Additionally, I built KStars and libindi from master on my x86_64 desktop and attempted to reproduce the memory leak without luck. Also built the 3.5.5 KStars and 1.9.2 libindi tags (versions astroberry is using), no dice.

Simple repro on astroberry:
1. backup and then rm -r ~/.local/share/kstars ~/.indi ~/.config/kstarsrc for a fresh start
2. launch KStars
3. launch Ekos
4. wizard local devices -> create profile -> add simulator telescope and CCD
5. start Ekos
6. go to guider tab -> loop
7. Check RES memory usage via htop, check again every few minutes and notice a steady increase

It doesn't appear to matter which tab it's left on. I've tested switching to the Scheduler tab in case it was due to images/charts updating but it still leaks.
2 years 4 months ago #78448
The topic has been locked.
  • Posts: 18
  • Thank you received: 2

Replied by MH on topic KStars memory leak and crash

I've seen the same behavior time and time again with my Pi4, was wondering if it was just me or something else was going on...

I haven't yet been able to get it to actually crash outright, but still notice the steady RAM utilization increases overnight; usually by morning the system is using 80%+ of available RAM, and the syslog output just has a ton of messages in the format of:
astroberry python3[1109]: swig/python detected a memory leak of type 'INDI::BaseDevice::Properties *', no destructor found.
2 years 1 month ago #81135
The topic has been locked.
  • Posts: 18
  • Thank you received: 2

Replied by MH on topic KStars memory leak and crash

I've seen the same behavior time and time again with my Pi4, was wondering if it was just me or something else was going on...

I haven't yet been able to get it to actually crash outright, but still notice the steady RAM utilization increases overnight; usually by morning the system is using 80%+ of available RAM, and the syslog output just has a ton of messages in the format of:

<code>swig/python detected a memory leak of type 'INDI BaseDevice Properties *', no destructor found</code>

(had to change the actual formatting of the syslog message so it would actually post; that's not the exact format but is the exact verbiage)
2 years 1 month ago #81138
The topic has been locked.
  • Posts: 18
  • Thank you received: 2

Replied by MH on topic KStars memory leak and crash

I've seen the same behavior time and time again with my Pi4, was wondering if it was just me or something else was going on...

I haven't yet been able to get it to actually crash outright, but still notice the steady RAM utilization increases overnight; usually by morning the system is using 80%+ of available RAM, and the syslog output just has a ton of messages in the format of:
swig/python detected a memory leak of type 'INDI BaseDevice Properties *', no destructor found

(had to change the actual formatting of the syslog message so it would actually post; that's not the exact format but is the exact verbiage)
2 years 1 month ago #81139
The topic has been locked.
  • Posts: 20
  • Thank you received: 0
Hi folks,

I have got the same problem the swig/python detected a memory leak:

astroberry python3[2015]: swig/python detected a memory leak of type 'INDI::BaseDevice::Properties *', no destructor found.

Do you have some solutions for that? I have got many craash session when I use the Scheduler.

Please I need your help.

Thank you so much and best regards. Germán.
1 year 10 months ago #83322
The topic has been locked.
  • Posts: 19
  • Thank you received: 1
German,
Not sure if you've got anywhere with this - I'd seen the same thing with memory increasing and eventually KStars crashes mid-imaging. In summary, RPi 4 4GB, + astroberry, Canon DSLR, AZEQ6 & ZWO 120mm guidecam.
Tracked things down, by several simulation tests, wrote shell scripts to output memory usage and noted the cache seems to fill up, and eventually starts using Swap memory.
By updating the script to watch out for the cache and available memory, and if it gets too full, then things get purged automatically.
Memory usage keeps rising, but the script keeps purging, so I'm hoping I have found a workaround rather than solution.
My post here shows my extensive tests, and scripts also so you could try and see if you got same result/success?
Post back so we can see!
1 year 10 months ago #83470
The topic has been locked.
I've used Heaptrack before to check if we are getting any memory leaks, but I couldn't find anything substantial. Valgrind doesn't work at all with KStars, so we can't use that to figure out any memory leaks. Peter, you think you can use Heaptrack or another tool to help us pin this issue down?
1 year 10 months ago #83480
The topic has been locked.
  • Posts: 155
  • Thank you received: 12
I am trying to use the sanitizers on kstars to see what gets thrown out. Threw out a number of complaints but not yet sure whether they are actual leaks or not. Still investigating.
1 year 10 months ago #83487
The topic has been locked.
Time to create page: 0.981 seconds