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. QtConcurrent::run Access violation reading location

QtConcurrent::run Access violation reading location

Scheduled Pinned Locked Moved General and Desktop
36 Posts 2 Posters 15.4k Views 1 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #18

    Then are you sure your server is running and that you can make as much connection that you are trying ?

    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
    • B Offline
      B Offline
      bagipro
      wrote on last edited by
      #19

      Oh, i haven't server, i have only this code.
      And i don't click any buttons, i only run application and see errors

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #20

        Then I would :

        • First step: ensure the server is responding
        • Second step: try to access the server with one query
        • Third step: try with several queries in a row
        • Forth step: Try to parallelize your queries

        That might include refactoring your code so that for example you'll use QtConcurrent::map to call your function with all the queries from a QList rather than accessing them yourself

        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
        • B Offline
          B Offline
          bagipro
          wrote on last edited by
          #21

          I have more than 100 servers, i can't do it ;(
          But when i use 1 thread all works correctly. Sometimes some servers are disabled

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #22

            Then I would refactor the code so that it doesn't use a while loop. Create a QList of queries and either use map or mapped (depending on wether you return a value or not, I think you do return a value)

            That would leave the entire parallelization to Qt and you'll only have to worry about retrieving the data.

            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
            • B Offline
              B Offline
              bagipro
              wrote on last edited by
              #23

              !http://clip2net.com/clip/m0/1373740625-clip-47kb.png(1)!
              I launched it from debugger and i see it >_>
              So many bugs, its increases on 5-10 every second

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #24

                Did you try starting with only one thread ? And then parallelizing with two and only then more ?

                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
                • B Offline
                  B Offline
                  bagipro
                  wrote on last edited by
                  #25

                  Yes, i started in one thread. I found the bug in doRequest method.
                  I don't know, but he's somewhere in filing the request
                  But why? I do all correctly

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #26

                    In that case, you can always use a request known to work for testing that part of your code while debugging the request build part

                    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
                    • B Offline
                      B Offline
                      bagipro
                      wrote on last edited by
                      #27

                      I get critical exeption and warnings in
                      @loop.exec();@

                      And many warnings in
                      @QNetworkReply* reply = manager->get(QNetworkRequest(QUrl(url)));@

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #28

                        What are the exceptions and warnings ?

                        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
                        • B Offline
                          B Offline
                          bagipro
                          wrote on last edited by
                          #29

                          Those that are in the picture

                          1 Reply Last reply
                          0
                          • SGaistS Offline
                            SGaistS Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on last edited by
                            #30

                            Did you do a test with a more conventional setup ? I mean have a simple application that creates one QNetworkAccessManager, do one request and get the answer in a slot ?

                            Seeing that each time you have a RPC server not available warning, that leads me to think that there is something wrong when communicating with the servers.

                            Like I said before, start small, validate that one query works in a standard setup. Then once that is good, do the same with the "blocking" event loop and then only start multi-threading

                            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
                            • SGaistS Offline
                              SGaistS Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote on last edited by
                              #31

                              One other thing came to my mind: Since you are updating some data, why don't you have a class that does the job asynchronously and then emit the result ?

                              This might make you change the way you store your valid links but it might also end up in a cleaner system.

                              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
                              • B Offline
                                B Offline
                                bagipro
                                wrote on last edited by
                                #32

                                Yes, i test
                                @#include <QCoreApplication>
                                #include <QtNetwork/QNetworkAccessManager>
                                #include <QtNetwork/QNetworkReply>
                                #include <QTimer>
                                #include <QEventLoop>
                                #include <iostream>

                                int main(int argc, char *argv[])
                                {
                                QCoreApplication a(argc, argv);

                                QNetworkAccessManager manager;
                                QEventLoop loop;
                                QTimer timer;
                                timer.setSingleShot(true);
                                QObject::connect(&manager,SIGNAL(finished(QNetworkReply*)),&loop,SLOT(quit()));
                                QObject::connect(&timer,SIGNAL(timeout()),&loop,SLOT(quit()));
                                
                                QNetworkReply* reply = manager.get(QNetworkRequest(QUrl("http://www.yandex.ru/")));
                                timer.start(10000);
                                loop.exec&#40;&#41;;
                                
                                if(timer.isActive(&#41;)
                                {
                                    //std::cout << reply->readAll();
                                }
                                
                                return a.exec(&#41;;
                                

                                }@
                                And i get same errors. I will install windows in virlual machine, try to test app and say results

                                I have simply application, because i don't create any classes to work with received data

                                1 Reply Last reply
                                0
                                • B Offline
                                  B Offline
                                  bagipro
                                  wrote on last edited by
                                  #33

                                  I test application on new winxp system with gcc compiler and i haven't any errors...

                                  1 Reply Last reply
                                  0
                                  • SGaistS Offline
                                    SGaistS Offline
                                    SGaist
                                    Lifetime Qt Champion
                                    wrote on last edited by
                                    #34

                                    What's the difference with your current machine and that virtual machine ?

                                    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
                                    • B Offline
                                      B Offline
                                      bagipro
                                      wrote on last edited by
                                      #35

                                      I disabled many unnecessary serveces and used mingw (on my pc msvc2010)

                                      1 Reply Last reply
                                      0
                                      • B Offline
                                        B Offline
                                        bagipro
                                        wrote on last edited by
                                        #36

                                        @http://clip2net.com/clip/m0/1373919060-clip-13kb.png@
                                        Warnings if i use msvc compiler

                                        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