1.9.3 (and all before): Excessive amount of irrelevant data to stdout makes huge log file and creates various problems
Posted: Thu Aug 21, 2025 6:11 pm
XnView: MP 1.9.3 64-bit (Linux) - Libformat 7.226
(Installed with the .deb package)
OS: Ubuntu Linux 22.04.5 LTS (64bit)
Note: Affects all previous versions of XnView
Description:
XnView writes an excessive amount of irrelevant data to the `stdout` and thus automatically to the `$HOME/.xsession-errors` file (or in similar files that collect the `stdout` and `stderr`, such as `run.log` in LXDE, depending on the desktop system used). Instead, X client programs should write to `stdout` or `stderr` only relevant error messages or user-requested debugging or other levels of information, which is the way X clients are expected to behave. In a XnView session that lasts more than just a few minutes, if the user browse through many directories containing more than one thousand files each, XnView will generate an unmanageable amount of details of every single user input and every single read that XnView performs, as if it were permanently in a full debugging mode.
This creates a series of problems in the user's Linux system, which in some cases may be serious, especially when the session with XnView lasts several hours and most critical if the Linux system is left on for long time, (e.g. by suspending/hibernating the computer).
Some of the problems:
- Huge `.xsession-errors` (or equivalent log) file that can easily grow beyond tens of GB just with XnView trivial data (not errors).
- Equally huge amount of unnecessary writes to hard drive or SSD, that worns them out, and slow the system.
- Hijacks the `.xsession-errors` (or equivalent file) by filling it useless details and making the file nearly useless for troubleshooting errors of any other X client programs.
- Security breach: Leaking all the details to a written record of all the full path files and directories and actions performed by the user without their knowledge, which defeats any efforts of protecting user's privacy. For example, it is perfectly possible to get a full list of files, how many times any of them was accessed, copied, deleted, etc..
To reproduce:
Pre-requisites: A linux system with XnView installed, and availability of several directories (the more, the better to reproduce), with at least 2000 image files each (more is better for this experiment). You must use the originally installed launcher (XnView.desktop). If you have made any script or modifications to the launcher that makes any redirections of `stdout` or `stderr`, this demonstration will not work.
1. In the Linux system, rename (or as preferred, move, or delete) the `$HOME/.xsession-errors` (or equivalent) file.
2. Run XnView by double-clicking its original launcher icon.
3. Browse to any of the directories with big amount of pictures, and perform several operations on it, such as viewing many files full screen, select portions of the image and Save as..., copy and paste several files somewhere (e.g. in /tmp), make batch operations, etc.
4. Change directory to any of the other directories, and repeat the activities mentioned in (3).
5. Repeat steps (3) and (4) for at the very least 15 minutes. If you can extend the usage of XnView at this point for much longer, the results will be more impressive.
6. Close XnView, and review the size and the contents of `$HOME/.xsession-errors` file (or equivalent), The bigger the directories and the more you changed between directories, the file will be considerably bigger.
Actual behavior (bug):
The amount of data written to the `stdout` and thus automatically to the `.session-errors` (or equivalent) file by XnView is huge and entirely useless, even if someone would be doing some debugging: Most likely, there are no error messages, and if there would be, it would be hidden by tens of thousands of just trivial and repetitive output of every single mouse input by the user and countless repetitions all the filenames with their full path, that are present in all accessed directories. None of those are errors, thus they don't even belong to that file. In a ~12 minutes session, my `.xsession-errors` file was entirely filled with XnView output (not a single error): 91548 lines, which means almost 100000 read-writes to my old home hard drive, not justified. In sessions of several hours, I can see this file to grow beyond 10GB only from XnView, which means millions and millions of disk I/O without any justification, and a file which is absolutely unmanageable even by VIM.
Expected behavior:
In such a session, XnView should have only written any errors produced by the program, and in any case it should not include any other information that was not explicitly requested by the user with e.g. debugging, info, or warning levels flags. In this case, the `.xsession-errors` (or equivalent log) file should have almost no information from XnView, other than perhaps a few lines of very basic startup message.
Why this is not a "linux bug"
The `.xsession-errors` is a feature that Linux offers to applications developers, to be used wisely as a debugging log. The Xsession writes standard output and standard error to that file for all X clients, and that is how Linux is designed. In other Linux desktops, the mechanism may use a differently named log file (e.g. "run.log" in LXDE), but the issue is identical. This log file is expected to be used in the correct way, but that is the entire responsibility of the developers whom write X programs for Linux, to decide what they write to stdout/stderr and thus to the `.xsession-errors` (or equivalent) file. That obviously isn't users responsibility. If all hundreds of X programs in any Linux system would write everything to `stdout` all the time, it would be impossible to run such a machine for longer, and the hard drives or SSDs would be worned out faster than expected, plus the entire system would get slowed down by so many drive I/O activities. Therefore, users should report any misbehaving program to its developers.
(Installed with the .deb package)
OS: Ubuntu Linux 22.04.5 LTS (64bit)
Note: Affects all previous versions of XnView
Description:
XnView writes an excessive amount of irrelevant data to the `stdout` and thus automatically to the `$HOME/.xsession-errors` file (or in similar files that collect the `stdout` and `stderr`, such as `run.log` in LXDE, depending on the desktop system used). Instead, X client programs should write to `stdout` or `stderr` only relevant error messages or user-requested debugging or other levels of information, which is the way X clients are expected to behave. In a XnView session that lasts more than just a few minutes, if the user browse through many directories containing more than one thousand files each, XnView will generate an unmanageable amount of details of every single user input and every single read that XnView performs, as if it were permanently in a full debugging mode.
This creates a series of problems in the user's Linux system, which in some cases may be serious, especially when the session with XnView lasts several hours and most critical if the Linux system is left on for long time, (e.g. by suspending/hibernating the computer).
Some of the problems:
- Huge `.xsession-errors` (or equivalent log) file that can easily grow beyond tens of GB just with XnView trivial data (not errors).
- Equally huge amount of unnecessary writes to hard drive or SSD, that worns them out, and slow the system.
- Hijacks the `.xsession-errors` (or equivalent file) by filling it useless details and making the file nearly useless for troubleshooting errors of any other X client programs.
- Security breach: Leaking all the details to a written record of all the full path files and directories and actions performed by the user without their knowledge, which defeats any efforts of protecting user's privacy. For example, it is perfectly possible to get a full list of files, how many times any of them was accessed, copied, deleted, etc..
To reproduce:
Pre-requisites: A linux system with XnView installed, and availability of several directories (the more, the better to reproduce), with at least 2000 image files each (more is better for this experiment). You must use the originally installed launcher (XnView.desktop). If you have made any script or modifications to the launcher that makes any redirections of `stdout` or `stderr`, this demonstration will not work.
1. In the Linux system, rename (or as preferred, move, or delete) the `$HOME/.xsession-errors` (or equivalent) file.
2. Run XnView by double-clicking its original launcher icon.
3. Browse to any of the directories with big amount of pictures, and perform several operations on it, such as viewing many files full screen, select portions of the image and Save as..., copy and paste several files somewhere (e.g. in /tmp), make batch operations, etc.
4. Change directory to any of the other directories, and repeat the activities mentioned in (3).
5. Repeat steps (3) and (4) for at the very least 15 minutes. If you can extend the usage of XnView at this point for much longer, the results will be more impressive.
6. Close XnView, and review the size and the contents of `$HOME/.xsession-errors` file (or equivalent), The bigger the directories and the more you changed between directories, the file will be considerably bigger.
Actual behavior (bug):
The amount of data written to the `stdout` and thus automatically to the `.session-errors` (or equivalent) file by XnView is huge and entirely useless, even if someone would be doing some debugging: Most likely, there are no error messages, and if there would be, it would be hidden by tens of thousands of just trivial and repetitive output of every single mouse input by the user and countless repetitions all the filenames with their full path, that are present in all accessed directories. None of those are errors, thus they don't even belong to that file. In a ~12 minutes session, my `.xsession-errors` file was entirely filled with XnView output (not a single error): 91548 lines, which means almost 100000 read-writes to my old home hard drive, not justified. In sessions of several hours, I can see this file to grow beyond 10GB only from XnView, which means millions and millions of disk I/O without any justification, and a file which is absolutely unmanageable even by VIM.
Expected behavior:
In such a session, XnView should have only written any errors produced by the program, and in any case it should not include any other information that was not explicitly requested by the user with e.g. debugging, info, or warning levels flags. In this case, the `.xsession-errors` (or equivalent log) file should have almost no information from XnView, other than perhaps a few lines of very basic startup message.
Why this is not a "linux bug"
The `.xsession-errors` is a feature that Linux offers to applications developers, to be used wisely as a debugging log. The Xsession writes standard output and standard error to that file for all X clients, and that is how Linux is designed. In other Linux desktops, the mechanism may use a differently named log file (e.g. "run.log" in LXDE), but the issue is identical. This log file is expected to be used in the correct way, but that is the entire responsibility of the developers whom write X programs for Linux, to decide what they write to stdout/stderr and thus to the `.xsession-errors` (or equivalent) file. That obviously isn't users responsibility. If all hundreds of X programs in any Linux system would write everything to `stdout` all the time, it would be impossible to run such a machine for longer, and the hard drives or SSDs would be worned out faster than expected, plus the entire system would get slowed down by so many drive I/O activities. Therefore, users should report any misbehaving program to its developers.