Bug 1184234 - apparent glibc bug causes gnucash to segfault on startup when LD_LIBRARY_PATH is set to nonexistent directory
Summary: apparent glibc bug causes gnucash to segfault on startup when LD_LIBRARY_PATH...
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: 21
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Siddhesh Poyarekar
QA Contact: Fedora Extras Quality Assurance
: 1187980 (view as bug list)
Depends On:
Blocks: 1443236
TreeView+ depends on / blocked
Reported: 2015-01-20 20:01 UTC by Steve Holland
Modified: 2017-04-18 20:20 UTC (History)
10 users (show)

Fixed In Version: glibc-2.20-8.fc21
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2015-03-04 10:26:42 UTC
Type: Bug

Attachments (Terms of Use)
Stack backtrace from gdb (23.08 KB, text/plain)
2015-01-21 03:27 UTC, Steve Holland
no flags Details

System ID Private Priority Status Summary Last Updated
Sourceware 15378 0 None None None Never

Description Steve Holland 2015-01-20 20:01:24 UTC
Description of problem:
An apparent glibc bug causes gnucash to segfault on startup when LD_LIBRARY_PATH is set to a nonexistant directory

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. export LD_LIBRARY_PATH=/nonexistent_path 
2. gnucash &
3. watch gnucash segfault

Actual results:
Segmentation fault

Expected results:
gnucash starts successfully. Clearing LD_LIBRARY_PATH, or pointing LD_LIBRARY_PATH at a directory which actually exists, resolves the problem.

Additional info:
The segmentation fault seems to occur when glib's _g_module_open()  calls dlopen() at gmodule-dl.c:97 The filename to be opened is /usr/lib64/gio/modules/libgvfsdbus.so -- part of gvfs2.

dlopen() is given an absolute path, so it should not be searching per the man page: "If  filename  contains  a slash ("/"), then it is
       interpreted as a  (relative  or  absolute)  pathname.   Otherwise,  the
       dynamic  linker  searches  for the library ... " 
(Since filename contains a slash, the otherwise clause is not applicable, so dlopen() should not be searching)

dlopen seems to be searching through LD_LIBRARY_PATH anyway (based on strace output) and a segmentation fault occurs several function calls deep. 

Clearing LD_LIBRARY_PATH resolves the problem

This might be the root cause of bug #1177891

Comment 1 Carlos O'Donell 2015-01-21 00:25:35 UTC
The core C library is linked into every application and therefore involved in most strack traces. In order to effectively triage the incoming requests we need the help of users and developers alike to determine root causes.

Would you please provde an SOS report, or run gnucash through the debugger to produce a backtrace that can help us sort this bug against other bugs, and  suggest a workaround or solution?

As it is this bug does not contain enough information for me to conclude that it's a problem with glibc. Please reopen when you have an SOS report or backtrace with symbol information.

Until then I'm going to move this bug to gnucash for the gnucach maintainers to investigate.

Comment 2 Steve Holland 2015-01-21 03:27:17 UTC
Created attachment 982161 [details]
Stack backtrace from gdb

stack backtrace attached; Frame #11 is where it enters the C library, trying to open /usr/lib64/gio/modules/libgvfsdbus.so

Comment 3 Siddhesh Poyarekar 2015-01-21 04:42:51 UTC
This is a glibc bug.  Allan had posted a patch[1] for it for which I had asked for a test case.  I'll see if I can write one myself and have this fixed.

[1] https://sourceware.org/ml/libc-alpha/2014-10/msg00328.html

Comment 4 Bill Nottingham 2015-02-03 16:52:21 UTC
*** Bug 1187980 has been marked as a duplicate of this bug. ***

Comment 5 Fedora Update System 2015-02-27 13:26:59 UTC
glibc-2.20-8.fc21 has been submitted as an update for Fedora 21.

Comment 6 Fedora Update System 2015-02-28 10:23:57 UTC
Package glibc-2.20-8.fc21:
* should fix your issue,
* was pushed to the Fedora 21 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing glibc-2.20-8.fc21'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).

Comment 7 Fedora Update System 2015-03-04 10:26:42 UTC
glibc-2.20-8.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.

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