Results 1 to 3 of 3

Thread: Application closed after QNetworkManager::get (Release, after deployment by mingw32)

  1. #1
    Join Date
    Sep 2014
    Posts
    5
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Application closed after QNetworkManager::get (Release, after deployment by mingw32)

    Hi guys.

    I've got issue as in topic, after deployment (I used windeployqt) my application
    exits immediately when QNetworkManager::get() method is called.
    That problem occurs on only one computer.

    Qt Code:
    1. this->_versionUrl = url.value(key).toString();
    2. ...
    3. this->_versionRequest.setUrl(QUrl(this->_versionUrl));
    4. ...
    5. void Patcher::request(const QNetworkRequest &request)
    6. {
    7. this->log(tr("Starting request: %1").arg(request.url().toString()));
    8. this->_reply = this->_manager->get(request);
    9. this->log(tr("After GET"));
    10.  
    11. this->connect(this->_reply, SIGNAL(error(QNetworkReply::NetworkError)),
    12. this, SLOT(error(QNetworkReply::NetworkError)));
    13.  
    14. this->connect(this->_reply, SIGNAL(finished()),
    15. this, SLOT(finished()));
    16.  
    17. this->connect(this->_reply, SIGNAL(downloadProgress(qint64,qint64)),
    18. this, SLOT(updateProgressBar(qint64,qint64)));
    19. }
    To copy to clipboard, switch view to plain text mode 

    When I run my application directly after compilation, everything works fine.

    My deployment folder contains following files:

    Qt Code:
    1. │ icudt53.dll
    2. │ icuin53.dll
    3. │ icuuc53.dll
    4. │ libgcc_s_dw2-1.dll
    5. │ libstdc++-6.dll
    6. │ libwinpthread-1.dll
    7. │ patcher.ini
    8. │ Qt5Core.dll
    9. │ Qt5Gui.dll
    10. │ Qt5Network.dll
    11. │ Qt5SerialPort.dll
    12. │ Qt5Svg.dll
    13. │ Qt5Widgets.dll
    14. │ qt_ca.qm
    15. │ qt_cs.qm
    16. │ qt_de.qm
    17. │ qt_fi.qm
    18. │ qt_hu.qm
    19. │ qt_it.qm
    20. │ qt_ja.qm
    21. │ qt_lv.qm
    22. │ qt_ru.qm
    23. │ qt_sk.qm
    24. │ qt_uk.qm
    25. │ quazip.dll
    26. │ MyApp.exe
    27. │ updater.log
    28. │ zlib1.dll
    29. │
    30. ├───bearer
    31. │ qgenericbearer.dll
    32. │ qnativewifibearer.dll
    33. │
    34. ├───iconengines
    35. │ qsvgicon.dll
    36. │
    37. ├───imageformats
    38. │ qdds.dll
    39. │ qgif.dll
    40. │ qicns.dll
    41. │ qico.dll
    42. │ qjp2.dll
    43. │ qjpeg.dll
    44. │ qmng.dll
    45. │ qsvg.dll
    46. │ qtga.dll
    47. │ qtiff.dll
    48. │ qwbmp.dll
    49. │ qwebp.dll
    50. │
    51. ├───platforms
    52. │ qminimal.dll
    53. │ qoffscreen.dll
    54. │ qwindows.dll
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Dec 2009
    Location
    New Orleans, Louisiana
    Posts
    791
    Thanks
    13
    Thanked 153 Times in 150 Posts
    Qt products
    Qt5
    Platforms
    MacOS X

    Default Re: Application closed after QNetworkManager::get (Release, after deployment by mingw

    What is the contents of the _reply member variable after the get request?

    Also:

    • Can you show the code for your error, finished, and updateProgressBar slots?
    • What is the stack trace after the crash?

  3. #3
    Join Date
    Sep 2014
    Posts
    5
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: Application closed after QNetworkManager::get (Release, after deployment by mingw

    Can you show the code for your error, finished, and updateProgressBar slots?
    Qt Code:
    1. void Patcher::log(const QString &state)
    2. {
    3. QFile logFile("updater.log");
    4. QTextStream stream(&logFile);
    5. if (logFile.open(QIODevice::WriteOnly | QIODevice::Append | QIODevice::Text))
    6. {
    7. stream << QDateTime::currentDateTime().toString("dd.MM.yyyy:hh:mm:ss.zzz")
    8. << " " << state
    9. << " pId: " << qApp->applicationPid()
    10. << "\n";
    11. logFile.close();
    12. }
    13. }
    14. void Patcher::error(QNetworkReply::NetworkError)
    15. {
    16. this->log(this->_reply->errorString());
    17. exit(-2);
    18. }
    19. void Patcher::finished()
    20. {
    21. this->log(tr("Reply finished. Url: %1").arg(this._reply->url().toString()));
    22. ...
    23. QByteArray versionData = this->_reply->readAll();
    24. // some processing inside
    25. }
    26. void Patcher::updateProgressBar(qint64 read, qint64 total)
    27. {
    28. this->log(tr("Uptade progress bar %1 / %2")
    29. .arg(QString::number(read))
    30. .arg(QString::number(total)));
    31.  
    32. this->ui->progressBar->setMaximum(total);
    33. this->ui->progressBar->setValue(read);
    34. }
    To copy to clipboard, switch view to plain text mode 

    What is the stack trace after the crash?
    It doesn't crash the application. App simple turns off when QNAM get is requested.
    I've added Google Breakpad into my project from following tutorial:
    https://github.com/JPNaude/dev_notes...eakpad-with-Qt
    And it doesn't create any minidump file.
    Last log from "updater.log" is "Starting request: http://url.to.my/web/page.file".

    PS. On mine machine and some VMs problem has no occured.
    Last edited by zavafoj; 26th January 2015 at 14:23.

Similar Threads

  1. QWidget forced the application closed
    By cic in forum Newbie
    Replies: 0
    Last Post: 27th June 2013, 18:41
  2. Replies: 6
    Last Post: 24th April 2011, 10:56
  3. Application deployment on Mac OS X (10.5)
    By ghorwin in forum Installation and Deployment
    Replies: 1
    Last Post: 11th March 2010, 15:38
  4. Mac OS X and closed source apps deployment?
    By 0xl33t in forum Installation and Deployment
    Replies: 3
    Last Post: 10th July 2009, 10:30
  5. Qt 4.1.3 application Deployment
    By sivaganesan in forum Installation and Deployment
    Replies: 1
    Last Post: 24th July 2008, 18:15

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.