Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 12967 - QT segfaults when __GL_SINGLE_THREADED=1
Summary: QT segfaults when __GL_SINGLE_THREADED=1
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo KDE team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-12-31 00:01 UTC by Richard Kilgore
Modified: 2003-09-30 08:23 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Kilgore 2002-12-31 00:01:40 UTC
This is on a dual athlon xp system with
CFLAGS="-march=athlon-xp -mcpu=athlon-xp -O3 -pipe"
and
USE="3dnow alsa avi berkdb cdr crypt cups dga directFB doc dvd
encode -esd evo fbcon gd gif gnome gphoto2 gtk2 gtkhtml
-i18n imlib innodb java jikes jpeg kde libwww -maildir mbox
mmx motif mozilla mpeg mysql ncurses -nls oggvorbis
opengl oss -pam pdflib perl plotutils png qt quicktime readline
ruby samba sdl slang slp socks5 spell ssl svga -tcpd tetex tiff
truetype X xft xml xml2 xmms xv zlib"

(but the CFLAGS does not seem to affect flags when compiling glibc,
and I have tried with and without optimizations and with and without
the debug flag wherever I can).

I have had this problem for a month or two now. uic seg faults every
time I try to compile qt:

cd designer && make -f Makefile
make[4]: Entering directory
`/var/tmp/portage/qt-3.1.0-r1/work/qt-x11-free-3.1.0/tools/designer/designer'
/var/tmp/portage/qt-3.1.0-r1/work/qt-x11-free-3.1.0/bin/uic -L
/var/tmp/portage/qt-3.1.0-r1/work/qt-x11-free-3.1.0/plugins listboxeditor.ui -o
listboxeditor.h
/var/tmp/portage/qt-3.1.0-r1/work/qt-x11-free-3.1.0/bin/uic -L
/var/tmp/portage/qt-3.1.0-r1/work/qt-x11-free-3.1.0/plugins editfunctions.ui -o
editfunctions.h
make[4]: *** [listboxeditor.h] Segmentation fault
make[4]: *** Waiting for unfinished jobs....
make[4]: *** [editfunctions.h] Segmentation fault
make[4]: Leaving directory
`/var/tmp/portage/qt-3.1.0-r1/work/qt-x11-free-3.1.0/tools/designer/designer'
make[3]: *** [sub-designer] Error 2
make[3]: Leaving directory
`/var/tmp/portage/qt-3.1.0-r1/work/qt-x11-free-3.1.0/tools/designer'
make[2]: *** [sub-designer] Error 2

make[2]: Leaving directory
`/var/tmp/portage/qt-3.1.0-r1/work/qt-x11-free-3.1.0/tools'
make[1]: *** [sub-tools] Error 2
make[1]: Leaving directory `/var/tmp/portage/qt-3.1.0-r1/work/qt-x11-free-3.1.0'
make: *** [init] Error 2

If I run uic in gdb, it seg faults in src/codecs/qtextcodec.cpp, in the
source for QTextCodec::codecForLocale(), at the line:

char *charset = nl_langinfo (CODESET);

If I put a printf statement right before it to print out CODESET:

printf("CODESET is %d\n", CODESET);

I get a segmentation fault in _IO_vfprintf in glibc 2.3.1 at a very
strange place. It seg faults while executing the line:

int save_errno = errno;

If I try to run mplayer right now, I get a segmentation fault in exactly
the same place in _IO_vfprintf in glibc 2.3.1.

My only guess here is that the stack is getting corrupted? Of course
glibc won't let me compile it without any optimization, so the line
reported as where the seg fault is actually happening might be
completely bogus (I think?). It's definitely a messy problem, and I
don't think I have the experience I'd need with any of gdb, glibc, or
var-arg stuff to figure this one out any time soon (without help anyway).
Comment 1 Hannes Mehnert (RETIRED) gentoo-dev 2003-01-06 04:17:19 UTC
looks more like a glibc issue to me than a qt issue, adding glibc devs to cc. 
Comment 2 Martin Schlemmer (RETIRED) gentoo-dev 2003-01-07 13:02:21 UTC
Tried to cut CFLAGS to "-march=athlon -O2 -pipe" (as well as CXXFLAGS),
and remerge ?  Also, what versions of glibc, gcc, and binutils do you 
have installed (with gentoolkit installed, do):

  # epm -q binutils gcc glibc
Comment 3 Richard Kilgore 2003-01-08 02:06:38 UTC
I should have followed up here.  I did try cutting the CFLAGS all the way
down to simply -O2 to no avail.  I don't know what the problem is, but I
was able to make it stop happening by removing the following from my
.xinitrc file:

   export __GL_SINGLE_THREADED=1

I noticed by accident that if I ran uic from the console, it did not
seg fault, and in fact it worked.  Then finding the culprit in .xinitrc
was not hard.

I would guess that is a bug that needs to be sent upstream to the qt
folks - if you can reproduce it by setting __GL_SINGLE_THREADED=1.
Comment 4 Dan Armak (RETIRED) gentoo-dev 2003-01-31 15:38:21 UTC
Confirmed: I just set __GL_SINGLE_THREADED=1 and uic segfaults on an empty tun (ie when 
simply running "uic"). More than that, any qt/kde app will segfault if run from such an 
environment! 
 
Needs to be polished up and sent upstream (and we need to check if it's fixed in qt 3.1.1.). 
First more info would be nice though, such as any known issues with that variable (maybe this 
is related to the nvidia drivers? I use them, do you?) Well, leaving this for slightly later. 
Comment 5 Martin Schlemmer (RETIRED) gentoo-dev 2003-02-02 13:51:30 UTC
Nope, its not fixed in qt-3.1.1.  Richard, what opengl do you use?  xfree's
or nvidia ?
Comment 6 Richard Kilgore 2003-02-02 14:39:15 UTC
I use the NVidia libGL: /usr/lib/opengl/nvidia/lib/libGL.so.1.0.3123
Comment 7 Dan Armak (RETIRED) gentoo-dev 2003-04-15 07:27:39 UTC
Read the nvidia glx README. It's a known issue. They say it's fixed in their alternative 
TLS-enabled libraries. I'm told the reason we don't enable TLS support in glibc is that it makes 
things much slower. NPTL should fix that :-) 
Anyway since the bug is in nvidia's drivers, there's very little we can do :-( (It shouldn't even be 
specific to qt, you could probably find something else that had it if you looked hard enough) 
Please confirm analysis - do we who ahve this bug all use nvidia drivers? 
Comment 8 Michele Balistreri (RETIRED) gentoo-dev 2003-04-15 08:24:31 UTC
yes, the same here too (using nvidia drivers) 
Comment 9 Richard Kilgore 2003-04-15 10:19:15 UTC
Yes, I am using the nvidia driver as well.

    - richard
Comment 10 Michele Balistreri (RETIRED) gentoo-dev 2003-05-11 05:59:05 UTC
is an nvidia driver bug, we can't fix it (easy workaround, don't export 
__GL_SINGLE_THREADED=1) 
Comment 11 Caleb Tennis (RETIRED) gentoo-dev 2003-09-30 08:23:51 UTC
re-resolving