Bug 21544 - If camera is disconnected, /home gets out of space! (xorg-session.log grow quickly)
Summary: If camera is disconnected, /home gets out of space! (xorg-session.log grow qu...
Status: RESOLVED WONTFIX
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 6
Hardware: All Linux
Priority: Normal major
Target Milestone: ---
Assignee: QA Team
QA Contact:
URL:
Whiteboard: mga6-64-ok advisory
Keywords: UPSTREAM, validated_update
Depends on:
Blocks:
 
Reported: 2017-08-16 18:08 CEST by Morgan Leijström
Modified: 2020-06-09 08:54 CEST (History)
6 users (show)

See Also:
Source RPM: guvcview-2.0.5-4.mga6.src.rpm
CVE:
Status comment:


Attachments

Description Morgan Leijström 2017-08-16 18:08:16 CEST
Description of problem:
/home fills up if used USB camera is pulled from the connector while in use, because V4L2_CORE quickly fills xorg-session.log

Steps to Reproduce:
Prerequisites: I use current Mageia 6, 64 bit, Plasma, sddm
0. (to see the result) Open a terminal and issue 
  less ~/.local/share/sddm/xorg-session.log
1. attach an USB camera
2. launch guvcview i.e by pressing Alt+F2 and entering guvcview *)
3. detach camera
4. see *many* lines per second of:
  V4L2_CORE: (VIDIOC_DQBUF) Unable to dequeue buffer: Enheten finns inte
is output in ~/.local/share/sddm/xorg-session.log
"Enheten finns inte" (swedish) = "The device does not exist"

*) If guvcview is instead started from konsole, the output is in konsole, not in xorg-session.log


Version-Release number of selected component (if applicable):
Probably also depending on kernel and much else: guvcview itself reports when started in konsole, and closing it while the error is output, last lines in konsole:
V4L2_CORE: (VIDIOC_DQBUF) Unable to dequeue buffer: Enheten finns inte
V4L2_CORE: (VIDIOC_STREAMOFF) Unable to stop stream: Enheten finns inte
V4L2_CORE: (VIDIOC_STREAMOFF) Unable to stop stream: Enheten finns inte
V4L2_CORE: (VIDIOC_REQBUFS) Failed to delete buffers: Enhet eller resurs upptagen (errno 16)
V4L2_CORE: failed to unsubscribe events: Enheten finns inte
OpenGL vendor string:                   NVIDIA Corporation
OpenGL renderer string:                 GeForce GTX 750/PCIe/SSE2
OpenGL version string:                  4.5.0 NVIDIA 375.66
OpenGL shading language version string: 4.50 NVIDIA
Driver:                                 NVIDIA
Driver version:                         375.66
GPU class:                              Unknown
OpenGL version:                         4.5
GLSL version:                           4.50
Linux kernel version:                   4.9.40
Requires strict binding:                no
GLSL shaders:                           yes
Texture NPOT support:                   yes
Virtual Machine:                        no
GUVCVIEW: version 2.0.5


How reproducible: Easily every time per above.

Note: Luvcview do not have this problem; it exits immediately when camera is detached.  (works similarly but I prefer guvcview as it have nicer controls)

I set bug to critical as user may loose work as it may be impossible to save files as partition is full, and desktop may misbehave.  I expereinced both, and not even deleting the massive file made Plasma happy (strangely df still reported only a few bytes free in use) - i had to reboot to get the free space.
It did work to free some megabytes by emptying trashcan so i managed to save my work before reboot.
Comment 1 Marja Van Waes 2017-08-17 19:23:00 CEST
Assigning to the registered maintainer of guvcview.

CC: (none) => marja11
Assignee: bugsquad => eatdirt

Comment 2 Chris Denice 2017-08-17 22:34:28 CEST
I'll have a look. Does it happen with another Display Manager, different from sddm? Try with xdm for instance.

The fact that guvcview does not stop when you hardcut the camera is something, but the unlimited log size is a bug in itself. So it would be interesting to test if this is not another sddm bug.

Thanks,
Cheers.
Comment 3 Morgan Leijström 2017-08-17 22:45:00 CEST
Did not think of that, but yes there really ought to be some log limiting mechanism. I guess we should file bug on that separately.
Logging - regardless of cause, should not eat gigabytes and cause users session to lock up!

I am very busy coming days but if i do not test other DM within a week, ping this bug.
Comment 4 Morgan Leijström 2017-08-23 21:39:15 CEST
Tested with LightDM: All the same, except the massive file is ~.xsession-errors

In earlier tests i had BOINC consuming nearly 100% of all my i7 cores. Now i stopped it, and see this bug now eat almost 50% of my i7 capacity while creating that massive log, at a rate of something like a gigabyte per minute.
Comment 5 Stig-Ørjan Smelror 2017-08-23 22:26:58 CEST
Morgan,

do you see anything interesting if you run it through strace?

That's what I do when looking for "something" out of the ordinary.

Cheers,
Stig

CC: (none) => smelror

Comment 6 Morgan Leijström 2017-08-24 18:21:03 CEST
Uh... yes most of what it outputs is strange to *me* ;)
As the bug is easily to reproduce i leave it to someone else
Comment 7 Chris Denice 2017-08-24 23:12:12 CEST
I have uploaded a patched/updated package for Mageia 6 in updates_testing which reduces the verbosity when one unplug the camera.

You can test by starting guvcview, watching the stream, and unplugging the camera. In a terminal, the logs should not grow indefinitely as before.

Suggested advisory:
========================

Updated guvcview packages to fix unbounded logs output when the camera is brute-forcedly unplugged.

Updated packages in {core,tainted}/updates_testing:
========================

guvcview-2.0.5-4.1.mga6
lib64gviewaudio2.0_2-2.0.5-4.1.mga6
lib64gviewaudio2.0-devel-2.0.5-4.1.mga6
lib64gviewencoder2.0_2-2.0.5-4.1.mga6
lib64gviewencoder2.0-devel-2.0.5-4.1.mga6
lib64gviewrender2.0_2-2.0.5-4.1.mga6
lib64gviewrender2.0-devel-2.0.5-4.1.mga6
lib64gviewv4l2core2.0_2-2.0.5-4.1.mga6
lib64gviewv4l2core2.0-devel-2.0.5-4.1.mga6
libgviewv4l2core-i18n-2.0.5-4.1.mga6

Source RPMs: 
guvcview-2.0.5-4.1.mga6
Chris Denice 2017-08-24 23:12:34 CEST

Assignee: eatdirt => qa-bugs
CC: (none) => eatdirt

Comment 8 Chris Denice 2017-08-25 09:03:42 CEST
Bug reported upstream as well.
Comment 9 Morgan Leijström 2017-08-25 11:46:56 CEST
Thanks Chris

Your fix solves the critical problem of log filling up /home :)

I see that the log line
 V4L2_CORE: (UVCIOC_CTRL_MAP) Error: Filen eller katalogen finns inte
is now not logged at all when camera is pulled (no line at all actually in xsession log), and instead only output when guvcview after that is closed by user.

Please share a link to upstream bug.

---

There really should be a size and/or rate limit on x session log - for all DM.  Is the logging the responsibility of the DM or is it X that we should wish had a throttle on logging?

Whiteboard: (none) => mga6-64-ok
Keywords: (none) => UPSTREAM

Comment 10 Lewis Smith 2017-08-25 21:45:45 CEST
Thanks Morgan for testing this update for a serious fault.
Advisory uploaded. Validating as the update is for M6 only.

CC: (none) => lewyssmith, sysadmin-bugs
Keywords: (none) => validated_update
Whiteboard: mga6-64-ok => mga6-64-ok advisory

Comment 11 Mageia Robot 2017-08-25 22:36:38 CEST
An update for this issue has been pushed to the Mageia Updates repository.

http://advisories.mageia.org/MGAA-2017-0067.html

Status: NEW => RESOLVED
Resolution: (none) => FIXED

Comment 12 Chris Denice 2017-08-26 10:24:48 CEST
Here you go:

https://sourceforge.net/p/guvcview/tickets/39/

I have just lower the verbosity to solve the bug, but guvcview would need to gracefully exit I think, hope they'll fix that in the next version!

Thanks guys.
Comment 13 jack wisdon 2020-06-06 18:52:42 CEST Comment hidden (spam)

CC: (none) => ovilewade9

Comment 14 Morgan Leijström 2020-06-06 21:41:22 CEST
Nothing have happened upstream since aug 2017...

Severity: critical => major

Comment 15 Chris Denice 2020-06-08 21:20:55 CEST
Yep. Well, don't disconnect the camera then :)

Resolution: FIXED => WONTFIX

Comment 16 Morgan Leijström 2020-06-08 21:29:34 CEST
It is a recording camera.
It is convenient to leave it connected for charging, and of course remove later.
Comment 17 Chris Denice 2020-06-08 21:44:13 CEST
Ok then, close guvcview before disconnecting the camera :)

Seriously, what do you want me to do, harass the developer for non-
fixing the log counter? :)

PS: If you're using it as a surveillance camera, have a look to "motion", it is actually quite good.
Comment 18 Morgan Leijström 2020-06-09 08:54:18 CEST
Oh, i dont mean hunting yo Chruis, you have done what can be done in Mageia, i think.

I just wanted to add info.  If someone search bugzilla on this they find the status; must remember to close guvcview, or use an alternative to it.

And yes this is on upstream guvcview.

:)

Note You need to log in before you can comment on or make changes to this bug.