[Development] qt_message_fatal() in Linux

Thiago Macieira thiago.macieira at intel.com
Tue Nov 21 22:55:56 CET 2017


On terça-feira, 21 de novembro de 2017 13:52:00 PST andrea via Development 
wrote:
>      if (Q_UNLIKELY(version != QObjectPrivateVersion))
>          qFatal("Cannot mix incompatible Qt library (version 0x%x) with this
> library (version 0x%x)", version, QObjectPrivateVersion);
> 
> This eventually calls qt_message_fatal() with a message like the string
> above, but it is discarded.

No, it isn't.

 $ cat main.cpp 
int main()
{
    qFatal("Goodbye World");
}
 $ make
 $ ./a.out
 $ ./qtbug64640 
[ 21117.597] (26976 26976)(main):       Goodbye World
[1]    26976 abort (core dumped)  ./a.out

 $ coredumpctl gdb 26976
[...]
(gdb) bt
#0  0x00007f2e92d190d0 in raise () from /lib64/libc.so.6
#1  0x00007f2e92d1a6b1 in abort () from /lib64/libc.so.6
#2  0x00007f2e93158e7b in qt_message_fatal (context=..., message=...)
    at /home/tjmaciei/src/qt/qt5/qtbase/src/corelib/global/qlogging.cpp:1709
#3  0x00007f2e9315506e in QMessageLogger::fatal (this=0x7ffe89097790, 
msg=0x40085b "Goodbye World")
    at /home/tjmaciei/src/qt/qt5/qtbase/src/corelib/global/qlogging.cpp:817
#4  0x000000000040071d in main (argc=1, argv=0x7ffe89097898) at main.cpp:26

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Development mailing list