-
Notifications
You must be signed in to change notification settings - Fork 168
Memory leak observed in v3.1.3 #553
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi! Unfortunately, I can't reproduce that on amd64 and I don't have a raspberry pi with X11 at hand at the moment. Could you install the
You can terminate feh after a few hours or days or wait until it crashes. Either way, I'm looking for valgrind's memory leak output, which looks like this:
If any lost value is reported as non-zero, there''s a leak. If "still reachable" is in the range of several hundred megabytes, there's probably also something odd. |
Thanks Daniel! I'd be happy to help. Quick advice (still picking up on valgrind), If I run your one liner, it seems to be running in the background, but the pictures don't show up - i.e. feh isn't working. Same if I run it via my .sh script (auto after boot), or manually, or with sudo.
The only output I get is via the terminal when run manually. valgrind.log is empty (not being written to) pi@pizero:~ $ export DISPLAY=:0; sudo valgrind /usr/bin/feh -qrYzZFD 120.0 --auto-rotate --zoom fill /home/pi/Pictures/frame/ 2>&1 > /var/tmp/valgrind.log ==1425== Memcheck, a memory error detector ==1425== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al. ==1425== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info ==1425== Command: /usr/bin/feh -qrYzZFD 120.0 --auto-rotate --zoom fill /home/pi/Pictures/frame/ ==1425== --1425-- WARNING: Serious error when reading debug info --1425-- When reading debug info from /lib/arm-linux-gnueabihf/ld-2.28.so: --1425-- Ignoring non-Dwarf2/3/4 block in .debug_info --1425-- WARNING: Serious error when reading debug info --1425-- When reading debug info from /lib/arm-linux-gnueabihf/ld-2.28.so: --1425-- Last block truncated in .debug_info; ignoring ==1425== Conditional jump or move depends on uninitialised value(s) ==1425== at 0x401A5D0: index (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Conditional jump or move depends on uninitialised value(s) ==1425== at 0x401A5D4: index (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Conditional jump or move depends on uninitialised value(s) ==1425== at 0x4008040: _dl_dst_count (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Conditional jump or move depends on uninitialised value(s) ==1425== at 0x4008288: expand_dynamic_string_token (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Conditional jump or move depends on uninitialised value(s) ==1425== at 0x401AA80: strlen (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Conditional jump or move depends on uninitialised value(s) ==1425== at 0x401AA84: strlen (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Conditional jump or move depends on uninitialised value(s) ==1425== at 0x4017F68: malloc (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Conditional jump or move depends on uninitialised value(s) ==1425== at 0x4017F74: malloc (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Conditional jump or move depends on uninitialised value(s) ==1425== at 0x401B5E8: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Conditional jump or move depends on uninitialised value(s) ==1425== at 0x401B608: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Conditional jump or move depends on uninitialised value(s) ==1425== at 0x401B618: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Conditional jump or move depends on uninitialised value(s) ==1425== at 0x401B634: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Conditional jump or move depends on uninitialised value(s) ==1425== at 0x401B63C: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Conditional jump or move depends on uninitialised value(s) ==1425== at 0x401B664: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x401B664: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x401B68C: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Conditional jump or move depends on uninitialised value(s) ==1425== at 0x401B6A0: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Conditional jump or move depends on uninitialised value(s) ==1425== at 0x401B6A4: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Conditional jump or move depends on uninitialised value(s) ==1425== at 0x401B6B0: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Conditional jump or move depends on uninitialised value(s) ==1425== at 0x40180A4: calloc (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Conditional jump or move depends on uninitialised value(s) ==1425== at 0x4017FA8: malloc (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Conditional jump or move depends on uninitialised value(s) ==1425== at 0x401A160: mmap (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Syscall param mmap2(start) contains uninitialised byte(s) ==1425== at 0x401A174: mmap (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Syscall param mmap2(length) contains uninitialised byte(s) ==1425== at 0x401A174: mmap (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Syscall param mmap2(offset) contains uninitialised byte(s) ==1425== at 0x401A174: mmap (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Conditional jump or move depends on uninitialised value(s) ==1425== at 0x4017F44: malloc (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Conditional jump or move depends on uninitialised value(s) ==1425== at 0x400BDD0: _dl_new_object (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Conditional jump or move depends on uninitialised value(s) ==1425== at 0x401B5F4: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x401B630: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x400BD7C: _dl_new_object (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x400BD98: _dl_new_object (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Conditional jump or move depends on uninitialised value(s) ==1425== at 0x401AA14: strdup (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Conditional jump or move depends on uninitialised value(s) ==1425== at 0x401B660: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x401B660: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x401B688: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Conditional jump or move depends on uninitialised value(s) ==1425== at 0x4008E20: _dl_map_object (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Syscall param openat(filename) contains uninitialised byte(s) ==1425== at 0x4019F4C: __open64_nocancel (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Conditional jump or move depends on uninitialised value(s) ==1425== at 0x40180E4: free (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Conditional jump or move depends on uninitialised value(s) ==1425== at 0x400BB84: _dl_new_object (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x400BB9C: _dl_new_object (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x400BBBC: _dl_new_object (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x400BBC0: _dl_new_object (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x400BBE0: _dl_new_object (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x400BC50: _dl_new_object (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x400BC64: _dl_new_object (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x400BCA8: _dl_new_object (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x400BCC0: _dl_new_object (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x401AA30: strlen (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x401AA48: strlen (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x401B628: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x400BD9C: _dl_new_object (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Conditional jump or move depends on uninitialised value(s) ==1425== at 0x4005D98: _dl_map_object_from_fd (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x4005DC4: _dl_map_object_from_fd (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x4005DD0: _dl_map_object_from_fd (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x4005E50: _dl_map_object_from_fd (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x4005E9C: _dl_map_object_from_fd (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x4005EA0: _dl_map_object_from_fd (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x400602C: _dl_map_object_from_fd (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x40060C0: _dl_map_object_from_fd (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x40060DC: _dl_map_object_from_fd (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x4006114: _dl_map_object_from_fd (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x4006A0C: _dl_map_object_from_fd (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x40061D4: _dl_map_object_from_fd (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Conditional jump or move depends on uninitialised value(s) ==1425== at 0x4010FF4: _dl_name_match_p (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x4011008: _dl_name_match_p (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x401A620: strcmp (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x4010FFC: _dl_name_match_p (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Conditional jump or move depends on uninitialised value(s) ==1425== at 0x4013660: _dl_get_origin (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x401B690: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x401B694: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x4013674: _dl_get_origin (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Conditional jump or move depends on uninitialised value(s) ==1425== at 0x400832C: expand_dynamic_string_token (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Conditional jump or move depends on uninitialised value(s) ==1425== at 0x40082E4: expand_dynamic_string_token (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x4008114: _dl_dst_substitute (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x401A67C: strcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x4008198: _dl_dst_substitute (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Conditional jump or move depends on uninitialised value(s) ==1425== at 0x401B668: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x401B668: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Conditional jump or move depends on uninitialised value(s) ==1425== at 0x400926C: _dl_map_object (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x401B7A0: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x401B6AC: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x401B900: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x401B6B0: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x401B6B4: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Conditional jump or move depends on uninitialised value(s) ==1425== at 0x401B648: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== --1425-- WARNING: Serious error when reading debug info --1425-- When reading debug info from /lib/arm-linux-gnueabihf/libm-2.28.so: --1425-- Ignoring non-Dwarf2/3/4 block in .debug_info --1425-- WARNING: Serious error when reading debug info --1425-- When reading debug info from /lib/arm-linux-gnueabihf/libm-2.28.so: --1425-- Last block truncated in .debug_info; ignoring ==1425== Conditional jump or move depends on uninitialised value(s) ==1425== at 0x401B6A8: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Conditional jump or move depends on uninitialised value(s) ==1425== at 0x401B6AC: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Conditional jump or move depends on uninitialised value(s) ==1425== at 0x401B6B4: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Conditional jump or move depends on uninitialised value(s) ==1425== at 0x4017FF0: malloc (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x4005FCC: _dl_map_object_from_fd (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x4005FE0: _dl_map_object_from_fd (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x4006020: _dl_map_object_from_fd (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== --1425-- WARNING: Serious error when reading debug info --1425-- When reading debug info from /lib/arm-linux-gnueabihf/libc-2.28.so: --1425-- Ignoring non-Dwarf2/3/4 block in .debug_info --1425-- WARNING: Serious error when reading debug info --1425-- When reading debug info from /lib/arm-linux-gnueabihf/libc-2.28.so: --1425-- Last block truncated in .debug_info; ignoring ==1425== Conditional jump or move depends on uninitialised value(s) ==1425== at 0x400E3FC: _dl_map_object_deps (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x400E410: _dl_map_object_deps (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x401B850: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== ==1425== Use of uninitialised value of size 4 ==1425== at 0x401B684: memcpy (in /lib/arm-linux-gnueabihf/ld-2.28.so) ==1425== |
The empty output is due to a typo in my original reply. I quickly edited it, but the notification mail had already been sent out. The correct command is
How long did you wait after starting the command? I forgot to mention that valgrind slows feh down significantly, as it instruments each and every memory allocation in order to track memory leaks. Especially on large directories or an old raspberry pi, it may take up to a few minutes for the first picture to show. Could you check again whether it works when giving it some time? You don't need to use sudo. |
I left it for just a few minutes, but will let it run overnight and report in the morning. Checking now I see memcheck-arm-li (valgrind) hammering the poor CPU so I'll let it be :) |
Okay, scratch that. valgrind on Raspbian seems to be horribly broken when debugging a program which uses libdl, such as feh. "valgrind /bin/true" and "valgrind /bin/date" work fine even though they spew the same errors, whereas both "valgrind /bin/ls" and "valgrind /usr/bin/feh ..." fail (as in, get stuck at 100%cpu without apparent progress). I'll get back to you once I know how to debug feh on your system (or once I am able to do so myself) |
Appreciate your help on this :/ Yea ~10hrs later, still images don't pop up, and nothing else outputted to the logfile other than the above initial dump. Let me know if you need my help any time. |
feh v3.5 has been crashing on multiple Raspberry Pi 3B+'s about 4 days after being invoked. dmesg reports the same OOM call as sgreadly so it appears that I'm experiencing the same memory leak.
The command I run is:
and exifdate.sh, which extracts the date from EXIF data and formats it:
dmesg:
I've restarted feh and am monitoring the process using top. After 34.5 hours, feh is using 45.5% of memory. When first executed, feh was using ~10% of memory and that value has slowly grown since. I believe this may be related to an issue I'd previously reported here (https://github.com/derf/feh/issues/564). The "Failed to run info command" also occurred about four days after starting feh, which is why I think the two may be related. As an attempt to resolve the command run failure I changed from calling exif directly from the --info option and instead use exiftool called from a script and now I am getting the memory leak crash. I'm happy to help debug this further if needed. p.s. My image source folder contains over 31000 JPG files. |
Alright... Looks like I've found the issue. It's not a memory leak per se, but has pretty much the same effect and is indeed a bug. When feh loads an image (and has been compiled with I did some tests with my personal photo collection and found that feh stores about 50kB of EXIF data per image. For slideshow-delay=10 and 34.5 hours runtime, that gives around 600MB of memory used just for EXIF data, which isn't too far from the numbers you reported. I'll publish a bugfix release which deletes both image and EXIF data from memory when feh switches to a new image. Thank you for the detailed reports. |
Sun, 06 Dec 2020 08:34:15 +0100 Daniel Friesel <derf+feh@finalrewind.org> * Release v3.6.1 * Fix excessive memory consumption when showing long-running slideshows with thousands to tens of thousands of images and feh has been compiled with exif=1 (see derf/feh#553) * Fix memory leak when showing long-running slideshows with relatively few images and feh has been compiled with exif=1 (ibid.) * Fix memory leak when reloading an image and feh has been compiled with exif=1 * Fix memory leak in --draw-exif * Fix memory leak when reloading HTTP files with --no-conversion-cache Mon, 30 Nov 2020 19:44:47 +0100 Daniel Friesel <derf+feh@finalrewind.org> * Release v3.6 * Add flip and rotate options to the menu * Improve unloadable image detection time (e.g. for large video files) by checking a file's header before passing it to Imlib2. For rarely used image formats, there is a very small chance that an image which could be loaded by feh 3.5 is reported as unloadable by feh 3.6 due to this change. Set FEH_SKIP_MAGIC=1 to bypass the header check in this case. See <https://phab.enlightenment.org/T8739> and <derf/feh#505> for details.
Hi all,
I noticed on my Raspberry Pi Zero W every ~week feh was crashing. Turns out feh has signs of a memory leak? OOM kicked in. notice the rss for feh is way higher than any other application running.
The command I run is:
dmesg:
Ta.
The text was updated successfully, but these errors were encountered: