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. Why my program pauses at"int 3"again and again?
Forum Updated to NodeBB v4.3 + New Features

Why my program pauses at"int 3"again and again?

Scheduled Pinned Locked Moved Unsolved General and Desktop
11 Posts 6 Posters 1.5k Views 2 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.
  • M Offline
    M Offline
    mais
    wrote on last edited by
    #1

    When i run my program on debug mode and copy a folder it will pause on this
    0_1542611011383_591b6197-f040-4223-b575-de4afeed43f8-image.png
    0_1542611097998_966f2ddf-6e53-4fa1-b70d-303bb4812594-image.png
    if i click to go on it will pause here again and again

    If not debug mode it will crash
    0_1542611187282_976c8f49-a50c-4748-81fd-8d04d65e6d8e-image.png

    raven-worxR 1 Reply Last reply
    0
    • M mais

      When i run my program on debug mode and copy a folder it will pause on this
      0_1542611011383_591b6197-f040-4223-b575-de4afeed43f8-image.png
      0_1542611097998_966f2ddf-6e53-4fa1-b70d-303bb4812594-image.png
      if i click to go on it will pause here again and again

      If not debug mode it will crash
      0_1542611187282_976c8f49-a50c-4748-81fd-8d04d65e6d8e-image.png

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @mais
      QT version? compiler? platform?

      What folder are you traversing with your qmlfolderlistmodel? I don't see why QDirIterator should call a method from QtWebEngine...

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      M 1 Reply Last reply
      1
      • raven-worxR raven-worx

        @mais
        QT version? compiler? platform?

        What folder are you traversing with your qmlfolderlistmodel? I don't see why QDirIterator should call a method from QtWebEngine...

        M Offline
        M Offline
        mais
        wrote on last edited by
        #3

        @raven-worx said in Why my program pauses at"int 3"again and again?:

        platform

        qt5.10.1 msvc14.0 windows
        i havn't used FolderListModel,my qml call the c++ method to copy folder,when it run the "qfile::copy()"it will pause at int 3

        and if i run it on release mode everything is ok

        J.HilkJ 1 Reply Last reply
        0
        • M mais

          @raven-worx said in Why my program pauses at"int 3"again and again?:

          platform

          qt5.10.1 msvc14.0 windows
          i havn't used FolderListModel,my qml call the c++ method to copy folder,when it run the "qfile::copy()"it will pause at int 3

          and if i run it on release mode everything is ok

          J.HilkJ Online
          J.HilkJ Online
          J.Hilk
          Moderators
          wrote on last edited by
          #4

          @mais said in Why my program pauses at"int 3"again and again?:

          and if i run it on release mode everything is ok

          That is contradictory to your opening post

          If not debug mode it will crash

          did you change something?
          Can you share the ode of the function that was last called?


          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


          Q: What's that?
          A: It's blue light.
          Q: What does it do?
          A: It turns blue.

          M 1 Reply Last reply
          0
          • J.HilkJ J.Hilk

            @mais said in Why my program pauses at"int 3"again and again?:

            and if i run it on release mode everything is ok

            That is contradictory to your opening post

            If not debug mode it will crash

            did you change something?
            Can you share the ode of the function that was last called?

            M Offline
            M Offline
            mais
            wrote on last edited by mais
            #5

            @J.Hilk not change anything
            debug build&run it will crash
            debug build&debug run it will int3
            release build ok
            sorry i havn't expressed clearly

            code here

            bool ESFileUtil::copyDirectory(const QString &fromDir, const QString &toDir, bool coverFileIfExist) {
                QDir sourceDir(fromDir);
                QDir targetDir(toDir);
                if(!targetDir.exists()){
                    if(!targetDir.mkdir(targetDir.absolutePath()))
                        return false;
                }
            
                QFileInfoList fileInfoList = sourceDir.entryInfoList();
                foreach(QFileInfo fileInfo, fileInfoList){
                    if(fileInfo.fileName() == "." || fileInfo.fileName() == "..")
                        continue;
            
                    if(fileInfo.isDir()) {
                        if(!ESFileUtil::copyDirectory(fileInfo.filePath(),
                            targetDir.filePath(fileInfo.fileName()),
                            coverFileIfExist))
                            return false;
                    } else {
                        if (coverFileIfExist && targetDir.exists(fileInfo.fileName())) {
                            targetDir.remove(fileInfo.fileName());
                        }
                        if (!QFile::copy(fileInfo.filePath(), targetDir.filePath(fileInfo.fileName()))) {//crash here
                                return false;
                        }
                    }
                }
                return true;
            }
            
            JonBJ raven-worxR kshegunovK 3 Replies Last reply
            0
            • M mais

              @J.Hilk not change anything
              debug build&run it will crash
              debug build&debug run it will int3
              release build ok
              sorry i havn't expressed clearly

              code here

              bool ESFileUtil::copyDirectory(const QString &fromDir, const QString &toDir, bool coverFileIfExist) {
                  QDir sourceDir(fromDir);
                  QDir targetDir(toDir);
                  if(!targetDir.exists()){
                      if(!targetDir.mkdir(targetDir.absolutePath()))
                          return false;
                  }
              
                  QFileInfoList fileInfoList = sourceDir.entryInfoList();
                  foreach(QFileInfo fileInfo, fileInfoList){
                      if(fileInfo.fileName() == "." || fileInfo.fileName() == "..")
                          continue;
              
                      if(fileInfo.isDir()) {
                          if(!ESFileUtil::copyDirectory(fileInfo.filePath(),
                              targetDir.filePath(fileInfo.fileName()),
                              coverFileIfExist))
                              return false;
                      } else {
                          if (coverFileIfExist && targetDir.exists(fileInfo.fileName())) {
                              targetDir.remove(fileInfo.fileName());
                          }
                          if (!QFile::copy(fileInfo.filePath(), targetDir.filePath(fileInfo.fileName()))) {//crash here
                                  return false;
                          }
                      }
                  }
                  return true;
              }
              
              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by
              #6

              @mais
              Code in itself looks vaguely OK. But what is ESFileUtil::copyDirectory() as opposed to the FileUtil::copyDirectory() you show?

              Your backtrace shows it's dying in a QtWebEngine call, that's what I'd be looking at. Like @raven-worx said, why is that involved??

              1 Reply Last reply
              0
              • M mais

                @J.Hilk not change anything
                debug build&run it will crash
                debug build&debug run it will int3
                release build ok
                sorry i havn't expressed clearly

                code here

                bool ESFileUtil::copyDirectory(const QString &fromDir, const QString &toDir, bool coverFileIfExist) {
                    QDir sourceDir(fromDir);
                    QDir targetDir(toDir);
                    if(!targetDir.exists()){
                        if(!targetDir.mkdir(targetDir.absolutePath()))
                            return false;
                    }
                
                    QFileInfoList fileInfoList = sourceDir.entryInfoList();
                    foreach(QFileInfo fileInfo, fileInfoList){
                        if(fileInfo.fileName() == "." || fileInfo.fileName() == "..")
                            continue;
                
                        if(fileInfo.isDir()) {
                            if(!ESFileUtil::copyDirectory(fileInfo.filePath(),
                                targetDir.filePath(fileInfo.fileName()),
                                coverFileIfExist))
                                return false;
                        } else {
                            if (coverFileIfExist && targetDir.exists(fileInfo.fileName())) {
                                targetDir.remove(fileInfo.fileName());
                            }
                            if (!QFile::copy(fileInfo.filePath(), targetDir.filePath(fileInfo.fileName()))) {//crash here
                                    return false;
                            }
                        }
                    }
                    return true;
                }
                
                raven-worxR Offline
                raven-worxR Offline
                raven-worx
                Moderators
                wrote on last edited by
                #7

                @mais
                to me it looks looks like you are mixing up Qt binaries.
                Can you verify if all Qt libs which are loaded are correct?
                This can be done in QtCreator's Debug pane. There is a Modules view (which is by default hidden. To show Window -> Views -> Modules)

                --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                If you have a question please use the forum so others can benefit from the solution in the future

                1 Reply Last reply
                2
                • M mais

                  @J.Hilk not change anything
                  debug build&run it will crash
                  debug build&debug run it will int3
                  release build ok
                  sorry i havn't expressed clearly

                  code here

                  bool ESFileUtil::copyDirectory(const QString &fromDir, const QString &toDir, bool coverFileIfExist) {
                      QDir sourceDir(fromDir);
                      QDir targetDir(toDir);
                      if(!targetDir.exists()){
                          if(!targetDir.mkdir(targetDir.absolutePath()))
                              return false;
                      }
                  
                      QFileInfoList fileInfoList = sourceDir.entryInfoList();
                      foreach(QFileInfo fileInfo, fileInfoList){
                          if(fileInfo.fileName() == "." || fileInfo.fileName() == "..")
                              continue;
                  
                          if(fileInfo.isDir()) {
                              if(!ESFileUtil::copyDirectory(fileInfo.filePath(),
                                  targetDir.filePath(fileInfo.fileName()),
                                  coverFileIfExist))
                                  return false;
                          } else {
                              if (coverFileIfExist && targetDir.exists(fileInfo.fileName())) {
                                  targetDir.remove(fileInfo.fileName());
                              }
                              if (!QFile::copy(fileInfo.filePath(), targetDir.filePath(fileInfo.fileName()))) {//crash here
                                      return false;
                              }
                          }
                      }
                      return true;
                  }
                  
                  kshegunovK Offline
                  kshegunovK Offline
                  kshegunov
                  Moderators
                  wrote on last edited by
                  #8

                  That interrupt is ordinarily reserved for debuggers to trap breakpoints. But it's not clear, so let me reiterate:

                  1. What has WebEngine have to do with the code?
                  2. What is ESFileUtil and where does it come from?
                  3. The code you provided does not correspond the stack trace, can you explain?

                  Read and abide by the Qt Code of Conduct

                  M kshegunovK 2 Replies Last reply
                  1
                  • kshegunovK kshegunov

                    That interrupt is ordinarily reserved for debuggers to trap breakpoints. But it's not clear, so let me reiterate:

                    1. What has WebEngine have to do with the code?
                    2. What is ESFileUtil and where does it come from?
                    3. The code you provided does not correspond the stack trace, can you explain?
                    M Offline
                    M Offline
                    mais
                    wrote on last edited by
                    #9

                    @kshegunov
                    1.webengine do nothing with this code,i use webengine to show a url in the other module.the program really run this

                    if (!QFile::copy(fileInfo.filePath(), targetDir.filePath(fileInfo.fileName()))) {//crash here
                                        return false;
                                }
                    

                    and show the stack trace int the picture

                    WebEngineView{
                            webChannel: webc
                            id: webEngineView
                            anchors.fill: parent;
                            url:esLoginBridgeModel.i_nowUrl;
                            onLoadingChanged:{
                                if (loadRequest.status === WebEngineLoadRequest.LoadSucceededStatus ||
                                        loadRequest.status === WebEngineLoadRequest.LoadFailedStatus){
                                        if ( rectPreview.visible )
                                        {
                                            delay(200, function(){
                                                    previewGif.playing = false;
                                                    rectPreview.visible = false;
                                                  } )
                                        }
                                }
                            }
                        }
                    

                    they don't call each other
                    2.ESFileUtil is the func self name .i deleted es

                    1 Reply Last reply
                    0
                    • hskoglundH Offline
                      hskoglundH Offline
                      hskoglund
                      wrote on last edited by
                      #10

                      Hi, just guessing but maybe you need to call WebEngineView::grantFeaturePermission to get a security clearance for copying local files inside the web view.
                      You could also try creating a modal dialog box outside of the webview and do the qFile::copy() in that dialog box.

                      1 Reply Last reply
                      0
                      • kshegunovK kshegunov

                        That interrupt is ordinarily reserved for debuggers to trap breakpoints. But it's not clear, so let me reiterate:

                        1. What has WebEngine have to do with the code?
                        2. What is ESFileUtil and where does it come from?
                        3. The code you provided does not correspond the stack trace, can you explain?
                        kshegunovK Offline
                        kshegunovK Offline
                        kshegunov
                        Moderators
                        wrote on last edited by
                        #11

                        @kshegunov said in Why my program pauses at"int 3"again and again?:

                        The code you provided does not correspond the stack trace, can you explain? [Sic]

                        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