Bug 235546 - texmaker: immediately segfaults in non-root account
texmaker: immediately segfaults in non-root account
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: texmaker (Show other bugs)
6
x86_64 Linux
medium Severity high
: ---
: ---
Assigned To: Deji Akingunola
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-04-06 18:55 EDT by Harry Bock
Modified: 2007-11-30 17:12 EST (History)
3 users (show)

See Also:
Fixed In Version: 1.5-2.fc7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-06-18 12:43:58 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch to fix reference to local variable causing segfault in QCoreApplication::arguments() (580 bytes, patch)
2007-06-15 03:23 EDT, Kevin Kofler
no flags Details | Diff

  None (edit)
Description Harry Bock 2007-04-06 18:55:13 EDT
Description of problem:
Upon opening texmaker on x86_64, it immediately segfaults unless I am running as
root.  Seems to work fine on i386 last I checked.

Version-Release number of selected component (if applicable):
Version: 1.5
Release: 1.fc6

How reproducible:
Install from Fedora Extras, run as normal user.

Steps to Reproduce:
1. $ yum install texmaker
2. $ texmaker
3.
  
Actual results:
Program partially loads (UI visible for a split second), then segfaults.

Expected results:
Program loads completely.

Additional info:
Compiling from source works fine, so it is not a Qt4 issue as far as I can tell.

gdb backtrace:
(gdb) run
Starting program: /home/shinigami/source/texmaker-1.5/texmaker 
[Thread debugging using libthread_db enabled]
[New Thread 46912496372512 (LWP 6408)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 46912496372512 (LWP 6408)]
0x0000003ef1473019 in QString::fromLocal8Bit () from /usr/lib64/libQtCore.so.4
(gdb) bt
#0  0x0000003ef1473019 in QString::fromLocal8Bit ()
   from /usr/lib64/libQtCore.so.4
#1  0x0000003ef14d39dc in QCoreApplication::arguments ()
   from /usr/lib64/libQtCore.so.4
#2  0x0000003ef0bb07b6 in QSessionManager::QSessionManager$base ()
   from /usr/lib64/libQtGui.so.4
#3  0x0000003ef0bb0fc2 in QSessionManager::QSessionManager$base ()
   from /usr/lib64/libQtGui.so.4
#4  0x0000003fc5e06d48 in _SmcProcessMessage () from /usr/lib64/libSM.so.6
#5  0x0000003fc6211ffb in IceProcessMessages () from /usr/lib64/libICE.so.6
#6  0x0000003ef0bab950 in QApplicationPrivate::appName ()
   from /usr/lib64/libQtGui.so.4
#7  0x0000003ef14e2028 in QMetaObject::activate ()
   from /usr/lib64/libQtCore.so.4
#8  0x0000003ef14fa06e in QSocketNotifier::activated ()
   from /usr/lib64/libQtCore.so.4
#9  0x0000003ef14e68df in QSocketNotifier::event ()
   from /usr/lib64/libQtCore.so.4
#10 0x0000003ef0b6b84c in QApplicationPrivate::notify_helper ()
   from /usr/lib64/libQtGui.so.4
#11 0x0000003ef0b7125c in QApplication::notify () from /usr/lib64/libQtGui.so.4
#12 0x0000003ef14ef2ab in QEventDispatcherGlib::unregisterTimer ()
   from /usr/lib64/libQtCore.so.4
#13 0x0000003b0342cf64 in g_main_context_dispatch ()
   from /lib64/libglib-2.0.so.0
#14 0x0000003b0342fd9d in g_main_context_check () from /lib64/libglib-2.0.so.0
#15 0x0000003b034302ce in g_main_context_iteration ()
   from /lib64/libglib-2.0.so.0
#16 0x0000003ef14ef320 in QEventDispatcherGlib::processEvents ()
   from /usr/lib64/libQtCore.so.4
#17 0x0000003ef0bd689f in QX11Info::copyX11Data ()
   from /usr/lib64/libQtGui.so.4
#18 0x0000003ef14d12c8 in QEventLoop::processEvents ()
   from /usr/lib64/libQtCore.so.4
#19 0x0000003ef14d13dd in QEventLoop::exec () from /usr/lib64/libQtCore.so.4
#20 0x0000003ef14d33f3 in QCoreApplication::exec ()
   from /usr/lib64/libQtCore.so.4
#21 0x0000000000416330 in main (argc=<value optimized out>, 
    argv=<value optimized out>) at main.cpp:79

When run as root, however, the following message is displayed on stdout:
Qt: Session management error: Authentication Rejected, reason : None of the
authentication protocols specified are supported and host-based authentication
failed
Comment 1 Deji Akingunola 2007-04-08 21:23:48 EDT
Can you please attach or send me a log of your self-compiled build that doesn't
segfault. I've just confirm the crash on x86_64, but like you it has always
worked on the i386 system where I use texmaker more often.
Comment 2 Denis Osukso 2007-04-16 20:39:06 EDT
Same thing happens at mine.
Downloaded the source (texmaker-1.5.tar.bz2) and built with qt4 (typed
/usr/lib64/qt4 while running BUILD.sh) 

Qt-Toolkit:
qt4-4.2.3-7.fc6.1
qt4-x11-4.2.3-7.fc6.1
qt4-devel-4.2.3-7.fc6.1


This GDB was configured as "x86_64-redhat-linux-gnu".
(gdb) exec-file /usr/local/bin/texmaker
(gdb) run
Starting program: /usr/local/bin/texmaker 
Using host libthread_db library "/lib64/libthread_db.so.1".
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread 46912496290592 (LWP 4765)]
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
warning: the debug information found in
"/usr/lib/debug//usr/lib64/libfreetype.so.6.3.10.debug" does not match
"/usr/lib64/libfreetype.so.6" (CRC mismatch).

(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
---Type <return> to continue, or q <return> to quit---
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 46912496290592 (LWP 4765)]
0x0000003df0873019 in QString::fromLocal8Bit () from /usr/lib64/libQtCore.so.4
(gdb) 



ran as root:
(gdb) exec-file /usr/local/bin/texmaker
(gdb) run
Starting program: /usr/local/bin/texmaker 
Using host libthread_db library "/lib64/libthread_db.so.1".
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread 46912496290592 (LWP 5206)]
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
---Type <return> to continue, or q <return> to quit---
(no debugging symbols found)
warning: the debug information found in
"/usr/lib/debug//usr/lib64/libfreetype.so.6.3.10.debug" does not match
"/usr/lib64/libfreetype.so.6" (CRC mismatch).

(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)

Program exited normally.
(gdb) 

Comment 3 Deji Akingunola 2007-04-16 22:28:06 EDT
(In reply to comment #2)
>
...
> 
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 46912496290592 (LWP 4765)]
> 0x0000003df0873019 in QString::fromLocal8Bit () from /usr/lib64/libQtCore.so.4
> (gdb) 
> 
Since the same crashed also occurred with self-built texmaker for Denis, and
because of the above trace that doesn't show up when run as root, I'm begining
to highly suspect qt4 as the cause of it. It'll be nice if Harry Bock can
confirm the segmentation fault does/doesn't with self-built version ran as
ordinary user. 
Comment 4 Harry Bock 2007-04-16 22:33:56 EDT
My apologies, it appears I was still logged in as root when I tested the
from-source build, because on my other AMD64 box, it still crashes as a normal user.

Sorry for causing the confusion.
Comment 5 Deji Akingunola 2007-04-16 23:46:12 EDT
Thanks for the confirmation Harry. CC'ing the qt4 maintainer, in case he know
about it.

Hi Rex,
Could qt4 be causing this segfault?
Comment 6 Rex Dieter 2007-04-17 06:55:50 EDT
> Could qt4 be causing this segfault?

Could/possible?  yes
Likely?  no

imo, looks like a x86_64(64bit) specific issue (based on the evidence so far).
Comment 7 Tadhg 2007-04-20 19:04:24 EDT
Getting this when I install from yum as well. When I install using the graphical
installer from texmaker's site, it works a charm!

Getting same error with the last.fm client too...
Comment 8 Rex Dieter 2007-04-24 14:55:04 EDT
For folks seeing the crash, please:
$ yum --enablerepo=extras-debuginfo install texmaker-debuginfo qt4-debuginfo
we could then get some (more) useful tracebacks.
Comment 9 Harry Bock 2007-04-28 12:51:32 EDT
This bug seems worse than I thought, as it causes beryl to crash and fall back
to metacity on the segfault.

Full debuginfo bt:

(gdb) run
Starting program: /usr/local/bin/texmaker 
[Thread debugging using libthread_db enabled]
[New Thread 46912496388896 (LWP 9235)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 46912496388896 (LWP 9235)]
0x0000003ae9073019 in QString::fromLocal8Bit (
    str=0x10 <Address 0x10 out of bounds>, size=-1) at tools/qstring.cpp:3293
3293        if (size == 0 || (!*str && size < 0))
(gdb) bt
#0  0x0000003ae9073019 in QString::fromLocal8Bit (
    str=0x10 <Address 0x10 out of bounds>, size=-1) at tools/qstring.cpp:3293
#1  0x0000003ae90d39dc in QCoreApplication::arguments ()
    at kernel/qcoreapplication.cpp:1621
#2  0x00000033179b07b6 in sm_performSaveYourself (smd=0x7e2ad0)
    at kernel/qapplication_x11.cpp:4711
#3  0x00000033179b0fc2 in sm_saveYourselfCallback (
    smcConn=<value optimized out>, clientData=0x10, saveType=2, 
    shutdown=<value optimized out>, interactStyle=9930800)
    at kernel/qapplication_x11.cpp:4694
#4  0x0000003ae1806d48 in _SmcProcessMessage () from /usr/lib64/libSM.so.6
#5  0x0000003ae2011ffb in IceProcessMessages () from /usr/lib64/libICE.so.6
#6  0x00000033179ab950 in QSmSocketReceiver::qt_metacall (this=0x7d9be0, 
    _c=QMetaObject::InvokeMetaMethod, _id=0, _a=0x7fffa65b13e0)
    at .moc/release-shared/qapplication_x11.moc:63
#7  0x0000003ae90e2028 in QMetaObject::activate (sender=0x7e0cb0, 
    from_signal_index=4, to_signal_index=4, argv=0x9c5710)
    at kernel/qobject.cpp:2937
#8  0x0000003ae90fa06e in QSocketNotifier::activated (this=0x7fffa65b0750, 
    _t1=13) at .moc/release-shared/moc_qsocketnotifier.cpp:80
#9  0x0000003ae90e68df in QSocketNotifier::event (this=0x7e0cb0, 
    e=0x7fffa65b18d0) at kernel/qsocketnotifier.cpp:304
#10 0x000000331796b84c in QApplicationPrivate::notify_helper (this=0x7a3ca0, 
---Type <return> to continue, or q <return> to quit---
    receiver=0x7e0cb0, e=0x7fffa65b18d0) at kernel/qapplication.cpp:3439
#11 0x000000331797125c in QApplication::notify (this=0x7fffa65b1b30, 
    receiver=0x7e0cb0, e=0x7fffa65b18d0) at kernel/qapplication.cpp:3380
#12 0x0000003ae90ef2ab in socketNotifierSourceDispatch (
    source=<value optimized out>) at kernel/qcoreapplication.h:183
#13 0x00000039ee02cf64 in g_main_context_dispatch ()
   from /lib64/libglib-2.0.so.0
#14 0x00000039ee02fd9d in g_main_context_check () from /lib64/libglib-2.0.so.0
#15 0x00000039ee0302ce in g_main_context_iteration ()
   from /lib64/libglib-2.0.so.0
#16 0x0000003ae90ef320 in QEventDispatcherGlib::processEvents (this=0x7ad300, 
    flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:366
#17 0x00000033179d689f in QGuiEventDispatcherGlib::processEvents (
    this=0x7fffa65b0750, flags=<value optimized out>)
    at kernel/qguieventdispatcher_glib.cpp:178
#18 0x0000003ae90d12c8 in QEventLoop::processEvents (
    this=<value optimized out>, flags=<value optimized out>)
    at kernel/qeventloop.cpp:126
#19 0x0000003ae90d13dd in QEventLoop::exec (this=0x7fffa65b1ae0, 
    flags=@0x7fffa65b1af0) at kernel/qeventloop.cpp:168
#20 0x0000003ae90d33f3 in QCoreApplication::exec ()
    at kernel/qcoreapplication.cpp:730
#21 0x0000000000416330 in main (argc=<value optimized out>, 
---Type <return> to continue, or q <return> to quit---
    argv=<value optimized out>) at main.cpp:79

It seems to be the way Qt or texmaker handles argument parsing. 
Comment 10 Rex Dieter 2007-06-14 13:34:46 EDT
Can anyone confirm whether qt4-4.3.0 recently pushed to updates helps here?
Comment 11 Deji Akingunola 2007-06-14 14:09:23 EDT
No, it doesn't (on rawhide). However, I now think the problem is with texmaker
rather the qt4, texmaker-1.4 compiles and runs O.K with this qt4. Anyone who
knows c++ very well might want to help look at main.cpp  in the root directory
of texmaker source code.
Comment 12 Rex Dieter 2007-06-14 14:17:53 EDT
(apologies for the possibly silly question but...) Has upstream been consulted?
Comment 13 Deji Akingunola 2007-06-14 14:36:19 EDT
I contacted him once, and he replied something about that version of qt4 not
released yet. I'll try and contact him again.
Comment 14 Deji Akingunola 2007-06-14 17:17:42 EDT
I'm sorry the about comment wasn't entirely correct. I actually did contacted
him about another issue, for which he complained was due to pre-release qt4-4.2;
I believed you (Rex) later provided the solution to that issue. I've written to
him about the present issue anyway, sorry for the misinformation.
Comment 15 Kevin Kofler 2007-06-15 03:21:07 EDT
This is a bug in TexMaker.

From the Qt 4 documentation:
QCoreApplication::QCoreApplication ( int & argc, char ** argv )
[...]
Warning: The data pointed to by argc and argv must stay valid for the entire 
lifetime of the QCoreApplication object.

Notice that argc is passed by reference! But TexMaker then does this:
TexmakerApp::TexmakerApp( int argc, char ** argv ) : QApplication ( argc, 
argv )
Here argc is passed by value, then forwarded to QApplication by reference. Once 
the TexmakerApp::TexmakerApp constructor exits, the reference passed to 
QApplication is no longer valid, which causes the segfault in 
QCoreApplication::arguments().

The fix is to change the TexmakerApp constructor to take an int & instead.
Comment 16 Kevin Kofler 2007-06-15 03:23:06 EDT
Created attachment 157065 [details]
Patch to fix reference to local variable causing segfault in QCoreApplication::arguments()

The attached patch should fix it. (Not tested, no x86_64 system here and no
time to build and test this in QEMU.)
Comment 17 Deji Akingunola 2007-06-15 09:31:13 EDT
Thanks a lot Kevin, the patch just fixed it. I'm off now to submitting it for
updates.
Comment 18 Rex Dieter 2007-06-15 09:37:26 EDT
Kudos to Kevin indeed.  Keep up the good work, and you'll receive your "Fedora
ninja" merit badge any day now.
Comment 19 Deji Akingunola 2007-06-15 10:27:13 EDT
Updates to all appropriate branches on the way. Thanks again Kevin for the fix,
and Rex and everyone else for their contribution.
Comment 20 Fedora Update System 2007-06-16 09:21:01 EDT
texmaker-1.5-2.fc7 has been pushed to the Fedora 7 testing repository.  If problems still persist, please make note of it in this bug report.
Comment 21 Fedora Update System 2007-06-18 12:43:54 EDT
texmaker-1.5-2.fc7 has been pushed to the Fedora 7 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.