xnview.sh infinitely eats memory (fixed xnview.sh included)
Posted: Sun Dec 12, 2010 5:48 am
I have tried 0.32 version of XnViewMP (for Linux) but when I tried to run it, it started to infinitely "eat" memory and CPU. This happened because of this part in xnview.sh:
To reproduce the problem create a symbolic link to xnview.sh like this: Try to run /usr/local/bin/xnview and xnview.sh will call itself infinitely. If you give different name to the symlink or extract XnViewMP package to a directory with space(s) (like "XnViewMP 0.32") xnview.sh will fail too because it can't handle spaces and can't resolve symlinks. To solve these problems, I edited xnview.sh and now it looks like this:
This version of xnview.sh fixes all bugs in the original xnview.sh.
Of course I give you permission to use the fixed version of xnview.sh for any purpose (I hope you include it in next version of XnViewMP
).
Thank you very much for making XnViewMP and supporting Linux. You did wonderful work!
Code: Select all
dirname=`dirname $0`
Code: Select all
ln -s "`pwd`"/xnview.sh /usr/local/bin/xnview
Code: Select all
#!/bin/sh
dirname="$(dirname "$(readlink "$0")")"
export LD_LIBRARY_PATH="$dirname"/lib
export QT_PLUGIN_PATH="$dirname"/lib
"$dirname"/xnview "$@"
Of course I give you permission to use the fixed version of xnview.sh for any purpose (I hope you include it in next version of XnViewMP

Thank you very much for making XnViewMP and supporting Linux. You did wonderful work!