#7 kdevelop/projectmanagers/cmake/parser/cmakeprojectvisitor.cpp: 1989│ m_vars->insert(sast->outputVariable(), QStringList(sast->input().join(QChar(';')).toUpper())); 1990│ break; 1991│ case StringAst::ToLower: 1992│ m_vars->insert(sast->outputVariable(), QStringList(sast->input().join(QChar(';')).toLower())); 1993│ break; 1994│ case StringAst::Length: 1995│ m_vars->insert(sast->outputVariable(), QStringList(QString::number(sast->input().join(QChar(';')).count()))); 1996│ break; 1997│ case StringAst::Substring: 1998│ { 1999├> QString res=sast->input()[0]; 2000│ res=res.mid(sast->begin(), sast->length()); 2001│ m_vars->insert(sast->outputVariable(), QStringList(res)); 2002│ } break; 2003│ case StringAst::Strip: 2004│ m_vars->insert(sast->outputVariable(), QStringList( sast->string().trimmed() )); 2005│ break; 2006│ case StringAst::Random: { 2007│ QString alphabet=sast->string(), result; 2008│ for(int i=0; i<sast->length(); i++) 2009│ { #0 0x00007ffff48df037 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 #1 0x00007ffff48e2698 in __GI_abort () at abort.c:90 #2 0x00007ffff5c915c2 in qt_message_output (msgType=msgType@entry=QtFatalMsg, buf=0x7fff4c4a05b8 "ASSERT failure in QList<T>::operator[]: \"index out of range\", file /usr/include/qt4/QtCore/qlist.h, line 477") at global/qglobal.cpp:2347 #3 0x00007ffff5c91938 in qt_message(QtMsgType, const char *, typedef __va_list_tag __va_list_tag *) (msgType=msgType@entry=QtFatalMsg, msg=msg@entry=0x7ffff5dfb518 "ASSERT failure in %s: \"%s\", file %s, line %d", ap=ap@entry=0x7fff57ffa7a8) at global/qglobal.cpp:2393 #4 0x00007ffff5c91ac4 in qFatal (msg=msg@entry=0x7ffff5dfb518 "ASSERT failure in %s: \"%s\", file %s, line %d") at global/qglobal.cpp:2576 #5 0x00007ffff5c91aea in qt_assert_x (where=where@entry=0x7fffbed502a9 "QList<T>::operator[]", what=what@entry=0x7fffbed5025b "index out of range", file=file@entry=0x7fffbed4fc68 "/usr/include/qt4/QtCore/qlist.h", line=line@entry=477) at global/qglobal.cpp:2029 #6 0x00007fffbed1258f in QList<QString>::operator[] (this=this@entry=0x7fff57ffaa80, i=i@entry=0) at /usr/include/qt4/QtCore/qlist.h:477 #7 0x00007fffbed1dc87 in CMakeProjectVisitor::visit (this=0x7fff57ffbec0, sast=0x7fff4c3ba840) at kdevelop/projectmanagers/cmake/parser/cmakeprojectvisitor.cpp:1999 #8 0x00007fffbed27dfc in CMakeProjectVisitor::walk (this=this@entry=0x7fff57ffbec0, fc=..., line=19, line@entry=14, isClean=isClean@entry=false) at kdevelop/projectmanagers/cmake/parser/cmakeprojectvisitor.cpp:2364 #9 0x00007fffbed2893d in CMakeProjectVisitor::visit (this=0x7fff57ffbec0, fea=0x7fff4c407c70) at kdevelop/projectmanagers/cmake/parser/cmakeprojectvisitor.cpp:1856 #10 0x00007fffbed27dfc in CMakeProjectVisitor::walk (this=this@entry=0x7fff57ffbec0, fc=..., line=13, line@entry=1, isClean=isClean@entry=false) at kdevelop/projectmanagers/cmake/parser/cmakeprojectvisitor.cpp:2364 #11 0x00007fffbed298ed in CMakeProjectVisitor::visit (this=0x7fff57ffbec0, call=0x7fff4c399a30) at kdevelop/projectmanagers/cmake/parser/cmakeprojectvisitor.cpp:1275 #12 0x00007fffbed27dfc in CMakeProjectVisitor::walk (this=this@entry=0x7fff57ffbec0, fc=..., line=2, line@entry=1, isClean=isClean@entry=false) at kdevelop/projectmanagers/cmake/parser/cmakeprojectvisitor.cpp:2364 #13 0x00007fffbed298ed in CMakeProjectVisitor::visit (this=0x7fff57ffbec0, call=0x7fff4c390930) at kdevelop/projectmanagers/cmake/parser/cmakeprojectvisitor.cpp:1275 #14 0x00007fffbed27dfc in CMakeProjectVisitor::walk (this=this@entry=0x7fff57ffbec0, fc=..., line=3, line@entry=0, isClean=isClean@entry=true) at kdevelop/projectmanagers/cmake/parser/cmakeprojectvisitor.cpp:2364 #15 0x00007fffbed410ab in CMakeParserUtils::includeScript (file=..., parent=..., data=data@entry=0x7fff4c3a7008, sourcedir=..., env=...) at kdevelop/projectmanagers/cmake/parser/cmakeparserutils.cpp:185 #16 0x00007fffbd00edaa in CMakeManager::includeScript (this=this@entry=0x2bcdeb0, file=..., project=project@entry=0x8da5f0, dir=..., parent=...) at kdevelop/projectmanagers/cmake/cmakemanager.cpp:680 #17 0x00007fffbd014c36 in CMakeManager::parse (this=0x2bcdeb0, item=0x7fff4c4248e0) at kdevelop/projectmanagers/cmake/cmakemanager.cpp:764 #18 0x00007fffbd0167d0 in CMakeManager::parse (this=0x2bcdeb0, item=0x8c39e0) at kdevelop/projectmanagers/cmake/cmakemanager.cpp:950 #19 0x00007ffff215784b in KDevelop::ImportProjectJobPrivate::import (this=0x8c4d10, folder=<optimised out>) at kdevplatform/project/importprojectjob.cpp:53 #20 0x00007ffff21573f9 in QtConcurrent::RunFunctionTask<void>::run (this=0x8c47d0) at /usr/include/qt4/QtCore/qtconcurrentrunbase.h:134 #21 0x00007ffff5c8f55d in QThreadPoolThread::run (this=0xaa9a50) at concurrent/qthreadpool.cpp:107 #22 0x00007ffff5c9bbec in QThreadPrivate::start (arg=0xaa9a50) at thread/qthread_unix.cpp:338 #23 0x00007ffff3a8ff8e in start_thread (arg=0x7fff57ffd700) at pthread_create.c:311 #24 0x00007ffff49a1e1d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113 Reproducible: Always Steps to Reproduce: 1. include CQt4.cmake info main CMakelists.txt content of CQt4.cmake file: ---content-- find_package(Qt4 REQUIRED) include(${QT_USE_FILE}) set(QT_USE_QTNETWORK TRUE CACHE BOOL "The network module of Qt4.") set(QT_USE_QTOPENGL TRUE CACHE BOOL "The opengl module of Qt4.") set(QT_USE_QTSQL TRUE CACHE BOOL "The sql module of Qt4.") set(QT_USE_QTXML TRUE CACHE BOOL "The xml module of Qt4.") set(QT_USE_QTSVG TRUE CACHE BOOL "The svg module of Qt4.") set(QT_USE_QTTEST TRUE CACHE BOOL "The test module of Qt4.") set(QT_USE_QTDBUS TRUE CACHE BOOL "The dbus module of Qt4.") set(QT_USE_QTSCRIPT TRUE CACHE BOOL "The script module of Qt4.") set(QT_USE_QTWEBKIT TRUE CACHE BOOL "The webkit module of Qt4.") set(QT_USE_QTXMLPATTERNS TRUE CACHE BOOL "The xmlpattern module of Qt4.") set(QT_USE_PHONON TRUE CACHE BOOL "The phonon module of Qt4.") function(add_qt_object TGNAME OBJTYPE ...) set(list_ARGV_TMP "") set(list_ARGV ${ARGV}) list(REMOVE_AT list_ARGV 0) list(REMOVE_AT list_ARGV 0) string(TOUPPER ${OBJTYPE} OBJTYPE) set(list_UIS "") set(list_HDRS "") set(list_SRCS "") set(list_RSCS "") set(list_TRS "") set(extensions_H "h" "hpp" "h++" "hxx") include_directories(${CMAKE_CURRENT_BINARY_DIR}) foreach(object ${list_ARGV}) if(NOT IS_ABSOLUTE ${object}) string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" object ${object}) set(object ${CMAKE_CURRENT_SOURCE_DIR}/${object}) endif() set(meta_object 1) string(FIND ${object} "*" meta_object_position) if(${meta_object_position} EQUAL -1) string(FIND ${object} "?" meta_object_position) if(${meta_object_position} EQUAL -1) string(FIND ${object} "[" meta_object_position) if(${meta_object_position} EQUAL -1) string(FIND ${object} "]" meta_object_position) if(${meta_object_position} EQUAL -1) set(meta_object 0) endif() endif() endif() endif() if(meta_object) file(GLOB object ${object}) else() if(NOT EXISTS ${object}) get_filename_component(object_ext ${object} EXT) if(NOT "${object_ext}" STREQUAL .qm) message(FATAL_ERROR "Given object ${object} not found") endif() endif() endif() list(APPEND list_ARGV_TMP ${object}) endforeach() set(list_ARGV ${list_ARGV_TMP}) list(REMOVE_DUPLICATES list_ARGV) foreach(object ${list_ARGV}) if(IS_DIRECTORY ${object}) message(FATAL_ERROR "Given object ${object} is a directory") endif() get_filename_component(object_name ${object} NAME_WE) get_filename_component(object_ext ${object} EXT) string(LENGTH ${object_ext} object_ext_length) if(${object_ext_length} EQUAL 0) message(FATAL_ERROR "Given object ${object} has no extension") endif() if(("${object_ext}" STREQUAL ".h") OR ("${object_ext}" STREQUAL ".hpp") OR ("${object_ext}" STREQUAL ".h++") OR ("${object_ext}" STREQUAL ".hxx") ) if(EXISTS ${object}) list(APPEND list_HDRS ${object}) else() message(FATAL_ERROR "Given object ${object} not found") endif() elseif(("${object_ext}" STREQUAL ".c") OR ("${object_ext}" STREQUAL ".cpp") OR ("${object_ext}" STREQUAL ".c++") OR ("${object_ext}" STREQUAL ".cxx") ) foreach(extension ${extensions_H}) set(object_name_TMP "${CMAKE_CURRENT_SOURCE_DIR}/${object_name}.${extension}") if(EXISTS ${object_name_TMP}) list(APPEND list_HDRS ${object_name_TMP}) endif() endforeach() if(EXISTS ${object}) list(APPEND list_SRCS ${object}) else() message(FATAL_ERROR "Given object ${object} not found") endif() elseif("${object_ext}" STREQUAL ".ts") message(FATAL_ERROR "Given object ${object} is a translation's source - use add_qt_translate() instead") elseif("${object_ext}" STREQUAL ".ui") list(APPEND list_UIS ${object}) elseif("${object_ext}" STREQUAL ".qm") list(APPEND list_TRS ${object}) elseif("${object_ext}" STREQUAL ".qrs") list(APPEND list_RSCS ${object}) else() message(FATAL_ERROR "Unknown object ${object}!") endif() endforeach() set(list_HDRS_TMP ${list_HDRS}) set(list_HDRS "") foreach(object_name ${list_HDRS_TMP}) set(object_content "") set(object_position "") file(READ ${object_name} object_content) string(FIND "${object_content}" "Q_OBJECT" object_position) if(NOT ${object_position} EQUAL -1) list(APPEND list_HDRS ${object_name}) endif() endforeach() set(list_length) list(LENGTH list_UIS list_length) if(${list_length} GREATER 0) list(REMOVE_DUPLICATES list_UIS) list(SORT list_UIS) qt4_wrap_ui(${TGNAME}_UIS ${list_UIS}) endif() list(LENGTH list_HDRS list_length) if(${list_length} GREATER 0) list(REMOVE_DUPLICATES list_HDRS) list(SORT list_HDRS) qt4_wrap_cpp(${TGNAME}_MOCS ${list_HDRS}) endif() list(LENGTH list_SRCS list_length) if(${list_length} GREATER 0) list(REMOVE_DUPLICATES list_SRCS) list(SORT list_SRCS) endif() list(LENGTH list_RSCS list_length) if(${list_length} GREATER 0) list(REMOVE_DUPLICATES list_RSCS) list(SORT list_RSCS) qt4_add_resources(${TGNAME}_QRCS ${list_RSCS}) endif() list(LENGTH list_TRS list_length) if(${list_length} GREATER 0) list(REMOVE_DUPLICATES list_TRS) list(SORT list_TRS) endif() if(${OBJTYPE} STREQUAL EXECUTABLE) add_executable(${TGNAME} ${${TGNAME}_UIS} ${${TGNAME}_MOCS} ${${TGNAME}_QRCS} ${list_TRS} ${list_SRCS}) elseif(${OBJTYPE} STREQUAL LIBRARY) add_library(${TGNAME} SHARED ${${TGNAME}_UIS} ${${TGNAME}_MOCS} ${${TGNAME}_QRCS} ${list_TRS} ${list_SRCS}) else() message(FATAL_ERROR "unknown target type: ${OBJTYPE}") endif() target_link_libraries(${TGNAME} ${QT_LIBRARIES}) endfunction() function(add_qt_executable TGNAME ...) list(REMOVE_AT ARGV 0) add_qt_object(${TGNAME} EXECUTABLE ${ARGV}) endfunction() function(add_qt_library TGNAME ...) list(REMOVE_AT ARGV 0) add_qt_object(${TGNAME} LIBRARY ${ARGV}) endfunction() macro(add_qt_translate TRANSLATION_TG ...) set(ARG2) set(QOBJ_TRS_E "") set(QOBJ_TRS_NE "") set(QOBJ_SRCS "") set(extensions_H "h" "hpp" "h++" "hxx") set(ARGVS ${ARGV}) list(REMOVE_AT ARGVS 0) foreach(ARG ${ARGVS}) get_filename_component(ARG2 ${ARG} EXT) if("${ARG2}" STREQUAL ".ts") string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" ARG ${ARG}) set(ARG "${CMAKE_CURRENT_SOURCE_DIR}/${ARG}") if(EXISTS ${ARG}) list(APPEND QOBJ_TRS_E ${ARG}) else() list(APPEND QOBJ_TRS_NE ${ARG}) endif() get_filename_component(ARG2 ${ARG} PATH) execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${ARG2}) elseif("${ARG2}" STREQUAL ".qrc") # droping all resource files elseif("${ARG2}" STREQUAL ".qm") # droping all binary translation files else() file(GLOB ARG ${ARG}) foreach(ARG_SRC ${ARG}) if(("${ARG_SRC}" STREQUAL ".c") OR ("${ARG_SRC}" STREQUAL ".cpp") OR ("${ARG_SRC}" STREQUAL ".c++") OR ("${ARG_SRC}" STREQUAL ".cxx") ) get_filename_component(ARG2 ${ARG_SRC} NAME_WE) foreach(extension ${extensions_H}) set(object_name_TMP "${CMAKE_CURRENT_SOURCE_DIR}/${ARG2}.${extension}") if(EXISTS ${object_name_TMP}) list(APPEND QOBJ_SRCS ${object_name_TMP}) endif() endforeach() endif() get_filename_component(ARG_SRC ${ARG_SRC} ABSOLUTE) list(APPEND QOBJ_SRCS ${ARG_SRC}) endforeach() endif() endforeach() list(REMOVE_DUPLICATES QOBJ_SRCS) list(REMOVE_DUPLICATES QOBJ_TRS_E) list(REMOVE_DUPLICATES QOBJ_TRS_NE) if(EXISTS "${CMAKE_BINARY_DIR}/.create_translation.lock") qt4_create_translation(${TRANSLATION_TG} ${QOBJ_TRS_E} ${QOBJ_TRS_NE} ${QOBJ_SRCS}) else() set(list_length) list(LENGTH QOBJ_TRS_NE list_length) if(${list_length} GREATER 0) foreach(ARG ${QOBJ_TRS_NE}) string(REPLACE "${CMAKE_SOURCE_DIR}/" "" ARG ${ARG}) message(WARNING "Given object ${ARG} not found - type \"make translate\" in build's topdir") endforeach() else() qt4_add_translation(${TRANSLATION_TG} ${QOBJ_TRS_E}) endif() endif() endmacro() add_custom_target(translate WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${CMAKE_COMMAND} -E touch "${CMAKE_BINARY_DIR}/.create_translation.lock" COMMAND ${CMAKE_COMMAND} -E echo "-- Rebuilding for create tranlations..." COMMAND ${CMAKE_BUILD_TOOL} rebuild_cache COMMAND ${CMAKE_BUILD_TOOL} all COMMAND ${CMAKE_COMMAND} -E remove "${CMAKE_BINARY_DIR}/.create_translation.lock" COMMAND ${CMAKE_COMMAND} -E echo "-- Restoring default configuration..." COMMAND ${CMAKE_BUILD_TOOL} rebuild_cache COMMAND ${CMAKE_BUILD_TOOL} all ) --/content-- 2. add subdirectory src/ 3. add content of src/CMakelists.txt: ---content-- set(hellodata_DATA window.ui hellocl*.cpp ) set(hello_DATA main.cpp ) set(FILES_TS i10n/hello_en_GB.ts i10n/hello_en_US.ts ) # add_qt_library(hellodata ${hellodata_DATA}) # add_qt_translate(hello_TR ${FILES_TS} ${hello_DATA} ${hellodata_DATA}) # add_qt_executable(hello ${hello_DATA} ${hello_TR}) # target_link_libraries(hello hellodata) --/content-- 4. uncomment last 4 lines and press save button. Actual Results: Almost every time crash, sometimes I see on projects tree in src/: <wrong target>, but mainly I have a crash. Compiled from sources in Debug mode, master branch, HEAD on be9ac0281d379acab074c311c85f6d4cdd039e8a.
I have that problem too, using your setup. I'll have to dig further. Meanwhile, if you could reduce the use case it would be great.
It goes in string::substring... but this command doesn't exist in my cmake code.
Git commit 6368f5209fe2a35a3a165a0c9adfffc95256dce1 by Aleix Pol. Committed on 29/11/2013 at 01:03. Pushed by apol into branch '4.6'. Prevent crash M +1 -1 projectmanagers/cmake/parser/cmakeprojectvisitor.cpp http://commits.kde.org/kdevelop/6368f5209fe2a35a3a165a0c9adfffc95256dce1