×

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

Bi-monthly release with minor bug fixes and improvements

Memory Leak

  • Posts: 10
  • Thank you received: 3

Replied by Robusto on topic Memory Leak

Indeed, those two settings do the magic - but this is probably not just about getting memory filled as this happens even with a handful of captured frames.
This is very disappointing, I finally bit the bullet and upgraded my KStars to the latest and this is now practically unusable the way it is.

Also, brief rundown on how to reproduce the problem:

- Using simulator devices: CCD sim, telescope sim, guider sim
- Created a new sequence (3x lum, 3x red) and saved it
- Opened the scheduler, chose M 34 (I doubt this matters), selected the sequence
- Did not touch the sequence conditions
- Add and run the sequence

A crash will most likely occur at some point (had one happen at 2 frames, one happen at 3 frames, etc).
I doubt this is even exactly a simple memory leak since it happens so quickly, and my machine has 8GB of RAM, a pair of simulator camera frames hardly make a dent.
As said, disabling those two options act as a workaround, so this is definitely FITS viewer related.

Attached a verbose log.
The crash happens right after "Reading FITS file buffer".

I tried the bug reporting tool but unfortunately it failed to get anything useful out of it, so I tried running it with gdb, and that perhaps gave out something useful:
Thread 14 "Thread (pooled)" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffa1cc2700 (LWP 8338)]
0x00005555557d7878 in FITSData::loadWCS (this=0x55555b2185e0) at ./kstars/fitsviewer/fitsdata.cpp:2444

And backtrace for thread 14:
Thread 14 (Thread 0x7fffa1cc2700 (LWP 8338)):
#0  0x00005555557d7878 in FITSData::loadWCS (this=0x55555b2185e0) at ./kstars/fitsviewer/fitsdata.cpp:2444
#1  0x00005555557b01c2 in QtConcurrent::StoredMemberFunctionPointerCall0<bool, FITSData>::runFunctor (this=0x55555ba61720)
    at /usr/include/x86_64-linux-gnu/qt5/QtConcurrent/qtconcurrentstoredfunctioncall.h:189
#2  0x00005555556748e5 in QtConcurrent::RunFunctionTask<bool>::run (this=0x55555ba61720)
    at /usr/include/x86_64-linux-gnu/qt5/QtConcurrent/qtconcurrentrunbase.h:108
#3  0x00007ffff21dc2b2 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007ffff21df17d in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007ffff14ab6db in start_thread (arg=0x7fffa1cc2700) at pthread_create.c:463
#6  0x00007ffff026788f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

And backtrace for Thread 1:
Thread 1 (Thread 0x7ffff7f9a440 (LWP 8321)):
#0  0x00007ffff14b19f3 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x55555ba01d90)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1  __pthread_cond_wait_common (abstime=0x0, mutex=0x55555ba01d40, cond=0x55555ba01d68) at pthread_cond_wait.c:502
#2  __pthread_cond_wait (cond=0x55555ba01d68, mutex=0x55555ba01d40) at pthread_cond_wait.c:655
#3  0x00007ffff21e05ab in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007ffff21d30e0 in QFutureInterfaceBase::waitForFinished() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00005555557bbd72 in FITSView::loadFITSFromData (this=this@entry=0x55555b9fef10, data=data@entry=0x55555c239000, inFilename=...)
    at ./kstars/fitsviewer/fitsview.cpp:309
#6  0x000055555590f53c in FITSTab::loadFITSFromData (this=this@entry=0x55555b10b650, data=data@entry=0x55555c239000, imageURL=..., 
    mode=<optimized out>, filter=<optimized out>) at ./kstars/fitsviewer/fitstab.cpp:478
#7  0x00005555558f6715 in FITSViewer::updateFITSFromData (this=0x7fff48001c30, data=data@entry=0x55555c239000, imageName=..., 
    fitsUID=<optimized out>, tab_uid=tab_uid@entry=0x7fffffffd560, filter=filter@entry=FITS_NONE) at ./kstars/fitsviewer/fitsviewer.cpp:538
#8  0x00005555558d3786 in ISD::CCD::processBLOB (this=0x555557c64380, bp=0x7fff7c0186d0) at ./kstars/indi/indiccd.cpp:1722
#9  0x00005555558c0656 in INDIListener::processBLOB (this=<optimized out>, bp=0x7fff7c0186d0) at ./kstars/indi/indilistener.cpp:435
#10 0x000055555586b1d4 in INDIListener::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>)
    at ./obj-x86_64-linux-gnu/kstars/KStarsLib_autogen/FRI4DANIHA/moc_indilistener.cpp:189
#11 0x00007ffff23ec645 in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#12 0x00005555558389a2 in ClientManager::newINDIBLOB (this=<optimized out>, _t1=<optimized out>)
    at ./obj-x86_64-linux-gnu/kstars/KStarsLib_autogen/FRI4DANIHA/moc_clientmanager.cpp:363
#13 0x00007ffff23ed1b2 in QObject::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#14 0x00007ffff384283c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#15 0x00007ffff384a104 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#16 0x00007ffff23bd9c8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#17 0x00007ffff23c013d in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#18 0x00007ffff2417353 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#19 0x00007fffed8f3417 in g_main_context_dispatch () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#20 0x00007fffed8f3650 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#21 0x00007fffed8f36dc in g_main_context_iteration () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#22 0x00007ffff241697f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#23 0x00007ffff23bb9fa in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#24 0x00007ffff23c4aa4 in QCoreApplication::exec() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#25 0x000055555562a412 in main (argc=<optimized out>, argv=<optimized out>) at ./kstars/main.cpp:333

I hope this'll help in investigating this.
The following user(s) said Thank You: Radek Kaczorek, Tim Schuh
4 years 3 months ago #47797
Attachments:

Please Log in or Create an account to join the conversation.

Replied by Jasem Mutlaq on topic Memory Leak

The WCS crash is not a memory leak issue, but thread synchronization issue that I thought we resolved already. At any rate, I just pushed memory-related fixes in the hope that it improves the situation. Can everyone please compile from GIT and report back?
The following user(s) said Thank You: Tim Schuh
4 years 3 months ago #47833

Please Log in or Create an account to join the conversation.

  • Posts: 10
  • Thank you received: 3

Replied by Robusto on topic Memory Leak

I suspected as much - when did the thread sync issue get fixed, which commit hash? It is present in the current release, 3.3.9 (Build 2020-01-02T08:17:38Z).
I did try to re-produce that yesterday from the latest sources but failed, so it does seem like it has been fixed (can't be 100% sure since I was testing on another computer) but I can't exactly find which commit did that.
4 years 3 months ago #47843

Please Log in or Create an account to join the conversation.

  • Posts: 1221
  • Thank you received: 565

Replied by Hy Murveit on topic Memory Leak

I'm curious if there's a common thread among the people who experience this leak (e.g. I still can't replicate it, and as of recently, I don't believe Jasem could either--I know he's hard at work looking into it). For instance, are you all DSLR users? RGB camera users with debayering, etc?

If you experience this leak, could you please post more details about the minimum configuration you use that will trigger this leak.
E.g.:
camera model and type, e.g. Canon DSLR with resolution WxH, ZWO 1600 monochome resolution WxH, ...
fits, raw, ???
Running fitsviewer while you capture?
Processor (e.g. RPi4) on what OS (Raspbian? Ubuntu 18.04? Stellarmate?)
How did you install KStars (Stellarmate, AstroPi3, AstroBerry, ...)
What release are you using when you observed the leak? (released 3.3.9, nightly at what date),

Also, can you tell how much is leaked per image? (e.g. by running the linux command 'ps aux | grep kstars" after every 5th or 10th image for as long as makes sense) and how that relates to the size of the image your camera captures

Thanks,
Hy
4 years 3 months ago #47900

Please Log in or Create an account to join the conversation.

  • Posts: 396
  • Thank you received: 17

Replied by Ronald Scotti on topic Memory Leak

I have not experienced the memory link and have not had clear skies to try my cameras (SBIG 8300M and SX Lodestar) other than test shots. But I applied the two settings recommended above and then the issue is that you have no star image in the focus routing. you can pull it up in the fits viewer, but you cannot select stars there.

I am hoping this is not an issue with my setup and have gone back to the 'normal' settings.

thanks,
Ron
4 years 3 months ago #47991

Please Log in or Create an account to join the conversation.

  • Posts: 527
  • Thank you received: 139

Replied by Andrew Burwell on topic Memory Leak


I experienced this recently, it’s unrelated. But it seems that drivers for cameras got reset to default values with one of the latest updates. Make sure your camera is set to 16-bit raw. Mine reset to 8-bit and no guide stars showed up.
4 years 3 months ago #47992

Please Log in or Create an account to join the conversation.

  • Posts: 396
  • Thank you received: 17

Replied by Ronald Scotti on topic Memory Leak

thanks I will check, but I don't think that was my issue. When I changed to 2 settings back as they were originally, the star window did show up again, with no changes to camera driver.

This overall program is 'extremely' complicated and I find I have to test everything I want to use before hand; otherwise I am sure to have a problem (mostly of my understanding of available options) when I go to actually use a module.

thanks for all the hard work.
Ron
4 years 3 months ago #47999

Please Log in or Create an account to join the conversation.

  • Posts: 4
  • Thank you received: 0

Replied by Tim Schuh on topic Memory Leak


I'm on a 4GB RPi4 running StellarmateOS, updated via internet between tests. I haven't got a record of the versions that I experienced this issue with since I've upgraded Stellarmate since then. It would have been what ever packages were published when I started this thread.

Camera I was using here is a QHY168C, consuming about 300MB per frame, filling 4GB of RAM in less than 15 frames. Shooting FITS and debayered. I will test again tonight.
4 years 3 months ago #48016

Please Log in or Create an account to join the conversation.

  • Posts: 4
  • Thank you received: 0

Replied by Tim Schuh on topic Memory Leak

Every 10 frames in a series of 30 subs. There was a previous run of 10 subs so I'm already starting with a bit of memory load.

stellarmate@stellarmate:~$ ps auxww | grep kstars
Start: stellar+  1301  1.0 36.9 2959744 1372704 ?     SLl  11:20   6:49 /usr/bin/kstars --paused
10 subs: stellar+  1301  1.1 45.5 3280028 1691824 ?     SLl  11:20   7:18 /usr/bin/kstars --paused
20 subs: stellar+  1301  1.2 54.1 3600308 2012224 ?     SLl  11:20   7:43 /usr/bin/kstars --paused
30 subs: stellar+  1301  1.2 62.4 3920592 2317312 ?     SLl  11:20   8:07 /usr/bin/kstars --paused
 
stellarmate@stellarmate:~$ sudo dpkg --list | grep kstars
ii  kstars-bleeding                               6:3.3.9+202001011609~ubuntu18.04.1        arm64        desktop planetarium for KDE
ii  kstars-bleeding-data                          6:3.3.9+202001011609~ubuntu18.04.1        all          data files for KStars desktop planetarium
ii  kstars-bleeding-dbg                           6:3.3.9+202001011609~ubuntu18.04.1        arm64        debug information for the desktop planetarium for KDE
 
stellarmate@stellarmate:~$ sudo dpkg --list | grep qhy
ii  indi-qhy                                      2.6~202001021211~ubuntu18.04.1            arm64        INDI QHY Driver. This driver is compatible with any INDI client such as KStars or Xephem.
ii  libqhy                                        6.0.5+unstable~201912300954~ubuntu18.04.1 arm64        libqhy provide libraries to access and control QHY CCDs and Filter Wheels.


Disconnecting the gear and stopping the server made no difference of course. Memory is freed immediately upon kstars exiting. 30-ish subs are about all I can get before exhausting the 4GB RPi4.
Last edit: 4 years 3 months ago by Tim Schuh.
4 years 3 months ago #48032

Please Log in or Create an account to join the conversation.

  • Posts: 19
  • Thank you received: 1

Replied by Jim Johnston on topic Memory Leak

New to this forum and to the whole K-Stars and Ekos thing. I have also been experiencing this memory leak problem; I screen recorded my session this evening and have posted a link here if anyone is interested. K-Stars crashed at 1:14:23 in this clip. I has the FITS viewer disabled in K-Stars. I am running on a Raspberry Pi 4 with 4GB RAM and Astroberry.

www.dropbox.com/s/anp7k2o25f0jovh/ice_vi...201-181546.webm?dl=0

Jim
4 years 2 months ago #48844

Please Log in or Create an account to join the conversation.

  • Posts: 1119
  • Thank you received: 182

Replied by Jose Corazon on topic Memory Leak

There is not file that is accessible. Can you please repost?
I also have these repeated and absolutely unpredictable crashes, but only on my Pi4. Never on my mini-PC, so I suspect this is something inherent to the Pi4 firmware or the architecture.
4 years 2 months ago #48883

Please Log in or Create an account to join the conversation.

  • Posts: 398
  • Thank you received: 117

Replied by Doug S on topic Memory Leak

For another data point, I don't see the problem with simulation at all. I ran last night with real hardware (SM OS, Pi4-4GB, ASI183mc Pro, ASI290mm Mini) and saw a crash every time I ran any sequence containing multiple image captures. I do get a single fits preview (haven't turned that off yet). However, when I ran with only 1 capture at a time (no matter how many times I ran a single capture), it always worked fine. I ran out of time last night during my tests, but I was curious about whether a zero delay between image captures could be aggravating the situation. I upgraded to 3.4 today, and I'll try again tonight to capture some additional data and post here on whether this is better in the new release.
Last edit: 4 years 2 months ago by Doug S. Reason: spelling error
4 years 2 months ago #48886

Please Log in or Create an account to join the conversation.

Time to create page: 0.944 seconds