0.98.1 Linux: Memory leak resulting in out of memory kill while loading animated gif image

*** Please report new bugs here! ***

Moderators: XnTriq, helmut, xnview, Dreamer

Post Reply
User avatar
juozas
Posts: 35
Joined: Sun Sep 27, 2009 11:42 am
Location: Lithuania
Contact:

0.98.1 Linux: Memory leak resulting in out of memory kill while loading animated gif image

Post by juozas »

Subject: 0.98.1 Linux: Memory leak resulting in out of memory kill while loading animated gif image

XnView: MP 0.98.1 - 64 bit
OS: Ubuntu Linux 20.04 LTS 64bit

Trying to open an animated gif image found on imgur triggers a memory leak some times resulting in the process being killed by the system OOM killer. The affected image is hosted on imgur, linked at https://i.imgur.com/gXHmu.gif. The information of the image provided by exiftool is listed below, program execution log right after that.

Code: Select all

ExifTool Version Number         : 11.88
File Name                       : gXHmu.gif
Directory                       : .
File Size                       : 1923 kB
File Modification Date/Time     : 2021:02:11 11:07:25+02:00
File Access Date/Time           : 2021:02:11 11:07:27+02:00
File Inode Change Date/Time     : 2021:02:11 11:07:25+02:00
File Permissions                : rw-rw-r--
File Type                       : GIF
File Type Extension             : gif
MIME Type                       : image/gif
GIF Version                     : 89a
Image Width                     : 1920
Image Height                    : 1080
Has Color Map                   : Yes
Color Resolution Depth          : 8
Bits Per Pixel                  : 8
Background Color                : 0
Animation Iterations            : Infinite
Comment                         : Title:..capture-2
Frame Count                     : 393
Duration                        : 26.53 s
Image Size                      : 1920x1080
Megapixels                      : 2.1

Code: Select all

$ xnview gXHmu.gif 
==> 1,000000  216,799583  96,000000  (0)
XNVIEW restoreGeometry before : 640 480 
XNVIEW restoreGeometry after : 1366 719 
w.init
w.start
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
QObject::connect: No such slot AbstractViewWindow::onPagePrevious()
##PB connect <1onPagePrevious()>
QObject::connect: No such slot AbstractViewWindow::onPageNext()
##PB connect <1onPageNext()>
QObject::connect: No such slot AbstractViewWindow::onPageFirst()
##PB connect <1onPageFirst()>
QObject::connect: No such slot AbstractViewWindow::onPageLast()
##PB connect <1onPageLast()>
QObject::connect: No such slot AbstractViewWindow::onUseSmooth()
##PB connect <1onUseSmooth()>
QObject::connect: No such slot AbstractViewWindow::onNormalize2()
##PB connect <1onNormalize2()>
QObject::connect: No such slot AbstractViewWindow::onAlign()
##PB connect <1onAlign()>
MENU install : 0x329a6c0 
QCssParser::parseColorValue: Specified color without alpha value but alpha given: 'rgb 255, 255, 255, 127'
QCssParser::parseColorValue: Specified color without alpha value but alpha given: 'rgb 0, 0, 0, 255'
@@@@@@@@@@
Create window finished
==> 1366 
ThumbLoaderThread :: stop()
MyView::change /home/juozas/Darbastalis/gXHmu.gif 
## Bitmap :: load 0 
###### LOAD BITMAP </home/juozas/Darbastalis/gXHmu.gif>
Killed
Effect: Program is killed by the OOM killer provided by OS.

To reproduce:
1. Download https://i.imgur.com/gXHmu.gif (it works fine when viewing in browser, no signs of corruption at all)
2. Try to open it in XnView
3. Observe memory leak and program being killed as long as there's no free memory left to the system at all.
Actual behaviour (bug): Memory leak; Might be killed by OOM killer if there's no free memory left :bug:

Expected behaviour: No memory leak, image loads fine.
Сделано в СССР
User avatar
juozas
Posts: 35
Joined: Sun Sep 27, 2009 11:42 am
Location: Lithuania
Contact:

Re: 0.98.1 Linux: Memory leak resulting in out of memory kill while loading animated gif image

Post by juozas »

Program log under debugger, also killed by OOM killer, only other programs open was the browser and terminal running gdb.

Code: Select all

Starting program: /opt/XnView/XnView gXHmu.gif
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffe6207700 (LWP 3760)]
[New Thread 0x7fffdffff700 (LWP 3761)]
[New Thread 0x7fffdf7fe700 (LWP 3762)]
==> 1,000000  216,799583  96,000000  (0)
[Detaching after vfork from child process 3763]
XNVIEW restoreGeometry before : 640 480 
XNVIEW restoreGeometry after : 1366 719 
[New Thread 0x7fffde08b700 (LWP 3765)]
w.init
w.start
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
QObject::connect: No such slot AbstractViewWindow::onPagePrevious()
##PB connect <1onPagePrevious()>
QObject::connect: No such slot AbstractViewWindow::onPageNext()
##PB connect <1onPageNext()>
QObject::connect: No such slot AbstractViewWindow::onPageFirst()
##PB connect <1onPageFirst()>
QObject::connect: No such slot AbstractViewWindow::onPageLast()
##PB connect <1onPageLast()>
QObject::connect: No such slot AbstractViewWindow::onUseSmooth()
##PB connect <1onUseSmooth()>
QObject::connect: No such slot AbstractViewWindow::onNormalize2()
##PB connect <1onNormalize2()>
QObject::connect: No such slot AbstractViewWindow::onAlign()
##PB connect <1onAlign()>
MENU install : 0x1be6520 
QCssParser::parseColorValue: Specified color without alpha value but alpha given: 'rgb 255, 255, 255, 127'
QCssParser::parseColorValue: Specified color without alpha value but alpha given: 'rgb 0, 0, 0, 255'
@@@@@@@@@@
Create window finished
==> 1366 
ThumbLoaderThread :: stop()
MyView::change /home/juozas/Darbastalis/gXHmu.gif 
## Bitmap :: load 0 
###### LOAD BITMAP </home/juozas/Darbastalis/gXHmu.gif>
[Thread 0x7fffde08b700 (LWP 3765) exited]
[Thread 0x7fffdf7fe700 (LWP 3762) exited]
[Thread 0x7fffdffff700 (LWP 3761) exited]
[Thread 0x7fffe6207700 (LWP 3760) exited]

Program terminated with signal SIGKILL, Killed.
The program no longer exists.
Сделано в СССР
User avatar
xnview
Author of XnView
Posts: 43326
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: 0.98.1 Linux: Memory leak resulting in out of memory kill while loading animated gif image

Post by xnview »

seems to be a low memory problem not leak, you need 3Gb to load this GIF
Pierre.
User avatar
juozas
Posts: 35
Joined: Sun Sep 27, 2009 11:42 am
Location: Lithuania
Contact:

Re: 0.98.1 Linux: Memory leak resulting in out of memory kill while loading animated gif image

Post by juozas »

The image loads fine in firefox and it doesn't use 3 GB of memory when this image loads. Xnview should not use this much if possible too. Chrome & Chromium doesn't use much memory too (also while firefox is running in background).
Сделано в СССР
User avatar
xnview
Author of XnView
Posts: 43326
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: 0.98.1 Linux: Memory leak resulting in out of memory kill while loading animated gif image

Post by xnview »

in XnView, all frames are loaded in RGBA
Pierre.
Post Reply