Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt Creator crashes when I edit main.cpp
Forum Updated to NodeBB v4.3 + New Features

Qt Creator crashes when I edit main.cpp

Scheduled Pinned Locked Moved Unsolved General and Desktop
qt creator
28 Posts 12 Posters 9.6k Views 9 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    seubri
    wrote on 16 Aug 2016, 08:07 last edited by seubri
    #1

    Hi all,

    I just installed the Qt framework on my new laptop running Ubuntu 16.04 by using the online Qt Project online install tool. I loaded my project on Qt Creator (version: 4.0.3 based on Qt 5.7.0), everything seems to be working smoothly, except that Qt Creator crashes as soon as I start editing my main.cpp file. Strangely, that seems to only happen for the main.cpp file.

    When I run Qt Creator from the terminal, here is what I can read:
    (when I open my project: )
    SOFT ASSERT: "!binary.isEmpty()" in file /work/build/qt-creator/src/libs/utils/shellcommand.cpp, line 474
    (and as soon as I start editing the main.cpp file: )
    Segmentation fault (core dumped)*

    Anyone can help me fix this?

    T 1 Reply Last reply 4 Oct 2016, 14:42
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 16 Aug 2016, 20:20 last edited by
      #2

      Hi,

      Do you also get that if you start with a default project ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jerome_isAviable
        wrote on 17 Aug 2016, 04:16 last edited by
        #3

        Hi @seubri
        I think you can try to add information by paste the result back from strace qtcreator.
        "strace" is a command linux tool for track bugs by give maximum information log on process.
        I'm sure tis way some people here should be able to help you to find why this happen and maybe what to do for fix it.
        good luck

        1 Reply Last reply
        0
        • S Offline
          S Offline
          seubri
          wrote on 17 Aug 2016, 21:22 last edited by
          #4

          Hi @SGaist and @jerome_isAviable, thank you for your answers and trying to help.

          I do also get that if I start with a default project.

          If I run qtcreator with strace, here is a what I can read in the terminal:
          a bunch of lines that look like:
          poll([{fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=11, events=POLLIN}, {fd=21, events=POLLIN}, {fd=79, events=POLLIN}], 5, 10) = 1 ([{fd=5, revents=POLLIN}])
          read(5, "\1\0\0\0\0\0\0\0", 16) = 8
          write(7, "\1\0\0\0\0\0\0\0", 8) = 8

          and then at the end before it crashes:
          --- SIGSEGV {si_signo=SIGSEGV, si_code=SI_KERNEL, si_addr=0} ---
          +++ killed by SIGSEGV (core dumped) +++
          Segmentation fault (core dumped)

          and then I also get an error message from Ubuntu informing me that "the application strace has stopped unexpectedly".

          By the way, at first I thought the issue only happened with the file main.cpp, but now I have noticed that some other source files produce the same effect. For the moment I am content with editing those files in a basic text editor aside Qt Creator, but it's not ideal!

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 17 Aug 2016, 21:23 last edited by
            #5

            Strange… Can you test with Qt Creator 4.1RC ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • S Offline
              S Offline
              seubri
              wrote on 17 Aug 2016, 21:58 last edited by
              #6

              I just tested with Qt Creator 4.1RC, same problem :(

              1 Reply Last reply
              0
              • S Offline
                S Offline
                SGaist
                Lifetime Qt Champion
                wrote on 17 Aug 2016, 22:03 last edited by
                #7

                How did you install Qt exactly ? (meaning the complete process after you downloaded the installer)

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  seubri
                  wrote on 17 Aug 2016, 22:11 last edited by
                  #8

                  I tried two methods (and I get the same problem):

                  1. I downloaded the Qt framework online installer and just followed the instructions (I think Qt Creator is included in the "tools")
                  2. Without the Qt online installer: in a terminal, I did sudo apt-get install qt5-default and sudo apt-get install qtcreator. The version of Qt creator I got this way was a bit behind (maybe 3.5 or something), but anyway I get the same crashes.

                  To be honest, I think it's possible the problem is to blame on my Ubunntu OS more than Qt Creator, maybe. I'm just saying that because I have been experiencing other issues (Firefox crashes regularly for instance), but I have no clue what's going on.

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 17 Aug 2016, 22:48 last edited by
                    #9

                    Ok, then yes, it's definitely something Ubuntu specific if even their version of Qt Creator crashes.

                    Had any graphic driver update lately ?

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    1
                    • S Offline
                      S Offline
                      seubri
                      wrote on 18 Aug 2016, 03:21 last edited by
                      #10

                      Yeah, there's been issues with the graphics driver. Thanks for pointing me in that direction, I'll look into it and I'll come back here to write what I found.

                      1 Reply Last reply
                      0
                      • snowflake123S Offline
                        snowflake123S Offline
                        snowflake123
                        wrote on 23 Aug 2016, 11:06 last edited by
                        #11

                        Hello, i am observing the same behaviour on linux mint 18 Sarah (derived from Ubuntu 16.04). I did a clean OS install and upgraded all libraries to their latest version. Then installed the community version of QT 5.7, downloaded from the QT website. QTCreator version is 4.0.3.

                        I can open files in the text editor, but a soon as i type a single letter QT creator crashes. If i launch QTCreator from the command line i get a segmentation fault. The error is systematic and not random. Immediately after i type something QTCreater just vanishes.

                        The strace output isn't very helpful in identifying root cause. The seg fault is triggered by typing in the QTCreator text editor.

                        Any ideas?

                        1 Reply Last reply
                        0
                        • S Offline
                          S Offline
                          seubri
                          wrote on 24 Aug 2016, 05:14 last edited by
                          #12

                          Hi snowflake123, I have not solved the issue yet, so I'll be glad if you find a solution. I suspect the graphics driver is at fault, because this is not the only strange behavior I noticed on my OS and others seem to be related to graphics, but I haven't found a solution. My graphic card is nVidia GM107M [GeForce GTX 850M], do you have a similar one?

                          1 Reply Last reply
                          0
                          • snowflake123S Offline
                            snowflake123S Offline
                            snowflake123
                            wrote on 26 Aug 2016, 08:50 last edited by
                            #13

                            Hi, i have an integrated intel graphics card. lspci says that that it loaded the i915 driver for it.

                            I did some testing. I installed QT in a virtual machine (Linux Mint 17.3) as a workaround and it works. I observed no crash. Then i installed Mint 18 into a virtual machine, and installed QT 5.7 into that virtual machine. And... surprise! QTCreater did not crash after editing mainwindow.cpp. So it seems it must be something low level/hardware related.

                            Note: I wasn't able to get the guest additions running in Mint 18, so it was running software rendering mode.

                            1 Reply Last reply
                            0
                            • snowflake123S Offline
                              snowflake123S Offline
                              snowflake123
                              wrote on 31 Aug 2016, 09:18 last edited by snowflake123
                              #14

                              Updated to qtcreator 4.1.0. The problem persists. Attached myself with gdb to the QTCreator process and catched a segmentation fault.

                              Thread 1 "qtcreator" received signal SIGSEGV, Segmentation fault.
                              0x00007efd3409fe08 in QSortFilterProxyModel::parent(QModelIndex const&) const () from /home/node/qtcreator-4.1.0/bin/../lib/Qt/lib/libQt5Core.so.5

                              I then did a backtrace, see bellow. I do not have a symbol table, so i cannot include the locals in the backtrace. It seems glib is returning something it isnt supposed to.

                              (gdb) bt
                              #0 0x00007efd3409fe08 in QSortFilterProxyModel::parent(QModelIndex const&) const () from /home/node/qtcreator-4.1.0/bin/../lib/Qt/lib/libQt5Core.so.5
                              #1 0x00007efd3564efbb in QTreeView::isIndexHidden(QModelIndex const&) const () from /home/node/qtcreator-4.1.0/bin/../lib/Qt/lib/libQt5Widgets.so.5
                              #2 0x00007efd3565188f in QTreeView::visualRect(QModelIndex const&) const () from /home/node/qtcreator-4.1.0/bin/../lib/Qt/lib/libQt5Widgets.so.5
                              #3 0x00007efd355fbdfa in ?? () from /home/node/qtcreator-4.1.0/bin/../lib/Qt/lib/libQt5Widgets.so.5
                              #4 0x00007efd355fc70a in ?? () from /home/node/qtcreator-4.1.0/bin/../lib/Qt/lib/libQt5Widgets.so.5
                              #5 0x00007efd2c9b7b59 in ?? () from /home/node/qtcreator-4.1.0/lib/Qt/lib/libQt5XcbQpa.so.5
                              #6 0x00007efd2c9b82bb in ?? () from /home/node/qtcreator-4.1.0/lib/Qt/lib/libQt5XcbQpa.so.5
                              #7 0x00007efd2c9bc73c in ?? () from /home/node/qtcreator-4.1.0/lib/Qt/lib/libQt5XcbQpa.so.5
                              #8 0x00007efd2b4f9ece in ?? () from /home/node/qtcreator-4.1.0/lib/Qt/lib/libQt5DBus.so.5
                              #9 0x00007efd2b4fcc0e in ?? () from /home/node/qtcreator-4.1.0/lib/Qt/lib/libQt5DBus.so.5
                              #10 0x00007efd340f861a in QObject::event(QEvent
                              ) () from /home/node/qtcreator-4.1.0/bin/../lib/Qt/lib/libQt5Core.so.5
                              #11 0x00007efd353d952c in QApplicationPrivate::notify_helper(QObject
                              , QEvent*) () from /home/node/qtcreator-4.1.0/bin/../lib/Qt/lib/libQt5Widgets.so.5
                              #12 0x00007efd353e0220 in QApplication::notify(QObject*, QEvent*) () from /home/node/qtcreator-4.1.0/bin/../lib/Qt/lib/libQt5Widgets.so.5
                              #13 0x00007efd340cfae0 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /home/node/qtcreator-4.1.0/bin/../lib/Qt/lib/libQt5Core.so.5
                              #14 0x00007efd340d251b in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /home/node/qtcreator-4.1.0/bin/../lib/Qt/lib/libQt5Core.so.5
                              #15 0x00007efd3411cc53 in ?? () from /home/node/qtcreator-4.1.0/bin/../lib/Qt/lib/libQt5Core.so.5
                              #16 0x00007efd2fa491a7 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
                              #17 0x00007efd2fa49400 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
                              #18 0x00007efd2fa494ac in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
                              #19 0x00007efd3411d047 in QEventDispatcherGlib::processEvents(QFlagsQEventLoop::ProcessEventsFlag) () from /home/node/qtcreator-4.1.0/bin/../lib/Qt/lib/libQt5Core.so.5
                              #20 0x00007efd340cddca in QEventLoop::exec(QFlagsQEventLoop::ProcessEventsFlag) () from /home/node/qtcreator-4.1.0/bin/../lib/Qt/lib/libQt5Core.so.5
                              #21 0x00007efd340d5bad in QCoreApplication::exec() () from /home/node/qtcreator-4.1.0/bin/../lib/Qt/lib/libQt5Core.so.5
                              #22 0x0000000000409a2c in ?? ()
                              #23 0x00007efd32d86830 in __libc_start_main (main=0x406d60, argc=1, argv=0x7ffc1aa2fb48, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffc1aa2fb38)
                              at ../csu/libc-start.c:291
                              #24 0x000000000040a291 in ?? ()
                              #25 0x00007ffc1aa2fb38 in ?? ()
                              #26 0x000000000000001c in ?? ()
                              #27 0x0000000000000001 in ?? ()
                              #28 0x00007ffc1aa318b8 in ?? ()
                              #29 0x0000000000000000 in ?? ()**

                              1 Reply Last reply
                              0
                              • snowflake123S Offline
                                snowflake123S Offline
                                snowflake123
                                wrote on 1 Sept 2016, 15:01 last edited by
                                #15

                                This bug in arch linux looks very similar (Same backtrace).

                                I installed QT from the ubuntu repository (QTcreator 3.5.1) and it also crashes with the same backtrace.

                                1 Reply Last reply
                                0
                                • kshegunovK Offline
                                  kshegunovK Offline
                                  kshegunov
                                  Moderators
                                  wrote on 1 Sept 2016, 15:15 last edited by kshegunov 9 Jan 2016, 15:15
                                  #16

                                  I don't experience anything of the sort on debian. What kernels/window managers are you running?

                                  Read and abide by the Qt Code of Conduct

                                  1 Reply Last reply
                                  0
                                  • snowflake123S Offline
                                    snowflake123S Offline
                                    snowflake123
                                    wrote on 1 Sept 2016, 19:15 last edited by
                                    #17

                                    @kshegunov

                                    $ inxi -Fxz
                                    

                                    System: Host: node-Extensa-5620 Kernel: 4.4.0-21-generic x86_64 (64 bit gcc: 5.3.1)
                                    Desktop: Cinnamon 3.0.7 (Gtk 3.18.9-1ubuntu3.1) Distro: Linux Mint 18 Sarah
                                    Machine: System: Acer product: V5-131 v: V2.18
                                    Mobo: Acer model: Mimic v: Type2 - Board Version Bios: Acer v: V2.18 date: 09/02/2013
                                    CPU: Dual core Intel Celeron 1017U (-MCP-) cache: 2048 KB
                                    flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 6385
                                    clock speeds: max: 1600 MHz 1: 895 MHz 2: 811 MHz
                                    Graphics: Card: Intel 3rd Gen Core processor Graphics Controller bus-ID: 00:02.0
                                    Display Server: X.Org 1.18.3 drivers: intel (unloaded: fbdev,vesa) Resolution: 1366x768@60.02hz
                                    GLX Renderer: Mesa DRI Intel Ivybridge Mobile GLX Version: 3.0 Mesa 11.2.0 Direct Rendering: Yes
                                    Audio: Card Intel 7 Series/C210 Series Family High Definition Audio Controller
                                    driver: snd_hda_intel bus-ID: 00:1b.0
                                    Sound: Advanced Linux Sound Architecture v: k4.4.0-21-generic
                                    Network: Card-1: Broadcom NetLink BCM57785 Gigabit Ethernet PCIe driver: tg3 v: 3.137 bus-ID: 04:00.0
                                    IF: enp4s0f0 state: down mac: <filter>
                                    Card-2: Ralink RT5370 Wireless Adapter driver: rt2800usb v: 2.3.0 usb-ID: 002-087
                                    IF: wlxc83a35c800d3 state: N/A mac: N/A
                                    Drives: HDD Total Size: 1000.2GB (66.3% used) ID-1: /dev/sda model: TOSHIBA_MQ01ABD1 size: 1000.2GB
                                    Partition: ID-1: / size: 914G used: 615G (71%) fs: ext4 dev: /dev/dm-1
                                    ID-2: /boot size: 472M used: 60M (14%) fs: ext2 dev: /dev/sda1
                                    ID-3: swap-1 size: 3.21GB used: 0.03GB (1%) fs: swap dev: /dev/dm-3
                                    RAID: No RAID devices: /proc/mdstat, md_mod kernel module present
                                    Sensors: System Temperatures: cpu: 49.0C mobo: N/A
                                    Fan Speeds (in rpm): cpu: N/A
                                    Info: Processes: 278 Uptime: 20 days Memory: 1263.1/7803.9MB Init: systemd runlevel: 5 Gcc sys: 5.4.0
                                    Client: Shell (bash 4.3.421) inxi: 2.2.35

                                    I made some progress. In the arch linux bug report (link above) it is written that if he launches QTcreator as root the issue does not occur. So i tested it. Its true if i launch QTCreater as root it works flawlessly. No seg faults. This might be some sort of permission issue.

                                    I also made a second test, logged out and logged back in in software rendering mode (I was able to run QTCreator in a mint18 virtual machine in software rendering mode without the issue, see above).But in the host system, even in software rendering mode, qtcreator crashes. So this does does not seem to be a graphics driver issue as intially anticipated.

                                    kshegunovK 1 Reply Last reply 1 Sept 2016, 20:09
                                    0
                                    • snowflake123S snowflake123
                                      1 Sept 2016, 19:15

                                      @kshegunov

                                      $ inxi -Fxz
                                      

                                      System: Host: node-Extensa-5620 Kernel: 4.4.0-21-generic x86_64 (64 bit gcc: 5.3.1)
                                      Desktop: Cinnamon 3.0.7 (Gtk 3.18.9-1ubuntu3.1) Distro: Linux Mint 18 Sarah
                                      Machine: System: Acer product: V5-131 v: V2.18
                                      Mobo: Acer model: Mimic v: Type2 - Board Version Bios: Acer v: V2.18 date: 09/02/2013
                                      CPU: Dual core Intel Celeron 1017U (-MCP-) cache: 2048 KB
                                      flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 6385
                                      clock speeds: max: 1600 MHz 1: 895 MHz 2: 811 MHz
                                      Graphics: Card: Intel 3rd Gen Core processor Graphics Controller bus-ID: 00:02.0
                                      Display Server: X.Org 1.18.3 drivers: intel (unloaded: fbdev,vesa) Resolution: 1366x768@60.02hz
                                      GLX Renderer: Mesa DRI Intel Ivybridge Mobile GLX Version: 3.0 Mesa 11.2.0 Direct Rendering: Yes
                                      Audio: Card Intel 7 Series/C210 Series Family High Definition Audio Controller
                                      driver: snd_hda_intel bus-ID: 00:1b.0
                                      Sound: Advanced Linux Sound Architecture v: k4.4.0-21-generic
                                      Network: Card-1: Broadcom NetLink BCM57785 Gigabit Ethernet PCIe driver: tg3 v: 3.137 bus-ID: 04:00.0
                                      IF: enp4s0f0 state: down mac: <filter>
                                      Card-2: Ralink RT5370 Wireless Adapter driver: rt2800usb v: 2.3.0 usb-ID: 002-087
                                      IF: wlxc83a35c800d3 state: N/A mac: N/A
                                      Drives: HDD Total Size: 1000.2GB (66.3% used) ID-1: /dev/sda model: TOSHIBA_MQ01ABD1 size: 1000.2GB
                                      Partition: ID-1: / size: 914G used: 615G (71%) fs: ext4 dev: /dev/dm-1
                                      ID-2: /boot size: 472M used: 60M (14%) fs: ext2 dev: /dev/sda1
                                      ID-3: swap-1 size: 3.21GB used: 0.03GB (1%) fs: swap dev: /dev/dm-3
                                      RAID: No RAID devices: /proc/mdstat, md_mod kernel module present
                                      Sensors: System Temperatures: cpu: 49.0C mobo: N/A
                                      Fan Speeds (in rpm): cpu: N/A
                                      Info: Processes: 278 Uptime: 20 days Memory: 1263.1/7803.9MB Init: systemd runlevel: 5 Gcc sys: 5.4.0
                                      Client: Shell (bash 4.3.421) inxi: 2.2.35

                                      I made some progress. In the arch linux bug report (link above) it is written that if he launches QTcreator as root the issue does not occur. So i tested it. Its true if i launch QTCreater as root it works flawlessly. No seg faults. This might be some sort of permission issue.

                                      I also made a second test, logged out and logged back in in software rendering mode (I was able to run QTCreator in a mint18 virtual machine in software rendering mode without the issue, see above).But in the host system, even in software rendering mode, qtcreator crashes. So this does does not seem to be a graphics driver issue as intially anticipated.

                                      kshegunovK Offline
                                      kshegunovK Offline
                                      kshegunov
                                      Moderators
                                      wrote on 1 Sept 2016, 20:09 last edited by
                                      #18

                                      Well, I'm running a 4.6.4 kernel, but if I had to guess the graphics driver would be my top suspect (which is actually strengthened by your virtual machine experiment). Possibly some "security feature" of the distribution ... I remember that with Mint one has to manually edit an OS configuration file just to allow debuggers to attach.

                                      Read and abide by the Qt Code of Conduct

                                      1 Reply Last reply
                                      0
                                      • M Offline
                                        M Offline
                                        mjsurette
                                        wrote on 2 Sept 2016, 10:39 last edited by
                                        #19

                                        FWIW I'm running Ubuntu 16.04 with no issues on two machines. Nvidia graphics on one Intel on the other.

                                        I installed Qt with the offline installer at qt.io, not the distribution's version. You might want to try that.

                                        Mike

                                        1 Reply Last reply
                                        0
                                        • WinzW Offline
                                          WinzW Offline
                                          Winz
                                          wrote on 4 Oct 2016, 10:47 last edited by Winz 10 Apr 2016, 10:50
                                          #20

                                          Same problem with Qt5.7.0 off-line installer
                                          Mint 18 cinnamon 64 bits

                                          Graphics: Card-1: NVIDIA GF119 [NVS 315] bus-ID: 0f:00.0
                                          Card-2: NVIDIA GF119 [NVS 315] bus-ID: 28:00.0
                                          Display Server: X.Org 1.18.3 drivers: nouveau (unloaded: fbdev,vesa)
                                          Resolution: 1920x1200@59.95hz, 1920x1200@59.95hz, 1280x1024@60.02hz
                                          GLX Renderer: Gallium 0.4 on NVD9
                                          GLX Version: 3.0 Mesa 11.2.0 Direct Rendering: Yes

                                          kernel : 4.4.0-21-generic

                                          I noticed that the problem is due to the CppEditor plugin. If you uncheck it, it will not crash anymore

                                          1 Reply Last reply
                                          0

                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved