RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1365967 - gnome-shell segfaults if XDG_DATA_DIRS includes an inaccessible directory
Summary: gnome-shell segfaults if XDG_DATA_DIRS includes an inaccessible directory
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: gjs
Version: 7.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Colin Walters
QA Contact: Desktop QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-10 15:57 UTC by Jonathan Billings
Modified: 2020-12-15 07:44 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-12-15 07:44:24 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jonathan Billings 2016-08-10 15:57:31 UTC
Description of problem:
We provide extra software via a network mountpoint, and we were told in BZ#1353249 to add extra Gnome menus by defining $XDG_DATA_DIRS to include the location of the additional menus.  Because of license restrictions, not everyone can run this software, so not everyone has permission to see into the network share.  I've discovered that if one of the directories in $XDG_DATA_DIRS exists but does not permit users to read, gnome-shell will segfault, and you'll get the "Oh no!  Something has gone wrong." display where you can only log out. 

Version-Release number of selected component (if applicable):
gnome-shell-3.14.4-37.el7.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Create an inaccesible directory:  
mkdir -m 0700 /usr/inaccessible
mkdir -m 0700 /usr/inaccessible/dir

2. Add the inaccessible directory to XDG_DATADIRS:
echo 'export XDG_DATA_DIRS=${XDG_DATA_DIRS:-/usr/share:/usr/local/share}:/usr/inaccessible/dir' > /etc/X11/xinit/xinitrc.d/99-extraapps.sh

3.  Attempt to log in using gnome-shell or gnome-shell classic.

Actual results:
You will be presented with the Oh no! error message with the only option to log out.

Expected results:
Normal login, user won't be able to see any menus in /usr/inaccessible, but otherwise normal.

Additional info:
When gnome-shell's javascript interpreter is trying to import the 'gi' class, it delves into several directories.  

In the journal, I'm seeing:

Aug 10 11:08:34 caen-z240.engin.umich.edu gnome-session[13178]: (gnome-shell:13468): Gjs-WARNING **: JS ERROR: Error: No property 'gi' in importer (or its value was undefined)
Aug 10 11:08:34 caen-z240.engin.umich.edu gnome-session[13178]: @<main>:1
Aug 10 11:08:34 caen-z240.engin.umich.edu kernel: gnome-shell[13468]: segfault at 8 ip 00007f9baff143d0 sp 00007ffd698e51d8 error 4 in libmozjs-24.so[7f9bafd72000+562000]
Aug 10 11:08:34 caen-z240.engin.umich.edu gnome-session[13178]: WARNING: Application 'gnome-shell-classic.desktop' killed by signal 11
Aug 10 11:08:34 caen-z240.engin.umich.edu gnome-session[13178]: gnome-session[13178]: WARNING: Application 'gnome-shell-classic.desktop' killed by signal 11


When I attached 'strace' to gnome-shell when I logged in, I saw:


14612 open("/usr/share/gjs-1.0/__init__.js", O_RDONLY) = -1 ENOENT (No such file or directory)
14612 lstat("/usr/share/gjs-1.0/overrides", 0x7fffe16e8ac0) = -1 ENOENT (No such file or directory)
14612 open("/usr/local/share/gjs-1.0/__init__.js", O_RDONLY) = -1 ENOENT (No such file or directory)
14612 lstat("/usr/local/share/gjs-1.0/overrides", 0x7fffe16e8ac0) = -1 ENOENT (No such file or directory)
14612 open("/usr/inaccessible/dir/gjs-1.0/__init__.js", O_RDONLY) = -1 EACCES (Permission denied)
14612 write(2, "\n(gnome-shell:14612): Gjs-WARNING **: JS ERROR: Error: No property 'gi' in importer (or its value was undefined)\n@<main>:1\n\n", 124) = 124
14612 --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x8} ---

if I change the permissions on /usr/inaccessible/dir so it's readable (0755), I see:

18720 open("/usr/share/gjs-1.0/__init__.js", O_RDONLY) = -1 ENOENT (No such file or directory)
18720 lstat("/usr/share/gjs-1.0/overrides", 0x7ffedd4810a0) = -1 ENOENT (No such file or directory)
18720 open("/usr/local/share/gjs-1.0/__init__.js", O_RDONLY) = -1 ENOENT (No such file or directory)
18720 lstat("/usr/local/share/gjs-1.0/overrides", 0x7ffedd4810a0) = -1 ENOENT (No such file or directory)
18720 open("/usr/inaccessible/dir/gjs-1.0/__init__.js", O_RDONLY) = -1 ENOENT (No such file or directory)
18720 lstat("/usr/inaccessible/dir/gjs-1.0/overrides", 0x7ffedd4810a0) = -1 ENOENT (No such file or directory)
18720 open("/usr/share/gjs-1.0/__init__.js", O_RDONLY) = -1 ENOENT (No such file or directory)
18720 lstat("/usr/share/gjs-1.0/overrides", 0x7ffedd4810a0) = -1 ENOENT (No such file or directory)
18720 stat("libglib-2.0.so.0", 0x7ffedd480570) = -1 ENOENT (No such file or directory)
18720 stat("libglib-2.0.so.0.so", 0x7ffedd480570) = -1 ENOENT (No such file or directory)
18720 stat("libglib-2.0.so.0.la", 0x7ffedd480570) = -1 ENOENT (No such file or directory)
18720 stat("libgobject-2.0.so.0", 0x7ffedd480570) = -1 ENOENT (No such file or directory)
18720 stat("libgobject-2.0.so.0.so", 0x7ffedd480570) = -1 ENOENT (No such file or directory)
18720 stat("libgobject-2.0.so.0.la", 0x7ffedd480570) = -1 ENOENT (No such file or directory)
18720 futex(0x7f1a2c1b54a8, FUTEX_WAKE, 2147483647) = 0
18720 futex(0x7f1a2c1b54a8, FUTEX_WAKE, 2147483647) = 0
18720 open("/usr/lib64/gjs/girepository-1.0/Clutter-1.0.typelib", O_RDONLY) = -1 ENOENT (No such file or directory)
18720 open("/usr/lib64/gnome-shell/Clutter-1.0.typelib", O_RDONLY) = -1 ENOENT (No such file or directory)
18720 open("/usr/lib64/mutter/Clutter-1.0.typelib", O_RDONLY) = -1 ENOENT (No such file or directory)
18720 open("/usr/lib64/mutter/Clutter-1.0.typelib", O_RDONLY) = -1 ENOENT (No such file or directory)
18720 open("/usr/lib64/girepository-1.0/Clutter-1.0.typelib", O_RDONLY) = 22
18720 fstat(22, {st_mode=S_IFREG|0644, st_size=493400, ...}) = 0
18720 mmap(NULL, 493400, PROT_READ, MAP_PRIVATE, 22, 0) = 0x7f1a1405c000
18720 close(22)                         = 0

(and so on, it works)

The bug appears to be that gnome-shell's javascript engine (mozjs24) segfaults when it tries a directory and gets a EACCESS instead of ENOENT.

Comment 2 Florian Müllner 2016-09-07 17:40:02 UTC
This is an gjs issue - when trying to import a native module like gtk+ via its (gobject-introspection) typelib file, it needs to skip inaccessible directories and continue to the next candidate.

Comment 4 RHEL Program Management 2020-12-15 07:44:24 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.


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