[Interest] Building Qt 5.5.0 rc with sanitizers

Igor Kostenko isanych at gmail.com
Thu Jun 18 14:57:27 CEST 2015


Hello all,

I'm trying to build Qt 5.5.0 rc on ubuntu 14.04 with gcc 5.1 with enabled
address and undefined sanitizers:

./configure --prefix=/opt/qt/5.5.0 -qt-zlib -qt-xcb -qt-libpng -qt-libjpeg
-opensource -debug -confirm-license -sanitize address -sanitize undefined

And getting error:

make[3]: Entering directory
`/opt/qt/qt-everywhere-opensource-src-5.5.0-rc/qtbase/src/corelib'
g++ -pipe -g -fvisibility=hidden -fvisibility-inlines-hidden -std=c++0x
-fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer -Wall -W
-D_REENTRANT -fPIC -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_TSLIB
-DQT_NO_LIBINPUT -DQT_NO_USING_NAMESPACE -DQT_BUILD_CORE_LIB
-DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS
-DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS
-DQT_DISABLE_DEPRECATED_BEFORE=0x050000
-DELF_INTERPRETER=\"/lib64/ld-linux-x86-64.so.2\" -DQT_CORE_LIB
-D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I. -I../3rdparty/zlib
-I../../include -I../../include/QtCore -I../../include/QtCore/5.5.0
-I../../include/QtCore/5.5.0/QtCore -Iglobal -I../3rdparty/pcre
-I../3rdparty/harfbuzz/src -I../3rdparty/md5 -I../3rdparty/md4
-I../3rdparty/sha3 -I../3rdparty/forkfd -I.moc -I../../mkspecs/linux-g++ -x
c++-header -c global/qt_pch.h -o .pch/Qt5Core.gch/c++
g++ -c -pipe -g -fvisibility=hidden -fvisibility-inlines-hidden -std=c++0x
-fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer -Wall -W
-D_REENTRANT -fPIC -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_TSLIB
-DQT_NO_LIBINPUT -DQT_NO_USING_NAMESPACE -DQT_BUILD_CORE_LIB
-DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS
-DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS
-DQT_DISABLE_DEPRECATED_BEFORE=0x050000
-DELF_INTERPRETER=\"/lib64/ld-linux-x86-64.so.2\" -DQT_CORE_LIB
-D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I. -I../3rdparty/zlib
-I../../include -I../../include/QtCore -I../../include/QtCore/5.5.0
-I../../include/QtCore/5.5.0/QtCore -Iglobal -I../3rdparty/pcre
-I../3rdparty/harfbuzz/src -I../3rdparty/md5 -I../3rdparty/md4
-I../3rdparty/sha3 -I../3rdparty/forkfd -I.moc -I../../mkspecs/linux-g++
tools/qstring_compat.cpp -o .obj/qstring_compat.o
/opt/qt/qt-everywhere-opensource-src-5.5.0-rc/qtbase/bin/moc -DQT_NO_MTDEV
-DQT_NO_LIBUDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT -DQT_NO_USING_NAMESPACE
-DQT_BUILD_CORE_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII
-DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER
-DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000
-DELF_INTERPRETER=\"/lib64/ld-linux-x86-64.so.2\" -DQT_CORE_LIB
-D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE
-I/opt/qt/qt-everywhere-opensource-src-5.5.0-rc/qtbase/mkspecs/linux-g++
-I/opt/qt/qt-everywhere-opensource-src-5.5.0-rc/qtbase/src/corelib
-I/opt/qt/qt-everywhere-opensource-src-5.5.0-rc/qtbase/src/3rdparty/zlib
-I/opt/qt/qt-everywhere-opensource-src-5.5.0-rc/qtbase/include
-I/opt/qt/qt-everywhere-opensource-src-5.5.0-rc/qtbase/include/QtCore
-I/opt/qt/qt-everywhere-opensource-src-5.5.0-rc/qtbase/include/QtCore/5.5.0
-I/opt/qt/qt-everywhere-opensource-src-5.5.0-rc/qtbase/include/QtCore/5.5.0/QtCore
-I/opt/qt/qt-everywhere-opensource-src-5.5.0-rc/qtbase/src/corelib/global
-I/opt/qt/qt-everywhere-opensource-src-5.5.0-rc/qtbase/src/3rdparty/pcre
-I/opt/qt/qt-everywhere-opensource-src-5.5.0-rc/qtbase/src/3rdparty/harfbuzz/src
-I/opt/qt/qt-everywhere-opensource-src-5.5.0-rc/qtbase/src/3rdparty/md5
-I/opt/qt/qt-everywhere-opensource-src-5.5.0-rc/qtbase/src/3rdparty/md4
-I/opt/qt/qt-everywhere-opensource-src-5.5.0-rc/qtbase/src/3rdparty/sha3
-I/opt/qt/qt-everywhere-opensource-src-5.5.0-rc/qtbase/src/3rdparty/forkfd
-I/usr/include/c++/5 -I/usr/include/x86_64-linux-gnu/c++/5
-I/usr/include/c++/5/backward -I/usr/lib/gcc/x86_64-linux-gnu/5/include
-I/usr/local/include -I/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed
-I/usr/include/x86_64-linux-gnu -I/usr/include
animation/qabstractanimation.h -o .moc/moc_qabstractanimation.cpp
g++ -c -include .pch/Qt5Core -pipe -g -fvisibility=hidden
-fvisibility-inlines-hidden -std=c++0x -fsanitize=address
-fsanitize=undefined -fno-omit-frame-pointer -Wall -W -D_REENTRANT -fPIC
-DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT
-DQT_NO_USING_NAMESPACE -DQT_BUILD_CORE_LIB -DQT_BUILDING_QT
-DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT
-DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS
-DQT_DISABLE_DEPRECATED_BEFORE=0x050000
-DELF_INTERPRETER=\"/lib64/ld-linux-x86-64.so.2\" -DQT_CORE_LIB
-D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I. -I../3rdparty/zlib
-I../../include -I../../include/QtCore -I../../include/QtCore/5.5.0
-I../../include/QtCore/5.5.0/QtCore -Iglobal -I../3rdparty/pcre
-I../3rdparty/harfbuzz/src -I../3rdparty/md5 -I../3rdparty/md4
-I../3rdparty/sha3 -I../3rdparty/forkfd -I.moc -I../../mkspecs/linux-g++ -o
.obj/qabstractanimation.o animation/qabstractanimation.cpp
{standard input}: Assembler messages:
{standard input}:129: Error: symbol `.Lubsan_type4' is already defined
make[3]: *** [.obj/qabstractanimation.o] Error 1
make[3]: Leaving directory
`/opt/qt/qt-everywhere-opensource-src-5.5.0-rc/qtbase/src/corelib'
make[2]: *** [sub-corelib-make_first] Error 2
make[2]: Leaving directory
`/opt/qt/qt-everywhere-opensource-src-5.5.0-rc/qtbase/src'
make[1]: *** [sub-src-make_first] Error 2
make[1]: Leaving directory
`/opt/qt/qt-everywhere-opensource-src-5.5.0-rc/qtbase'
make: *** [module-qtbase-make_first] Error 2

Also I see such output which is not stopping the build:
../../corelib/io/qiodevice_p.h:105:33: runtime error: null pointer passed
as argument 2, which is declared to never be null
/usr/include/x86_64-linux-gnu/bits/string3.h:51:71: runtime error: null
pointer passed as argument 2, which is declared to never be null
../../corelib/io/qiodevice_p.h:175:53: runtime error: null pointer passed
as argument 2, which is declared to never be null
/usr/include/x86_64-linux-gnu/bits/string3.h:57:72: runtime error: null
pointer passed as argument 2, which is declared to never be null
../../corelib/io/qfiledevice.cpp:564:42: runtime error: null pointer passed
as argument 1, which is declared to never be null
/usr/include/x86_64-linux-gnu/bits/string3.h:51:71: runtime error: null
pointer passed as argument 1, which is declared to never be null

I couldn't find solution how to fix it. Does anybody know how to build Qt
with sanitizers?

The same post on forum -
http://forum.qt.io/topic/55413/building-qt-5-5-0-rc-with-sanitizers

-- 
Best regards, Igor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150618/43139c9a/attachment.html>


More information about the Interest mailing list