Closed Bug 559837 Opened 16 years ago Closed 9 years ago

Fennec aborts when MIT-SHM fails because of insufficient permissions rather than falling back on non-SHM path

Categories

(Core :: Graphics, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: romaxa, Unassigned)

References

Details

Attachments

(2 files)

No description provided.
This is breaking gfxSharedImageSurface working properly... XError: X_ShmAttach: BadAccess (attempt to access private resource denied); 3 requests ago; id=0x40000c Re-running with MOZ_X_SYNC=1 in the environment may give a more helpful backtrace. xulrunner-bin: ../../src/xcb_io.c:176: process_responses: Assertion `!(req && current_request && !(((long) (req->sequence) - (long) (current_request)) <= 0))' failed. permissions must be 0666, otherwise it does not work.
Blocks: 556971
Attached file crash backtrace —
Attached file test shm —
simple test to see what permissions are acceptable. On my ubuntu desktop, i see: Creating shm with permission 0 shmget return 5341200 shm returned ffffffff X error: resource ID = 00000017 serial = 10 error_code = 10 request_code = 141 minor_code = 1 *** Error Message: 'BadAccess (attempt to access private resource denied)' Attach returned 1 Everything looked okay Creating shm with permission 200 shmget return 5373968 shm returned ffffffff X error: resource ID = 00000017 serial = 10 error_code = 10 request_code = 141 minor_code = 1 *** Error Message: 'BadAccess (attempt to access private resource denied)' Attach returned 1 Everything looked okay Creating shm with permission 400 shmget return 5406736 shm returned ffffffff X error: resource ID = 00000017 serial = 10 error_code = 10 request_code = 141 minor_code = 1 *** Error Message: 'BadAccess (attempt to access private resource denied)' Attach returned 1 Everything looked okay Creating shm with permission 600 shmget return 5439504 shm returned b772d000 Attach returned 1 Everything looked okay Creating shm with permission 700 shmget return 5472273 shm returned b772d000 Attach returned 1 Everything looked okay Creating shm with permission 660 shmget return 5505046 shm returned b772d000 Attach returned 1 Everything looked okay Creating shm with permission 666 shmget return 5537815 shm returned b772d000 Attach returned 1 Everything looked okay Oleg, can you run this on your system?
Attachment #439552 - Attachment mime type: application/octet-stream → text/plain
./test_shm Creating shm with permission 0 shmget return 380174523 shm returned ffffffff X error: resource ID = 00000017 serial = 10 error_code = 10 request_code = 142 minor_code = 1 *** Error Message: 'BadAccess (attempt to access private resource denied)' Attach returned 1 Everything looked okay Creating shm with permission 200 shmget return 380207291 shm returned ffffffff X error: resource ID = 00000017 serial = 10 error_code = 10 request_code = 142 minor_code = 1 *** Error Message: 'BadAccess (attempt to access private resource denied)' Attach returned 1 Everything looked okay Creating shm with permission 400 shmget return 380240059 shm returned ffffffff X error: resource ID = 00000017 serial = 10 error_code = 10 request_code = 142 minor_code = 1 *** Error Message: 'BadAccess (attempt to access private resource denied)' Attach returned 1 Everything looked okay Creating shm with permission 600 shmget return 380272827 shm returned b78bf000 X error: resource ID = 00000017 serial = 10 error_code = 10 request_code = 142 minor_code = 1 *** Error Message: 'BadAccess (attempt to access private resource denied)' Attach returned 1 Everything looked okay Creating shm with permission 700 shmget return 380305595 shm returned b78bf000 X error: resource ID = 00000017 serial = 10 error_code = 10 request_code = 142 minor_code = 1 *** Error Message: 'BadAccess (attempt to access private resource denied)' Attach returned 1 Everything looked okay Creating shm with permission 660 shmget return 380338363 shm returned b78bf000 X error: resource ID = 00000017 serial = 10 error_code = 10 request_code = 142 minor_code = 1 *** Error Message: 'BadAccess (attempt to access private resource denied)' Attach returned 1 Everything looked okay Creating shm with permission 666 shmget return 380371131 shm returned b78bf000 Attach returned 1 Everything looked okay
On n900: ... Creating shm with permission 600 shmget return 28770338 shm returned 40002000 Attach returned 1 Everything looked okay Creating shm with permission 700 shmget return 28803107 shm returned 40002000 Attach returned 1 Everything looked okay Creating shm with permission 660 shmget return 28835876 shm returned 40002000 Attach returned 1 Everything looked okay Creating shm with permission 666 shmget return 28868645 shm returned 40002000 Attach returned 1 Everything looked okay
what do you think of attempting to use 0600 then, if that fails, opening up the permissions to 0666.
oleg is there anything else that is interesting about your x server that might cause this problem?
Oleg, which desktop? |uname -a && X -version| would be useful information.
uname -a && X -version Linux romaxaHP 2.6.31-1-686-bigmem #1 SMP Sun Nov 15 21:22:56 UTC 2009 i686 GNU/Linux X.Org X Server 1.6.5 Release Date: 2009-10-11 X Protocol Version 11, Revision 0 Build Operating System: Linux 2.6.30.8-dsa-ia32 i686 Debian Current Operating System: Linux romaxaHP 2.6.31-1-686-bigmem #1 SMP Sun Nov 15 21:22:56 UTC 2009 i686 Build Date: 13 October 2009 11:25:51AM xorg-server 2:1.6.5-1 (buildd@murphy.debian.org) Before reporting problems, check http://wiki.x.org to make sure that you have the latest version.
Her is results from my home laptop: http://pastebin.mozilla.org/715784 uname -a && X -version Linux romaxat61p 2.6.32-trunk-686-bigmem #1 SMP Thu Dec 24 06:31:28 UTC 2009 i686 GNU/Linux This is a pre-release version of the X server from The X.Org Foundation. It is not supported in any way. Bugs may be filed in the bugzilla at http://bugs.freedesktop.org/. Select the "xorg" product for bugs you find in this release. Before reporting bugs in pre-release versions please check the latest version in the X.Org Foundation git repository. See http://wiki.x.org/wiki/GitPage for git access instructions. X.Org X Server 1.7.5.902 (1.7.6 RC 2) Release Date: 2010-03-12 X Protocol Version 11, Revision 0 Build Operating System: Linux 2.6.26-2-amd64 i686 Debian Current Operating System: Linux romaxat61p 2.6.32-trunk-686-bigmem #1 SMP Thu Dec 24 06:31:28 UTC 2009 i686 Kernel command line: root=UUID=d167e21c-adb4-4de8-855a-081502135887 ro Build Date: 16 March 2010 12:02:40AM xorg-server 2:1.7.5.902-1 (Cyril Brulebois <kibi@debian.org>) Current version of pixman: 0.16.4 Before reporting problems, check http://wiki.x.org to make sure that you have the latest version.
$ X -version && ./test_shm X.Org X Server 1.6.4 Release Date: 2009-9-27 X Protocol Version 11, Revision 0 Build Operating System: Linux 2.6.24-23-server x86_64 Ubuntu Current Operating System: Linux beast 2.6.31-20-generic #58-Ubuntu SMP Fri Mar 12 04:38:19 UTC 2010 x86_64 Kernel command line: root=/dev/md0 ro quiet splash Build Date: 04 March 2010 09:57:23AM xorg-server 2:1.6.4-2ubuntu4.2 (buildd@) Before reporting problems, check http://wiki.x.org to make sure that you have the latest version. Creating shm with permission 0 shmget return 55476263 shm returned ffffffff X error: resource ID = 00000017 serial = 10 error_code = 10 request_code = 142 minor_code = 1 *** Error Message: 'BadAccess (attempt to access private resource denied)' Attach returned 1 Everything looked okay Creating shm with permission 200 shmget return 55509031 shm returned ffffffff X error: resource ID = 00000017 serial = 10 error_code = 10 request_code = 142 minor_code = 1 *** Error Message: 'BadAccess (attempt to access private resource denied)' Attach returned 1 Everything looked okay Creating shm with permission 400 shmget return 55541799 shm returned ffffffff X error: resource ID = 00000017 serial = 10 error_code = 10 request_code = 142 minor_code = 1 *** Error Message: 'BadAccess (attempt to access private resource denied)' Attach returned 1 Everything looked okay Creating shm with permission 600 shmget return 55574567 shm returned e569b000 Attach returned 1 Everything looked okay Creating shm with permission 700 shmget return 55607336 shm returned e569b000 Attach returned 1 Everything looked okay Creating shm with permission 660 shmget return 55640105 shm returned e569b000 Attach returned 1 Everything looked okay Creating shm with permission 666 shmget return 55672874 shm returned e569b000 Attach returned 1 Everything looked okay
Also $ ps au | grep X root 1579 2.0 0.3 1017772 106784 tty7 Ss+ Mar27 599:20 /usr/bin/X :0 -br -verbose -auth /var/run/gdm/auth-for-gdm-E7mUgQ if that might be relevant.
ps au | grep X romaxa 10430 0.0 0.0 5160 2328 pts/89 S<+ Apr15 0:00 ssh romaxaxz@localhost -X romaxa 10728 0.0 0.0 5160 2332 pts/91 S<+ Apr15 0:00 ssh romaxaxz@localhost -X romaxa 17992 0.0 0.0 3868 740 pts/1 S<+ 23:37 0:00 grep X romaxa 19314 0.0 0.0 5292 2384 pts/46 S<+ Apr14 0:00 ssh romaxaxz@localhost -X romaxa 19517 0.0 0.0 5424 2460 pts/49 S<+ Apr14 0:00 ssh romaxaxz@localhost -X romaxa 25142 0.0 0.0 5296 2352 pts/87 S<+ Apr15 0:00 ssh romaxaxz@localhost -X root 30527 0.0 0.1 39228 31384 tty7 S<s+ 22:05 0:02 /usr/bin/X :0 -audit 0 -auth /var/lib/gdm/:0.Xauth vt7
Nothing stands out to me; only real difference is that your X server is running "not nice". Might be a build config difference.
Also WFM on my Ubuntu 9.10 (Karmic) VM: $ ./test_shm Creating shm with permission 0 shmget return 688141 shm returned ffffffff X error: resource ID = 00000017 serial = 10 error_code = 10 request_code = 139 minor_code = 1 *** Error Message: 'BadAccess (attempt to access private resource denied)' Attach returned 1 Everything looked okay Creating shm with permission 200 shmget return 720909 shm returned ffffffff X error: resource ID = 00000017 serial = 10 error_code = 10 request_code = 139 minor_code = 1 *** Error Message: 'BadAccess (attempt to access private resource denied)' Attach returned 1 Everything looked okay Creating shm with permission 400 shmget return 753677 shm returned ffffffff X error: resource ID = 00000017 serial = 10 error_code = 10 request_code = 139 minor_code = 1 *** Error Message: 'BadAccess (attempt to access private resource denied)' Attach returned 1 Everything looked okay Creating shm with permission 600 shmget return 786445 shm returned b770d000 Attach returned 1 Everything looked okay Creating shm with permission 700 shmget return 819214 shm returned b770d000 Attach returned 1 Everything looked okay Creating shm with permission 660 shmget return 851983 shm returned b770d000 Attach returned 1 Everything looked okay Creating shm with permission 666 shmget return 884752 shm returned b770d000 Attach returned 1 Everything looked okay
(In reply to comment #14) > romaxa 10430 0.0 0.0 5160 2328 pts/89 S<+ Apr15 0:00 ssh > romaxaxz@localhost -X Are you connecting directly to the X server, or through ssh? GetLocalClientCreds only works for unix domain socket connections. http://cgit.freedesktop.org/xorg/xserver/tree/os/access.c?id=c9726bbe3148c7a8adb4dfde483741545d59c3dc#n1208
I was running it directly., X connections are not related to this simple test
Ok, I've found where is problem... I have 2 active users on my desktop, and running Xephyr from user1, and running fennec from user2... and in this case user1 not able to use xshm memory created for user2...
That's a feature, not a bug :). Any reason to keep this open?
Comment 0 suggests that the BadAccess error is not being caught and so the app is aborting rather than falling back to non-XShm code. That's a bug.
Ah, gotcha.
Summary: shmget with 0600 mode does not work on desktop → Fennec aborts when MIT-SHM fails because of insufficient permissions rather than falling back on non-SHM path
This code has changed somewhat in the years past, with bug 1271100 leading to the most recent change, and so I don't think there's value remainging in keeping this open.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: