Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-8128

segfault in 2.6 and master, while parsing template parameters in C++ code.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • Qt Creator 2.6.0
    • Qt Creator 2.6.0-rc
    • C/C++/Obj-C++ Support
    • None
    • OpenSUSE Linux 12.1
    • 795b884819cd19a25bb2b4c0664befbfedf52f7c

    Description

      Something in the commits between a1e3a5d and 2198fa9 has introduced a segfault
      in CPlusPlus::ClassOrNamespace::nestedType(CPlusPlus::name const*,
      CPlusPlus::ClassOrNamespace*). It happens at line 735, "_alreadyConsideredTemplates.contains(templId)".

      AMAOF this call goes in the AlreadyConsideredClassContainer::contains(), and reaches the line 65 in there (if (existingItem->isEqualTo(item))) before crashing (because existingItem is not accessible), but I guess the reason of the crash is the fact that templId is not fully constructed.

      In my particular case, templId describes an std::map<int, XX>, where XX is a local (internal to my project) typedef, that doesn't seem to get referenced correctly inside the templId data structure (the templId->templateArguments[1]._type is marked as <not accessible> in the debugger).

      This segfault is present in both 2.6 and master branch. I just discovered it
      as it happens at startup, upon reloading one of my most used sessions, while
      loading/parsing the current opened file (C++). If I remove the session
      configuration, I can start QtCreator correctly and I can load other files, but when loading this particular one (a rather large so no point in attaching it here), I get the crash again. 100% reproducible.

      I attach the backtraces as dumped by QtCreator, but I find them unuseable.

      NOTE: I am sure about the range of commits I indicate at the beginning because it was version a1e3a5d that I used without problem up until today to edit the exact same file that now makes QtCreator crash.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            erikv Erik Verbruggen
            tibirna Cristian Tibirna
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes