[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#443275: marked as done (qt4-x11: segmentation fault at QApplicationPrivate::currentPlatform())



Your message dated Fri, 19 Sep 2008 17:15:37 +0200
with message-id <4971562D0CDBAE4A86212E08861E9C4F038D7979@si-mail46.de.bosch.com>
and subject line bug close
has caused the Debian Bug report #443275,
regarding qt4-x11: segmentation fault at QApplicationPrivate::currentPlatform()
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
443275: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=443275
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: libqt4-core
Version: 4.3.1-2

I get a segmentation fault at line 4323 of qapplication.cpp:

uint QApplicationPrivate::currentPlatform(){
4318     uint platform = KB_Win;
4319 #ifdef Q_WS_MAC
4320     platform = KB_Mac;
4321 #elif defined Q_WS_X11
4322     platform = KB_X11;
4323     if (X11->desktopEnvironment == DE_KDE)
4324         platform |= KB_KDE;

X11 is 0x0. The real name of X11 is qt_x11Data.
(gdb) p qt_x11Data
$3 = (QX11Data *) 0x0


(gdb) backtrace
#0  QApplicationPrivate::currentPlatform () at kernel/qapplication.cpp:4318
#1  0xb789e8d7 in QKeySequence::keyBindings (key=QKeySequence::Delete) 
at kernel/qkeysequence.cpp:730
#2  0xb789ea25 in QKeySequence (this=0x80ef490, 
key=QKeySequence::Delete) at kernel/qkeysequence.cpp:645
#3  0x080977d6 in __static_initialization_and_destruction_0 
(__initialize_p=1, __priority=65535) at 
/home/tobias/owndata/sonstiges/c/qt/anmerda/src/project.cpp:81
#4  0x08097899 in global constructors keyed to 
_ZN9project_c10butAdd_CqsE () at 
/home/tobias/owndata/sonstiges/c/qt/anmerda/src/project.cpp:99
#5  0x080c998b in __do_global_ctors_aux ()
#6  0x080521c8 in _init ()
#7  0x080c9929 in __libc_csu_init ()
#8  0xb7055ff1 in __libc_start_main () from /lib/i686/cmov/libc.so.6
#9  0x08054301 in _start ()


Best regrards
Tobias Leutwein

Robert Bosch GmbH, Sitz: Stuttgart, Registergericht: Amtsgericht Stuttgart HRB 14000 
Aufsichtsratsvorsitzender: Hermann Scholl; Geschäftsführung: Franz Fehrenbach, Siegfried Dais, 
Bernd Bohr, Wolfgang Chur, Rudolf Colm, Gerhard Kümmel, Wolfgang Malchow, Peter Marks, 
Volkmar Denner, Peter Tyroller. 



--- End Message ---
--- Begin Message ---
On Tuesday, 15. Jul 2008 11:12 tobias.leutwein wrote:
> segmentation fault at QApplicationPrivate::currentPlatform()
>
> What I did:
> If I have a program like this:
> #include <QKeySequence>
> QKeySequence	ks = QKeySequence(QKeySequence::Delete);
> int main(int argc, char *argv[])
> {
>   return 0;
> }
> I get a Segmentation fault at QApplicationPrivate::currentPlatform().


> It seems to me that the issue is, that the variable qt_x11Data gets
> his value at construction of the QApplication object. So if ks is
> defined globally with a window manager depending value he needs the
> variable qt_x11Data but it is not defined yet.


Hi Tobias

QKeySequence, like many other Qt class require an instance of
QApplication.  (I see no mention of this in the current documentation,
bue we will document that)
That mean that you need to construct QKeySequence after the
QApplication.

In general, it's not recommanded to have global static object like this.

(You could maybe use the internal Q_GLOBAL_STATIC_WITH_ARGS macro
defined in qglobal.h,  documented in qglobal.cpp)

Regards.
--
Olivier Goffart
Trolltech ASA - http://www.trolltech.com

On Tuesday, 15. Jul 2008 15:00 Leutwein Tobias wrote:
> In case of a shortcut it is in my opinion a good choise to have it as
> a static.

Global static C++ objects with constructor have some issues.
The order of their constructions is undefined. They slow down the
startup time of the application. They doesn't work nice with shared
library. And some old compiler (such as GCC 3) might fail to initialize
them at all.

> Probably I have to make an init process for the shortcuts.

Yes, this sounds like a good solution.

Regards.
--
Olivier Goffart
http://www.trolltech.com


--- End Message ---

Reply to: