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. Segmentation fault while open a text file
Qt 6.11 is out! See what's new in the release blog

Segmentation fault while open a text file

Scheduled Pinned Locked Moved Solved General and Desktop
38 Posts 6 Posters 12.4k Views 5 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #12

    I will get this error. And i removed the line @jsulm .

    Here's a picture:
    https://1drv.ms/i/s!AqaeHLtTIsoIhOofMu8aGwHVDcerHA

    K 1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #13

      I have tested the example "Application" which is installed with Qt.

      There is the same errer while open a file, so it has nothing to do with my code!

      How can i fix that? I reinstalled Qt but the error is still there...

      K 1 Reply Last reply
      0
      • ? A Former User

        I have tested the example "Application" which is installed with Qt.

        There is the same errer while open a file, so it has nothing to do with my code!

        How can i fix that? I reinstalled Qt but the error is still there...

        K Offline
        K Offline
        koahnig
        wrote on last edited by
        #14

        @HenrikSt.

        What version of Qt do you have installed?
        From where did you install?
        What OS?
        What tool chain are you using?

        Vote the answer(s) that helped you to solve your issue(s)

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #15

          What version of Qt do you have installed? 5.7
          From where did you install? C: Standard path
          What OS? Windows 10 insider slow ring
          What tool chain are you using? I don't know actually

          K 1 Reply Last reply
          0
          • ? A Former User

            What version of Qt do you have installed? 5.7
            From where did you install? C: Standard path
            What OS? Windows 10 insider slow ring
            What tool chain are you using? I don't know actually

            K Offline
            K Offline
            koahnig
            wrote on last edited by
            #16

            @HenrikSt.

            @HenrikSt. said in Segmentation fault while open a text file:

            From where did you install? C: Standard path
            I meant from standard online installer or from some obscure place?
            Or even a self-compiled version?

            Tools is the compiler tool chain.
            Is it MinGW or a MSVS version?

            Vote the answer(s) that helped you to solve your issue(s)

            1 Reply Last reply
            0
            • ? Offline
              ? Offline
              A Former User
              wrote on last edited by
              #17

              Online installer from qt.io

              MinGw

              K 1 Reply Last reply
              0
              • ? A Former User

                Online installer from qt.io

                MinGw

                K Offline
                K Offline
                koahnig
                wrote on last edited by
                #18

                @HenrikSt.

                I guess you are using Qt creator as IDE, right?

                When you create a new Application, it will crash after compilation and linking?

                Goto "Tools"->"Options"->"Build&Run", check there the different tabs look out for warnings or errors.

                Vote the answer(s) that helped you to solve your issue(s)

                1 Reply Last reply
                0
                • ? Offline
                  ? Offline
                  A Former User
                  wrote on last edited by
                  #19

                  No, it is only crashing when I want to open a file into QTextEdit. I use the Application Example from Qt and my own written Application. Both crashes when I want to load a file :/

                  Yes, I am using Qt Creater IDE

                  Other applications are running well...

                  K 1 Reply Last reply
                  0
                  • ? A Former User

                    No, it is only crashing when I want to open a file into QTextEdit. I use the Application Example from Qt and my own written Application. Both crashes when I want to load a file :/

                    Yes, I am using Qt Creater IDE

                    Other applications are running well...

                    K Offline
                    K Offline
                    koahnig
                    wrote on last edited by
                    #20

                    @HenrikSt.

                    And what is the exact Application example which is also crashing?

                    Vote the answer(s) that helped you to solve your issue(s)

                    1 Reply Last reply
                    0
                    • ? Offline
                      ? Offline
                      A Former User
                      wrote on last edited by
                      #21

                      http://doc.qt.io/qt-5/qtwidgets-mainwindows-application-example.html

                      K 1 Reply Last reply
                      0
                      • ? Offline
                        ? Offline
                        A Former User
                        wrote on last edited by
                        #22

                        Any idea why it crashes while opening a file?

                        K 1 Reply Last reply
                        0
                        • ? A Former User

                          http://doc.qt.io/qt-5/qtwidgets-mainwindows-application-example.html

                          K Offline
                          K Offline
                          koahnig
                          wrote on last edited by
                          #23

                          @HenrikSt.

                          I have just loaded the project file C:\Qt\Examples\Qt-5.7\widgets\mainwindows\application\application.pro
                          as it is already on my machine. Compiled with MinGW and linked with Qt 5.7.1, all standard as from installation through online installer.
                          I have a win 10 64 bit running.

                          I did a compilation as debug and release. Both I can start from inside of creator with run command.

                          Vote the answer(s) that helped you to solve your issue(s)

                          1 Reply Last reply
                          0
                          • ? A Former User

                            Any idea why it crashes while opening a file?

                            K Offline
                            K Offline
                            koahnig
                            wrote on last edited by
                            #24

                            @HenrikSt. said in Segmentation fault while open a text file:

                            Any idea why it crashes while opening a file?

                            The release if I have simply opened one of the make files and it did not crash. It was loaded into application.

                            Is something wrong with the file you are trying to load?
                            You are starting the application directly from Qt creator?

                            Vote the answer(s) that helped you to solve your issue(s)

                            1 Reply Last reply
                            0
                            • ? Offline
                              ? Offline
                              A Former User
                              wrote on last edited by
                              #25

                              I don't think so because I saved the file with 'Application Example' and wanted to load that...

                              Yes, with Qt Creater.

                              In the error stands something like Dllnowunload
                              Is there a DLL missing?

                              I am using Windows 10 Insider. Is that the problem maybe?

                              K 1 Reply Last reply
                              0
                              • ? A Former User

                                I don't think so because I saved the file with 'Application Example' and wanted to load that...

                                Yes, with Qt Creater.

                                In the error stands something like Dllnowunload
                                Is there a DLL missing?

                                I am using Windows 10 Insider. Is that the problem maybe?

                                K Offline
                                K Offline
                                koahnig
                                wrote on last edited by koahnig
                                #26

                                @HenrikSt. said in Segmentation fault while open a text file:

                                I am using Windows 10 Insider. Is that the problem maybe?

                                Perhaps.

                                I thought you may have started directly and dlls are missing. However, you started from creator. There should be all in place.
                                AFAIK the normal file dialog from windows is started from Qt. Therefore, the dialog looks always the same as with other application on your windows.
                                Perhaps there is a change of the interface causing the crash. However, I know idea if this is really the case, but it looks like.

                                Vote the answer(s) that helped you to solve your issue(s)

                                1 Reply Last reply
                                0
                                • ? Offline
                                  ? Offline
                                  A Former User
                                  wrote on last edited by
                                  #27

                                  What is your idea?

                                  K kshegunovK 2 Replies Last reply
                                  0
                                  • ? A Former User

                                    What is your idea?

                                    K Offline
                                    K Offline
                                    koahnig
                                    wrote on last edited by koahnig
                                    #28

                                    @HenrikSt.

                                    The only idea I have is trying with an official standard version of Windows 10.
                                    I guess that MS has messed around with their dlls and something is broken for Qt and possibly other apps.

                                    As a last resort you may try to update Qt to latest 5.8.0 version. If you are lucky it may work there.

                                    Vote the answer(s) that helped you to solve your issue(s)

                                    1 Reply Last reply
                                    0
                                    • ? A Former User

                                      What is your idea?

                                      kshegunovK Offline
                                      kshegunovK Offline
                                      kshegunov
                                      Moderators
                                      wrote on last edited by
                                      #29

                                      I already suggested to use the non-native dialog. Additionally your crash is probably related to you holding a QObject in a QSharedPointer, get us the whole stack trace so we can investigate further. I advise against using QSharedPointer with QObjects exactly for this very same reason - object lifetime is uncontrollable.

                                      Read and abide by the Qt Code of Conduct

                                      K 1 Reply Last reply
                                      1
                                      • kshegunovK kshegunov

                                        I already suggested to use the non-native dialog. Additionally your crash is probably related to you holding a QObject in a QSharedPointer, get us the whole stack trace so we can investigate further. I advise against using QSharedPointer with QObjects exactly for this very same reason - object lifetime is uncontrollable.

                                        K Offline
                                        K Offline
                                        koahnig
                                        wrote on last edited by
                                        #30

                                        @kshegunov

                                        He has the same effect with one of the Qt examples.

                                        However, you are certainly right about non-native dialog.

                                        Vote the answer(s) that helped you to solve your issue(s)

                                        kshegunovK 1 Reply Last reply
                                        0
                                        • K koahnig

                                          @kshegunov

                                          He has the same effect with one of the Qt examples.

                                          However, you are certainly right about non-native dialog.

                                          kshegunovK Offline
                                          kshegunovK Offline
                                          kshegunov
                                          Moderators
                                          wrote on last edited by kshegunov
                                          #31

                                          @koahnig said in Segmentation fault while open a text file:

                                          However, you are certainly right about non-native dialog.

                                          Perhaps, but my prime culprit is the shared pointer (notice line 11 in the call stack from his screenshot).

                                          Read and abide by the Qt Code of Conduct

                                          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