Bug 258703 - smokegen crashes while building qimageblitz bindings
Summary: smokegen crashes while building qimageblitz bindings
Status: RESOLVED FIXED
Alias: None
Product: bindings
Classification: Developer tools
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: kde-bindings
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-03 16:42 UTC by Bernhard Rosenkraenzer
Modified: 2010-12-14 20:40 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
valgrind 3.4.1 output (18.38 KB, application/octet-stream)
2010-12-07 21:11 UTC, Bernhard Rosenkraenzer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bernhard Rosenkraenzer 2010-12-03 16:42:55 UTC
Version:           unspecified (using KDE 4.5.80) 
OS:                Linux

When building kdebindings trunk, the build process segfaults while running

generator/bin/smokegen -config .../smoke/qt/qimageblitz/../qtcore/config.xml -smokeconfig .../smoke/qt/qimageblitz/smokeconfig-xml -I /usr/include/qimageblitz/ -- .../smoke/qt/qimageblitz/qimageblitz_includes.h


Reproducible: Always

Steps to Reproduce:
Compile kdebindings

Actual Results:  
Crash

Expected Results:  
Builds

Backtrace from running smokegen with the same parameters in gdb:

using generator ".../generator/bin/generator_smoke.so"
parsing ".../smoke/qt/qimageblitz/qimageblitz_includes.h"

Program received signal SIGSEGV, Segmentation fault.
#0 ... in ?? () from /usr/lib64/qt4/lib64/libQtCore.so.4
#1 ... in QString::toUtf8() const () from /usr/lib64/qt4/lib64/libQtCore.so.4
#2 ... in IndexedString::byteArray (this=<value optimized out>) at .../generator/parser/indexedstring.cpp:203
#3 ... in stringFromContents (contents=<value optimized out>, count=141678) at .../generator/parser/rpp/chartools.cpp:65
#4 ... in lineFromContents (contents=<value optimized out>, lineNumber=<value optimized out>) at .../generator/parser/rpp/chartools.cpp:56
#5 ... in Parser::reportError ... at .../generator/parser/parser.cpp:372
#6 ... in Parser::syntaxError ... at .../generator/parser/parser.cpp:339
#7 ... in Parser::parseDeclarationInternal ... at .../generator/parser/parser.cpp:3584
#8 ... in Parser::parseDeclaration ... at .../generator/parser/parser.cpp:712
#9 ... in Parser::parseTranslationUnit ... at .../generator/parser/parser.cpp:613
#10 ... in Parser::parse ... at .../generator/parser/parser.cpp:192
#11 ... in main ... at .../generator/main.cpp:222
Comment 1 Philip Muškovac 2010-12-07 16:33:49 UTC
Confirmed on kubuntu. Both trunk and 4.5.85 fail with that.
Comment 2 Milian Wolff 2010-12-07 16:42:50 UTC
you should run that through valgrind and show the log it produces

valgrind --track-origins=yes --num-callers=25
Comment 3 Raphael Kubo da Costa 2010-12-07 16:49:02 UTC
This crash is currently worked around on FreeBSD with the following patch (wasn't written by me):

--- ./smoke/qt/qimageblitz/qimageblitz_includes.h.orig	2010-12-02 23:13:59.013157174 +1000
+++ ./smoke/qt/qimageblitz/qimageblitz_includes.h	2010-12-02 23:14:13.726155614 +1000
@@ -2,6 +2,7 @@
 #  define QIMAGEBLITZ_EXPORT
 #endif
 
+#include <QtCore>
 #include <qimageblitz.h>
 
 #include <qglobal.h>
Comment 4 Bernhard Rosenkraenzer 2010-12-07 17:22:52 UTC
For some reason, it doesn't crash in valgrind here (but it does still crash when run outside of valgrind).


The FreeBSD workaround works here on Ark Linux as well.
Comment 5 Milian Wolff 2010-12-07 17:58:04 UTC
that it doesn't crash is ok, but does it also not output *anything* (i.e. the usual warnings about access of uninitialized memory or similar)?
Comment 6 Bernhard Rosenkraenzer 2010-12-07 21:11:45 UTC
Created attachment 54271 [details]
valgrind 3.4.1 output

Valgrind 3.4.1 produces LOTS of errors (this time it even reproduced the crash), but most of them are in glibc, and from a quick look the remaining ones don't add much new on top of what gdb already said -- attaching its output (gzip-ed because of its size) anyway.

Valgrind 3.6.0 runs into instructions it doesn't know about:
vex amd64->IR: unhandled instruction bytes: 0x66 0xF 0x38 0x10 0xD1 0x66
Process terminating with default action of signal 4 (SIGILL)
Illegal opcode at address 0x6021EC3
at 0x6021EC3: __m128i_strloadu_tolower_posix (in /lib64/libc-2.12.1.so)
by 0x6022098: __strcasestr_sse42 (in /lib64/libc-2.12.1.so)
Comment 7 Arno Rehn 2010-12-14 20:40:14 UTC
This is now fixed in trunk.