Bug 3821 - autologin does not register session properly with logind resulting in no permissions on devices.
Summary: autologin does not register session properly with logind resulting in no perm...
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: i586 Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Colin Guthrie
QA Contact:
URL:
Whiteboard:
Keywords: NEEDINFO, Triaged
Depends on:
Blocks:
 
Reported: 2011-12-19 22:41 CET by papoteur
Modified: 2012-04-09 15:47 CEST (History)
6 users (show)

See Also:
Source RPM: autologin
CVE:
Status comment:


Attachments
Extract from the dmesg after the webcam connection (shorted) (1.90 KB, text/plain)
2011-12-19 22:43 CET, papoteur
Details
The debugginng command (871 bytes, text/plain)
2011-12-20 21:48 CET, papoteur
Details
gdb results (1.82 KB, text/plain)
2012-02-29 17:55 CET, papoteur
Details
Gdb output after crashing when video device not present (1.53 KB, text/plain)
2012-03-01 21:08 CET, papoteur
Details
Gdb output again and more complete (5.40 KB, text/plain)
2012-03-02 20:38 CET, papoteur
Details
getfacl and udevadm info output. (1.15 KB, text/plain)
2012-03-30 04:08 CEST, Dave Hodgins
Details
getfacl and udevadm info (1.34 KB, text/plain)
2012-04-01 21:33 CEST, papoteur
Details
Results of ck-list-sessions (607 bytes, text/plain)
2012-04-02 21:08 CEST, papoteur
Details
results of getfacl (435 bytes, text/plain)
2012-04-02 21:09 CEST, papoteur
Details

Description papoteur 2011-12-19 22:41:26 CET
Description of problem:
Cheese craashesss when the webcam is connected.
Vendor : Logitech
Model : I don't remember
âVendor: 0x046d
Product: â0x0825
Driver: uvcvideeo
Version-Release number of selected component (if applicable):
uvcvideo: How to get it?

How reproducible:
Connect the Webcaam. Launch Xheese

In Mageia2 Alpha1
Comment 1 papoteur 2011-12-19 22:43:10 CET
Created attachment 1275 [details]
Extract from the dmesg after the webcam connection (shorted)
Thierry Vignaud 2011-12-19 23:19:03 CET

Attachment 1275 mime type: text/x-log => text/plain*

Thierry Vignaud 2011-12-19 23:19:12 CET

Attachment 1275 mime type: text/plain* => text/plain

Comment 2 Thierry Vignaud 2011-12-19 23:23:48 CET
That has nothing to do with the installer.
If cheese is crashing, then:
1) enable the Core debug medium, 
2) install the following packages: glibc-devel, cheese-debug gtk+3.0-debug  gdk-pixbuf2.0-debug  glib2.0-debug v4l-utils-debug gdb
3) run the following command from a terminal "gdb -q cheese"
4) type "run", cheese will start
5) when cheese crashes, type "bt", then copy the stack trace in some text file you will _attach_ to this bug report

CC: (none) => thierry.vignaud
Component: Installer => RPM Packages
Source RPM: (none) => cheese

papoteur 2011-12-20 20:45:56 CET

Summary: Webcam Logitech not workinnnng => Webcam Logitech not working

Comment 3 papoteur 2011-12-20 21:48:22 CET
Created attachment 1278 [details]
The debugginng command
Comment 4 Thierry Vignaud 2011-12-20 22:53:12 CET
err it didn't crashed...
Comment 5 papoteur 2011-12-21 14:09:41 CET
Yes :/
But when I launch it without gdb, I get:
** CRITICAL **: cheese_effect_load_effects_from_directory: assertion `is_dir' failed

** CRITICAL **: cheese_effect_load_effects_from_directory: assertion `is_dir' failed
Erreur de segmentation".
Comment 6 Marja Van Waes 2012-02-11 13:46:07 CET
@ papoteur

Is this bug still valid in current cauldron (mga2a3)?

cc'ing cheese maintainer

Keywords: (none) => NEEDINFO
CC: (none) => marja11, olav

Comment 7 papoteur 2012-02-21 22:19:09 CET
(In reply to comment #6)
> @ papoteur
> 
> Is this bug still valid in current cauldron (mga2a3)?
I have updated to alpha3.
Yet, Cheese can not be launched :

cheese

Clutter-CRITICAL **: Unable to initialize Clutter: The OpenGL version could not be determined


urpmq cheese -i
pas d'information xml pour le média « core media », uniquement un résultat partiel pour le paquetage cheese
Name        : cheese
Version     : 3.3.3
Release     : 1.mga2
Group       : Video
Size        : 4382341                      Architecture: i586
Summary     : A GNOME application for taking pictures and videos from a webcam
Comment 8 Marja Van Waes 2012-02-22 17:48:40 CET
assigning to maintainer

Keywords: NEEDINFO => (none)
Assignee: bugsquad => olav

Comment 9 papoteur 2012-02-28 20:31:58 CET
I retest with Mageia beta2.
When the webcam is not connected, Cheese crashes :
** WARNING **: cheese-window.vala:1624: Error: Aucun périphérique détecté

Erreur de segmentation (core dumped)

(no peripheral detected, segfault)

When the webcam is connected, Cheese start, but does not recognizes the webcam :
** WARNING **: Could not negotiate format

In the same, I get this messages from dmesg :
cheese[2542]: segfault at 484 ip b69a0129 sp bfe3fa30 error 4 in libcogl.so.8.0.0[b696f000+80000]
cheese[2565]: segfault at 484 ip b694d129 sp bfe54d30 error 4 in libcogl.so.8.0.0[b691c000+80000]
usb 5-4: new high-speed USB device number 3 using ehci_hcd
usb 5-4: New USB device found, idVendor=046d, idProduct=0825
usb 5-4: New USB device strings: Mfr=0, Product=0, SerialNumber=2
usb 5-4: SerialNumber: B9B963A0
Linux media interface: v0.10
Linux video capture interface: v2.00
3:3:4: cannot get freq at ep 0x86
5:2: cannot get min/max values for control 2 (id 5)
usbcore: registered new interface driver snd-usb-audio
uvcvideo: Found UVC 1.00 device <unnamed> (046d:0825)
input: UVC Camera (046d:0825) as /devices/pci0000:00/0000:00:1d.7/usb5/5-4/5-4:1.0/input/input4
usbcore: registered new interface driver uvcvideo
USB Video Class driver (1.1.1)
uvcvideo: Failed to query (GET_CUR) UVC control 2 on unit 2: -110 (exp. 2).
uvcvideo: Failed to query (GET_CUR) UVC control 7 on unit 2: -110 (exp. 2).
Yves
Comment 10 Thierry Vignaud 2012-02-29 10:17:50 CET
Can you try to get the GDB backtrace when it's actually segfaulting (ie when the webcam is not connected)?
Thx

Keywords: (none) => NEEDINFO
Summary: Webcam Logitech not working => Webcam Logitech not working & cheese is segfaulting

Comment 11 papoteur 2012-02-29 17:52:56 CET
Here the result from gdb.
Comment 12 papoteur 2012-02-29 17:55:42 CET
Created attachment 1660 [details]
gdb results
Comment 13 Thierry Vignaud 2012-02-29 19:29:14 CET
You need to install latest glibc-debug, gtk+3.0-debug cheese-debug & cogl-debug and try again
Thierry Vignaud 2012-02-29 19:29:20 CET

Attachment 1660 is obsolete: 0 => 1

Thierry Vignaud 2012-02-29 19:29:24 CET

Attachment 1278 is obsolete: 0 => 1

Comment 14 papoteur 2012-02-29 20:30:04 CET
(In reply to comment #13)
> You need to install latest glibc-debug, gtk+3.0-debug cheese-debug & cogl-debug
> and try again

After installing, I get :
** WARNING **: La connexion est fermée

** WARNING **: La connexion est fermée

** WARNING **: cheese-window.vala:1624: Error: Aucun périphérique détecté

[New Thread 0xa51a5b70 (LWP 2001)]

Program received signal SIGSEGV, Segmentation fault.
_cogl_pipeline_copy (src=0x400, is_weak=0) at ./cogl-pipeline.c:370
370	  pipeline->real_blend_enable = src->real_blend_enable;

I'm not sure that the version are the latest.
Yves
Comment 15 Thierry Vignaud 2012-03-01 01:19:01 CET
This looks promising!

Please paste all lines from "Program received signal SIGSEGV, Segmentation fault" in some file.
Then type "bt" and paste the trace printed by gdb into that file too.
Then attach that file here.
thanks
Comment 16 papoteur 2012-03-01 21:08:40 CET
Created attachment 1668 [details]
Gdb output after crashing when video device not present
Comment 17 Thierry Vignaud 2012-03-01 22:41:37 CET
OK it looks like a bug in libcogl then with a pointer in the first page which should not happen.
Can you install cogl-debug & clutter-debug and try again to get the trace?

CC: (none) => fundawang
Assignee: olav => jani.valimaa
Summary: Webcam Logitech not working & cheese is segfaulting => Webcam Logitech not working & cheese is segfaulting in cogl
Source RPM: cheese => cogl

Comment 18 papoteur 2012-03-02 20:38:04 CET
Created attachment 1671 [details]
Gdb output again and more complete

I haven't see that the was more screens as the first.
cogl-debug was already present. The other has been added.
Yves
Comment 19 Marja Van Waes 2012-03-21 06:40:13 CET
Removing NEEDINFO keyword, because requested information has been given

Keywords: NEEDINFO => (none)

Comment 20 papoteur 2012-03-28 16:59:28 CEST
I do new tests with my webcam and Cauldron uptodate.
guvcview does not detect the webcam.
I get :
guvcview 1.5.3
Cannot connect to server socket err = Aucun fichier ou dossier de ce type
Cannot connect to server socket
jack server is not running or cannot be started
video device: /dev/video0 
ERROR opening V4L2 interface for /dev/video0
unable to detect video devices on your system (0)
ERROR opening V4L interface: Permission non accordée
Init video returned -1
VIDIOC_REQBUFS - Failed to delete buffers: Argument invalide (errno 22)
cleaned allocations - 100%
Closing portaudio ...OK
Terminated.

permission non accordée means rights not allowed.
I have added the user to the group video, but the problem is the same.

With cheese, I get a segfault :
** (cheese:4464): CRITICAL **: cheese_camera_device_get_uuid: assertion `CHEESE_IS_CAMERA_DEVICE (device)' failed
Erreur de segmentation

When connecting the webcam, and after launching cheese, dmesg gives:
[   99.177038] usb 2-2: new high-speed USB device number 3 using ehci_hcd
[   99.511712] usb 2-2: New USB device found, idVendor=046d, idProduct=0825
[   99.511724] usb 2-2: New USB device strings: Mfr=0, Product=0, SerialNumber=2
[   99.511734] usb 2-2: SerialNumber: B9B963A0
[  100.297937] Linux media interface: v0.10
[  100.355174] Linux video capture interface: v2.00
[  101.472124] 3:3:2: cannot get freq at ep 0x86
[  101.612682] 5:2: cannot get min/max values for control 2 (id 5)
[  101.613678] usbcore: registered new interface driver snd-usb-audio
[  101.616970] uvcvideo: Found UVC 1.00 device <unnamed> (046d:0825)
[  101.651744] input: UVC Camera (046d:0825) as /devices/pci0000:00/0000:00:10.4/usb2/2-2/2-2:1.0/input/input5
[  101.653218] usbcore: registered new interface driver uvcvideo
[  101.653229] USB Video Class driver (1.1.1)
[  104.047305] cheese[1330]: segfault at 0 ip b6b8d258 sp bfe919fc error 4 in libc-2.14.1.so[b6b19000+177000]
[ 5749.356176] cheese[4464]: segfault at 0 ip b6b55258 sp bfab14dc error 4 in libc-2.14.1.so[b6ae1000+177000]
Comment 21 Thierry Vignaud 2012-03-28 19:24:13 CEST
udev/systemd may not set up appropriate ACLs

CC: (none) => mageia

Comment 22 Colin Guthrie 2012-03-28 20:46:30 CEST
Can you post the output from: "udevadm info -q all -n /dev/video0" and "getfacl /dev/video0"
Comment 23 Dave Hodgins 2012-03-30 04:08:32 CEST
Created attachment 1890 [details]
getfacl and udevadm info output.

I'm having similar problems with my webcam, as reported in bug 5031,
although I haven't seen any segfaults.
Comment 24 Colin Guthrie 2012-03-30 11:00:35 CEST
@Dave. Well it's certainly not a permissions problem in your case. That output all looks good.
Comment 25 Thierry Vignaud 2012-03-30 11:14:22 CEST
Have you tried with final 3.40 version?
Comment 26 papoteur 2012-04-01 21:33:05 CEST
Created attachment 1891 [details]
getfacl and udevadm info

The version is already 3.4.0.
I have setfacl to add the user, and then guvcview works. For cheese, it's OK but very slow.
Yves
Comment 27 Colin Guthrie 2012-04-01 21:37:24 CEST
(In reply to comment #26)
> Created attachment 1891 [details]
> getfacl and udevadm info
> 
> The version is already 3.4.0.
> I have setfacl to add the user, and then guvcview works. For cheese, it's OK
> but very slow.


OK, so your user is not in the ACL, but the device is clearly labelled as having the uaccess tag.

So this tells me something is messed up below this. However you should be having many more problems than just this (e.g. your audio should not work either).

Can you also check:

1. getfacl /dev/snd/pcm*
2. ck-list-sessions
3. systemd-loginctl (or loginctl if using latest systemd just uploaded a short while ago)

Cheers
Comment 28 papoteur 2012-04-02 21:08:29 CEST
Created attachment 1907 [details]
Results of ck-list-sessions
Comment 29 papoteur 2012-04-02 21:09:23 CEST
Created attachment 1908 [details]
results of getfacl
Comment 30 Colin Guthrie 2012-04-02 21:25:10 CEST
Indeed your user is not in the ACL for your audio devices either, so your audio is likely broken too (unless you've added your user to the audio group as a hack?).

Either way something is not working right.

Can you also the final thing requested in my comment above (point 3)?
Comment 31 papoteur 2012-04-03 22:22:25 CEST
In pulseaudio, the output is dummy (sortie factice). This confirm that the sound is not working.
Yesterday, when I try the command system-loginctl, I got "0 sessions listed".
But today, after an update, I must use the command loginctl.
I get :
   SESSION        UID USER             SEAT            
         1        500 yves                             

1 sessions listed.
Comment 32 Colin Guthrie 2012-04-03 23:06:36 CEST
Does this now help in terms of permissions (i.e. now that you have your session listed, do all the permission problems go away - is your user in the ACLs etc. etc.?)
Comment 33 papoteur 2012-04-05 08:20:10 CEST
No.
getfacl /dev/video0 
getfacl : suppression du premier « / » des noms de chemins absolus
# file: dev/video0
# owner: root
# group: video
user::rw-
group::rw-
other::---
Comment 34 Colin Guthrie 2012-04-05 11:40:40 CEST
OK, so some more debug:

loginctl session-status 1 (or whatever value is listed from loginctl)


Can you also describe your setup a bit?

e.g. how do you start X? Which login manager do you use? If you use e.g. slim or lxdm etc., can you try using gdm or kdm and see if you get the same results, especially fro the getfacl command).

I'm pretty certainly this is nothing to do with cheese and 100% to do with how your X session is started.
Comment 35 papoteur 2012-04-06 09:59:00 CEST
Today, there is no session listed.
My display manager is xdm. lxdm is also installed but not used.
The connection is automatic at boot.
I will try lxdm.
Thierry Vignaud 2012-04-06 10:13:04 CEST

Summary: Webcam Logitech not working & cheese is segfaulting in cogl => Webcam Logitech not working & cheese is segfaulting in cogl (bad perms b/c of lack of session management in xdm)

Comment 36 papoteur 2012-04-06 10:33:41 CEST
Both with lxde and xdm, loginctl give no sessions when I have an automatic connection.
I get 1 sessions when I connect no automatically.
Should I really test  with kdm or gdm? They are not yet installed.
Comment 37 papoteur 2012-04-06 10:39:39 CEST
With the manual connection, I get the good ACLs :)
getfacl /dev/video0
getfacl : suppression du premier « / » des noms de chemins absolus
# file: dev/video0
# owner: root
# group: video
user::rw-
user:yves:rw-
group::rw-
mask::rw-
other::---
Comment 38 Colin Guthrie 2012-04-06 11:52:55 CEST
Ahh yes, autologin tends to break things :s

Can you tell me how you configure autologin? Different DMs sometimes implement their own, but we also have a generic autologin system too. Do you know which is in use in your case? How do you configure autologin?
Comment 39 papoteur 2012-04-06 12:31:40 CEST
hello Colin,
I use only the tools from MCC. Thus, I do not know which application configures the autologin.
Comment 40 Colin Guthrie 2012-04-06 12:40:18 CEST
OK, I'll see if I can reproduce. I think I know where the problem is.
Colin Guthrie 2012-04-06 16:26:53 CEST

Assignee: jani.valimaa => mageia
Summary: Webcam Logitech not working & cheese is segfaulting in cogl (bad perms b/c of lack of session management in xdm) => autologin does not register session properly with logind resulting in no permissions on devices.
Source RPM: cogl => autologin

Comment 41 Colin Guthrie 2012-04-06 16:36:31 CEST
OK, so there are several problems here.

Firstly autologin source used tty0 when speaking to PAM for it's login session but this is not valid (login sessions should start from tty1). This meant that no session was ever registered as logind simply rejected it.


In addition to this, when X was subsequently started, it switched VT to 7 which corresponds to vt7 which meant that the original session registered was considered no longer active.

I've worked around this by forcing both the login session used in autologin and the X to start on tty1/vt1

This seems to work in my testing.

It should be noted that this is somewhat fragile, but the way in which autologin works is pretty broken. It start X, get allocated an X display and a vt and then use this when talking to pam when creating a session for the user.

So for mga3 autologin should be dropped in favour of an alternative (e.g. gdm's autologin capabilities) or completely rewritten.

Please let me know if this updated package works for you.

Status: NEW => ASSIGNED

Colin Guthrie 2012-04-06 16:36:43 CEST

Keywords: (none) => NEEDINFO, Triaged

Comment 42 Thierry Vignaud 2012-04-06 16:42:29 CEST
autologin is for dms other than gdm or kdm that handles that fine.
until xdm/lxdm/... do not handle autologin, we've to do it
Comment 43 Colin Guthrie 2012-04-06 17:27:59 CEST
AFAICT, it still kicks in when configured even if used under gdm or kdm, so maybe the prefdm script needs looked at (it is entirely possible that it was me who broke this during an old prefdm refactor, but if so, it was a looong time ago).
Comment 44 papoteur 2012-04-07 11:16:24 CEST
After an update this morning, the ACL's are OK, even with autologin.
Thanks
Yves
Comment 45 Colin Guthrie 2012-04-07 12:30:54 CEST
So just to confirm, is there still a problem with the camera stuff or was it all down to the ACLs?
Comment 46 Dave Hodgins 2012-04-07 20:37:44 CEST
With my logitech quickcam messenger, which uses the gspca_stv06xx module,
cheese still gets the "failed to negotiate format" error, and does not
have a permission problem.

CC: (none) => davidwhodgins

Comment 47 papoteur 2012-04-09 10:26:46 CEST
The webcam works fine with guvcview.
Cheese works, but takes a long time to be launched (2 minutes).

Yves
Comment 48 Colin Guthrie 2012-04-09 12:18:00 CEST
While I know this bug was originally opened against cheese, it's gone through the spin cycle to get to where it is now!

It might be clearer if you open a new bug for the delay in startup with cheese just so the maintainer can clearly see the problem rather than wading through 50 comments? (tho' FWIW, I cannot reproduce). 

If that's OK with you can you open the new bug, paste a reference here and close this one?
Comment 49 papoteur 2012-04-09 15:47:54 CEST
Ok

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


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