Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved Code running in 5.12, but not in 5.15 or higher

    General and Desktop
    3
    5
    128
    Loading More Posts
    • 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.
    • T
      Thomas 63 last edited by

      Hello

      I generate code in Qt Creator 4.14.2
      My code did run in all older Versions up to 5.12.4
      But when I use it in 5.15.2 or 6.0.1, it does compile but crashes with the following message:

      ---------------------------
      Signal erhalten
      ---------------------------
      <p>Der Prozess wurde wegen eines Signals vom Betriebssystem angehalten.<p><table><tr><td>Name des Signals : </td><td>SIGSEGV</td></tr><tr><td>Bedeutung : </td><td>Segmentation fault</td></tr></table>
      ---------------------------
      OK   
      ---------------------------
      

      It crashes in the line

      ui->setupUi(this);
      

      In mainwindow.cpp
      What can i do to avoid this?

      Thanks,

      Thomas

      jsulm 1 Reply Last reply Reply Quote 0
      • jsulm
        jsulm Lifetime Qt Champion @Thomas 63 last edited by

        @Thomas-63 said in Code running in 5.12, but not in 5.15 or higher:

        What can i do to avoid this?

        Please post the stack trace after crash.

        Also, did you completely rebuild your project after switching to other Qt version?

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 0
        • T
          Thomas 63 last edited by

          Is this the stack trace?

          0x4014b0                  48 83 ec 28                    sub    $0x28,%rsp
          0x4014b4  <+    4>        48 8b 05 05 af 53 00           mov    0x53af05(%rip),%rax        # 0x93c3c0 <.refptr.mingw_app_type>
          0x4014bb  <+   11>        c7 00 01 00 00 00              movl   $0x1,(%rax)
          0x4014c1  <+   17>        e8 aa aa 25 00                 callq  0x65bf70 <__security_init_cookie>
          0x4014c6  <+   22>        e8 b5 fc ff ff                 callq  0x401180 <__tmainCRTStartup>
          0x4014cb  <+   27>        90                             nop
          0x4014cc  <+   28>        90                             nop
          0x4014cd  <+   29>        48 83 c4 28                    add    $0x28,%rsp
          0x4014d1  <+   33>        c3                             retq
          0x4014d2  <+   34>        0f 1f 40 00                    nopl   0x0(%rax)
          0x4014d6  <+   38>        66 2e 0f 1f 84 00 00 00 00 00  nopw   %cs:0x0(%rax,%rax,1)
          

          or this?

          1 QWidget::raise()                            0x3207c70 
          2 Ui_MainWindow::setupUi ui_mainwindow.h 2602 0x6e3664  
          3 MainWindow::MainWindow mainwindow.cpp  74   0x403f6f  
          4 qMain                  main.cpp        8    0x4015ac  
          5 WinMain                qtmain_win.cpp  97   0x65d41d  
          6 __tmainCRTStartup                           0x4013c7  
          7 WinMainCRTStartup                           0x4014cb  
          
          

          Yes. I made a rebuild of the project

          1 Reply Last reply Reply Quote 0
          • Christian Ehrlicher
            Christian Ehrlicher Lifetime Qt Champion last edited by

            Simplify your code until it no longer crashes. Doesn't look to hard to track down the issues since it's directly in the ctor. I would guess 'ui' is not initialized but without code it's just a wild guess.

            Qt has to stay free or it will die.

            1 Reply Last reply Reply Quote 0
            • T
              Thomas 63 last edited by

              It is solved - I had to find some updates for external libraries and the problem was gone.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post