Page 1 of 2 12 LastLast
Results 1 to 20 of 21

Thread: Simplest app with QNetworkAccessManager and First-chance exception

  1. #1
    Join Date
    Jan 2013
    Posts
    11
    Qt products
    Qt4 Qt5
    Platforms
    Windows Android

    Default Simplest app with QNetworkAccessManager and First-chance exception

    Hi all,

    I have created the simplest Qt (5.0.0) application using VS Add-in.
    Added the simplest network request:

    test.h
    Qt Code:
    1. #ifndef TEST_H
    2. #define TEST_H
    3.  
    4. #include <QtWidgets/QMainWindow>
    5. #include <QtNetwork>
    6. #include "ui_test.h"
    7.  
    8. class Test : public QMainWindow
    9. {
    10. Q_OBJECT
    11.  
    12. public:
    13. Test(QWidget *parent = 0);
    14. ~Test();
    15.  
    16. public slots:
    17. void Button_clicked();
    18. void Request_finished(QNetworkReply *reply);
    19.  
    20. private:
    21. Ui::TestClass ui;
    22. };
    23.  
    24. #endif // TEST_H
    To copy to clipboard, switch view to plain text mode 

    test.cpp
    Qt Code:
    1. #include "test.h"
    2. #include <QtWidgets>
    3.  
    4. Test::Test(QWidget *parent)
    5. : QMainWindow(parent)
    6. {
    7. ui.setupUi(this);
    8. QObject::connect(ui.pushButton, SIGNAL(clicked()), this, SLOT(Button_clicked()));
    9.  
    10. }
    11.  
    12. Test::~Test()
    13. {
    14.  
    15. }
    16.  
    17. void Test::Button_clicked()
    18. {
    19. QNetworkAccessManager* manager = new QNetworkAccessManager(this);
    20.  
    21. QObject::connect(manager, SIGNAL(finished(QNetworkReply *)), this, SLOT(Request_finished(QNetworkReply *)));
    22.  
    23. QNetworkRequest request(QUrl("http://www.google.com"));
    24.  
    25. QNetworkReply *reply = manager->get(request);
    26. }
    27.  
    28. void Test::Request_finished(QNetworkReply *reply)
    29. {
    30. reply->deleteLater();
    31. }
    To copy to clipboard, switch view to plain text mode 

    main.cpp
    Qt Code:
    1. #include "test.h"
    2. #include "qmyapp.h"
    3.  
    4. int main(int argc, char *argv[])
    5. {
    6. QApplication a(argc, argv);
    7. Test w;
    8. w.show();
    9. return a.exec();
    10. }
    To copy to clipboard, switch view to plain text mode 

    test.ui contains a single QPushButton pushButton.

    Now if I start application and press button, then after main window destroyed I receive the following line in VS Output window:

    First-chance exception at 0x74e5b9bc in Test.exe: 0x0000000D: The data is invalid.

    What's wrong?
    Thank you.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Simplest app with QNetworkAccessManager and First-chance exception

    Show us the debugger backtrace.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jan 2013
    Posts
    11
    Qt products
    Qt4 Qt5
    Platforms
    Windows Android

    Default Re: Simplest app with QNetworkAccessManager and First-chance exception

    Quote Originally Posted by wysota View Post
    Show us the debugger backtrace.
    Qt Code:
    1. 'Test.exe': Loaded 'W:\BB\Intaview\Test\Win32\Debug\Test.exe', Symbols loaded.
    2. 'Test.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file
    3. 'Test.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file
    4. 'Test.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file
    5. 'Test.exe': Loaded 'W:\Qt\5.0.0\msvc2010\bin\Qt5Cored.dll', Cannot find or open the PDB file
    6. 'Test.exe': Loaded 'C:\Windows\SysWOW64\user32.dll', Cannot find or open the PDB file
    7. 'Test.exe': Loaded 'C:\Windows\SysWOW64\gdi32.dll', Cannot find or open the PDB file
    8. 'Test.exe': Loaded 'C:\Windows\SysWOW64\lpk.dll', Cannot find or open the PDB file
    9. 'Test.exe': Loaded 'C:\Windows\SysWOW64\usp10.dll', Cannot find or open the PDB file
    10. 'Test.exe': Loaded 'C:\Windows\SysWOW64\msvcrt.dll', Cannot find or open the PDB file
    11. 'Test.exe': Loaded 'C:\Windows\SysWOW64\advapi32.dll', Cannot find or open the PDB file
    12. 'Test.exe': Loaded 'C:\Windows\SysWOW64\sechost.dll', Cannot find or open the PDB file
    13. 'Test.exe': Loaded 'C:\Windows\SysWOW64\rpcrt4.dll', Cannot find or open the PDB file
    14. 'Test.exe': Loaded 'C:\Windows\SysWOW64\sspicli.dll', Cannot find or open the PDB file
    15. 'Test.exe': Loaded 'C:\Windows\SysWOW64\cryptbase.dll', Cannot find or open the PDB file
    16. 'Test.exe': Loaded 'C:\Windows\SysWOW64\ole32.dll', Cannot find or open the PDB file
    17. 'Test.exe': Loaded 'C:\Windows\SysWOW64\ws2_32.dll', Cannot find or open the PDB file
    18. 'Test.exe': Loaded 'C:\Windows\SysWOW64\nsi.dll', Cannot find or open the PDB file
    19. 'Test.exe': Loaded 'W:\Qt\5.0.0\msvc2010\bin\icuin49.dll', Binary was not built with debug information.
    20. 'Test.exe': Loaded 'W:\Qt\5.0.0\msvc2010\bin\icuuc49.dll', Binary was not built with debug information.
    21. 'Test.exe': Loaded 'W:\Qt\5.0.0\msvc2010\bin\icudt49.dll', Binary was not built with debug information.
    22. 'Test.exe': Loaded 'C:\Windows\SysWOW64\msvcr100.dll', Cannot find or open the PDB file
    23. 'Test.exe': Loaded 'C:\Windows\SysWOW64\msvcp100.dll', Cannot find or open the PDB file
    24. 'Test.exe': Loaded 'C:\Windows\SysWOW64\msvcp100d.dll', Symbols loaded.
    25. 'Test.exe': Loaded 'C:\Windows\SysWOW64\msvcr100d.dll', Symbols loaded.
    26. 'Test.exe': Loaded 'W:\Qt\5.0.0\msvc2010\bin\Qt5Widgetsd.dll', Cannot find or open the PDB file
    27. 'Test.exe': Loaded 'C:\Windows\SysWOW64\shell32.dll', Cannot find or open the PDB file
    28. 'Test.exe': Loaded 'C:\Windows\SysWOW64\shlwapi.dll', Cannot find or open the PDB file
    29. 'Test.exe': Loaded 'W:\Qt\5.0.0\msvc2010\bin\Qt5Guid.dll', Cannot find or open the PDB file
    30. 'Test.exe': Loaded 'W:\Qt\5.0.0\msvc2010\bin\libGLESv2d.dll', Cannot find or open the PDB file
    31. 'Test.exe': Loaded 'W:\Qt\5.0.0\msvc2010\bin\D3DCompiler_43.dll', Cannot find or open the PDB file
    32. 'Test.exe': Loaded 'W:\Qt\5.0.0\msvc2010\bin\Qt5Networkd.dll', Cannot find or open the PDB file
    33. 'Test.exe': Loaded 'C:\Windows\SysWOW64\dnsapi.dll', Cannot find or open the PDB file
    34. 'Test.exe': Loaded 'C:\Windows\SysWOW64\crypt32.dll', Cannot find or open the PDB file
    35. 'Test.exe': Loaded 'C:\Windows\SysWOW64\msasn1.dll', Cannot find or open the PDB file
    36. 'Test.exe': Loaded 'C:\Windows\SysWOW64\imm32.dll', Cannot find or open the PDB file
    37. 'Test.exe': Loaded 'C:\Windows\SysWOW64\msctf.dll', Cannot find or open the PDB file
    38. 'Test.exe': Loaded 'W:\Qt\5.0.0\msvc2010\plugins\platforms\qminimal.dll', Binary was not built with debug information.
    39. 'Test.exe': Unloaded 'W:\Qt\5.0.0\msvc2010\plugins\platforms\qminimal.dll'
    40. 'Test.exe': Loaded 'W:\Qt\5.0.0\msvc2010\plugins\platforms\qminimald.dll', Cannot find or open the PDB file
    41. 'Test.exe': Unloaded 'W:\Qt\5.0.0\msvc2010\plugins\platforms\qminimald.dll'
    42. 'Test.exe': Loaded 'W:\Qt\5.0.0\msvc2010\plugins\platforms\qwindows.dll', Binary was not built with debug information.
    43. 'Test.exe': Unloaded 'W:\Qt\5.0.0\msvc2010\plugins\platforms\qwindows.dll'
    44. 'Test.exe': Loaded 'W:\Qt\5.0.0\msvc2010\plugins\platforms\qwindowsd.dll', Cannot find or open the PDB file
    45. 'Test.exe': Unloaded 'W:\Qt\5.0.0\msvc2010\plugins\platforms\qwindowsd.dll'
    46. 'Test.exe': Loaded 'W:\Qt\5.0.0\msvc2010\plugins\platforms\qwindowsd.dll', Cannot find or open the PDB file
    47. 'Test.exe': Loaded 'C:\Windows\SysWOW64\winmm.dll', Cannot find or open the PDB file
    48. 'Test.exe': Loaded 'C:\Windows\SysWOW64\oleaut32.dll', Cannot find or open the PDB file
    49. 'Test.exe': Loaded 'W:\Qt\5.0.0\msvc2010\bin\libEGLd.dll', Cannot find or open the PDB file
    50. 'Test.exe': Loaded 'C:\Windows\SysWOW64\d3d9.dll', Cannot find or open the PDB file
    51. 'Test.exe': Loaded 'C:\Windows\SysWOW64\version.dll', Cannot find or open the PDB file
    52. 'Test.exe': Loaded 'C:\Windows\SysWOW64\d3d8thk.dll', Cannot find or open the PDB file
    53. 'Test.exe': Loaded 'C:\Windows\SysWOW64\dwmapi.dll', Cannot find or open the PDB file
    54. 'Test.exe': Loaded 'C:\Windows\SysWOW64\uxtheme.dll', Cannot find or open the PDB file
    55. 'Test.exe': Loaded 'C:\Program Files (x86)\ABBYY Lingvo x3\LvHook.dll', Cannot find or open the PDB file
    56. 'Test.exe': Loaded 'C:\Windows\SysWOW64\cryptsp.dll', Cannot find or open the PDB file
    57. 'Test.exe': Loaded 'C:\Windows\SysWOW64\rsaenh.dll', Cannot find or open the PDB file
    58. 'Test.exe': Loaded 'C:\Windows\SysWOW64\RpcRtRemote.dll', Cannot find or open the PDB file
    59. 'Test.exe': Loaded 'C:\Program Files\ThinkPad\Bluetooth Software\syswow64\BtMmHook.dll', Cannot find or open the PDB file
    60. 'Test.exe': Loaded 'C:\Windows\SysWOW64\psapi.dll', Cannot find or open the PDB file
    61. 'Test.exe': Loaded 'C:\Windows\SysWOW64\clbcatq.dll', Cannot find or open the PDB file
    62. 'Test.exe': Loaded 'W:\Qt\5.0.0\msvc2010\plugins\bearer\qgenericbearer.dll', Binary was not built with debug information.
    63. 'Test.exe': Unloaded 'W:\Qt\5.0.0\msvc2010\plugins\bearer\qgenericbearer.dll'
    64. 'Test.exe': Loaded 'W:\Qt\5.0.0\msvc2010\plugins\bearer\qgenericbearerd.dll', Cannot find or open the PDB file
    65. 'Test.exe': Unloaded 'W:\Qt\5.0.0\msvc2010\plugins\bearer\qgenericbearerd.dll'
    66. 'Test.exe': Loaded 'W:\Qt\5.0.0\msvc2010\plugins\bearer\qnativewifibearer.dll', Binary was not built with debug information.
    67. 'Test.exe': Unloaded 'W:\Qt\5.0.0\msvc2010\plugins\bearer\qnativewifibearer.dll'
    68. 'Test.exe': Loaded 'W:\Qt\5.0.0\msvc2010\plugins\bearer\qnativewifibearerd.dll', Cannot find or open the PDB file
    69. 'Test.exe': Unloaded 'W:\Qt\5.0.0\msvc2010\plugins\bearer\qnativewifibearerd.dll'
    70. 'Test.exe': Loaded 'W:\Qt\5.0.0\msvc2010\plugins\bearer\qgenericbearerd.dll', Cannot find or open the PDB file
    71. 'Test.exe': Loaded 'C:\Windows\SysWOW64\IPHLPAPI.DLL', Cannot find or open the PDB file
    72. 'Test.exe': Loaded 'C:\Windows\SysWOW64\winnsi.dll', Cannot find or open the PDB file
    73. 'Test.exe': Loaded 'C:\Windows\SysWOW64\dhcpcsvc.dll', Cannot find or open the PDB file
    74. 'Test.exe': Loaded 'C:\Windows\SysWOW64\dhcpcsvc6.dll', Cannot find or open the PDB file
    75. 'Test.exe': Loaded 'W:\Qt\5.0.0\msvc2010\plugins\bearer\qnativewifibearerd.dll', Cannot find or open the PDB file
    76. 'Test.exe': Loaded 'C:\Windows\SysWOW64\wlanapi.dll', Cannot find or open the PDB file
    77. 'Test.exe': Loaded 'C:\Windows\SysWOW64\wlanutil.dll', Cannot find or open the PDB file
    78. 'Test.exe': Loaded 'C:\Windows\SysWOW64\mswsock.dll', Cannot find or open the PDB file
    79. 'Test.exe': Loaded 'C:\Windows\SysWOW64\WSHTCPIP.DLL', Cannot find or open the PDB file
    80. 'Test.exe': Loaded 'C:\Windows\SysWOW64\wship6.dll', Cannot find or open the PDB file
    81. 'Test.exe': Loaded 'C:\Program Files (x86)\Common Files\microsoft shared\Windows Live\WLIDNSP.DLL', Cannot find or open the PDB file
    82. 'Test.exe': Loaded 'C:\Windows\SysWOW64\rasadhlp.dll', Cannot find or open the PDB file
    83. 'Test.exe': Loaded 'C:\Windows\SysWOW64\FWPUCLNT.DLL', Cannot find or open the PDB file
    84. 'Test.exe': Unloaded 'C:\Windows\SysWOW64\wship6.dll'
    85. 'Test.exe': Unloaded 'C:\Windows\SysWOW64\WSHTCPIP.DLL'
    86. 'Test.exe': Unloaded 'C:\Program Files (x86)\Common Files\microsoft shared\Windows Live\WLIDNSP.DLL'
    87. 'Test.exe': Unloaded 'C:\Windows\SysWOW64\FWPUCLNT.DLL'
    88. 'Test.exe': Loaded 'C:\Windows\SysWOW64\WSHTCPIP.DLL', Cannot find or open the PDB file
    89. First-chance exception at 0x74e5b9bc in Test.exe: 0x0000000D: The data is invalid.
    90. The thread 'Win32 Thread' (0x1cb4) has exited with code 0 (0x0).
    91. The thread 'Win32 Thread' (0xb1d8) has exited with code 0 (0x0).
    92. The thread 'bearerThread' (0xa918) has exited with code 0 (0x0).
    93. The thread 'Thread (pooled)' (0x8248) has exited with code 0 (0x0).
    94. 'Test.exe': Unloaded 'C:\Windows\SysWOW64\WSHTCPIP.DLL'
    95. The thread 'Win32 Thread' (0xb164) has exited with code 0 (0x0).
    96. The thread 'httpThread' (0x90cc) has exited with code 0 (0x0).
    97. The thread 'Win32 Thread' (0xa3a0) has exited with code 0 (0x0).
    98. The thread 'Win32 Thread' (0xabe8) has exited with code 0 (0x0).
    99. The thread 'Win32 Thread' (0xad20) has exited with code 0 (0x0).
    100. The thread 'Win32 Thread' (0x22a4) has exited with code 0 (0x0).
    101. The thread 'Win32 Thread' (0xac68) has exited with code 0 (0x0).
    102. The thread 'Win32 Thread' (0xb3a8) has exited with code 0 (0x0).
    103. The program '[39824] Test.exe: Native' has exited with code 0 (0x0).
    To copy to clipboard, switch view to plain text mode 

    P.S. I'm running under Windows 7 Pro x64.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Simplest app with QNetworkAccessManager and First-chance exception

    That's not a backtrace.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Jan 2013
    Posts
    11
    Qt products
    Qt4 Qt5
    Platforms
    Windows Android

    Default Re: Simplest app with QNetworkAccessManager and First-chance exception

    Quote Originally Posted by wysota View Post
    That's not a backtrace.
    I'm sorry.
    Do you mean the call stack?
    But it is not very informative since it happens in some system thread...

    Qt Code:
    1. KernelBase.dll!74e5b9bc()
    2. [Frames below may be incorrect and/or missing, no symbols loaded for KernelBase.dll]
    3. KernelBase.dll!74e5b9bc()
    4. > rpcrt4.dll!74b60e0b()
    5. rpcrt4.dll!74b60d9a()
    6. wlanapi.dll!6af34ed7()
    7. rpcrt4.dll!74b2feac()
    8. ntdll.dll!7710004d()
    9. ntdll.dll!7710f8b1()
    10. ntdll.dll!7710fee2()
    11. ntdll.dll!77129e83()
    12. ntdll.dll!7710f8b1()
    13. KernelBase.dll!74e60a91()
    14. KernelBase.dll!74e60a2f()
    15. kernel32.dll!74c61194()
    16. wlanapi.dll!6af3531d()
    17. kernel32.dll!74c6339a()
    18. ntdll.dll!77129ef2()
    19. ntdll.dll!77129ec5()
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. Unflagged 46700 0 Main Thread Main Thread Test::~Test Normal
    2. Unflagged 46620 0 Worker Thread Win32 Thread 7711013d Normal
    3. Unflagged 7204 0 Worker Thread Win32 Thread 77111f26 Normal
    4. Unflagged 7908 0 Worker Thread Win32 Thread 77111f26 Normal
    5. Unflagged 47004 0 RPC Thread RPC Callback Thread 7710fd71 Normal
    6. Unflagged 24856 0 Worker Thread Win32 Thread 7711013d Time Critical
    7. Unflagged 47056 0 Worker Thread bearerThread _free_base Normal
    8. Unflagged > 44604 0 Worker Thread Win32 Thread 74e5b9bc Normal
    9. Unflagged 43628 0 Worker Thread httpThread 7711013d Normal
    10. Unflagged 46252 0 Worker Thread Thread (pooled) __set_flsgetvalue Normal
    11. Unflagged 47028 0 Worker Thread Win32 Thread 77111f26 Normal
    12. Unflagged 46980 0 Worker Thread Win32 Thread 7710f939 Above Normal
    To copy to clipboard, switch view to plain text mode 

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Simplest app with QNetworkAccessManager and First-chance exception

    First of all build your app in debug mode. Second of all it seems your app reaches the destructor of Test but we have no idea what happens next. If I were to guess, I'd say you have a corrupt stack there.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Jan 2013
    Posts
    11
    Qt products
    Qt4 Qt5
    Platforms
    Windows Android

    Default Re: Simplest app with QNetworkAccessManager and First-chance exception

    Quote Originally Posted by wysota View Post
    First of all build your app in debug mode.
    It was in debug mode... OK, I've loaded system debug symbols but it did not clear anything.
    I just can't understand why it happens if I almost do not add any custom code - only a few lines of code from documentation... Something wrong with my system?
    Btw, I tried to switch to Qt 4.8.4 - the same story.

    Call stack:
    Qt Code:
    1. > KernelBase.dll!_RaiseException@16() + 0x58 bytes
    2. rpcrt4.dll!_RpcpRaiseException@4() + 0x2f bytes
    3. rpcrt4.dll!NdrpRaisePipeException() + 0x16 bytes
    4. rpcrt4.dll!NdrReceive() + 0x1e55 bytes
    5. rpcrt4.dll!NdrLastAsyncReceive() + 0x2c bytes
    6. rpcrt4.dll!NdrpCompleteAsyncClientCall() + 0x85 bytes
    7. rpcrt4.dll!Ndr64pCompleteAsyncCall() + 0x67 bytes
    8. rpcrt4.dll!_RpcAsyncCompleteCall@8() + 0x1e bytes
    9. wlanapi.dll!_ClientRpcCallback@12() + 0xa0 bytes
    10. rpcrt4.dll!I_RpcAPCRoutine() + 0x2c bytes
    11. ntdll.dll!_KiUserApcDispatcher@16() + 0x25 bytes
    12. kernel32.dll!_WaitForSingleObjectExImplementation@12() + 0x43 bytes
    13. wlanapi.dll!_NotificationApcThreadProc@4() + 0x54 bytes
    14. kernel32.dll!@BaseThreadInitThunk@12() + 0x12 bytes
    15. ntdll.dll!___RtlUserThreadStart@8() + 0x27 bytes
    16. ntdll.dll!__RtlUserThreadStart@8() + 0x1b bytes
    To copy to clipboard, switch view to plain text mode 
    Threads:
    Qt Code:
    1. Unflagged 47848 0 Main Thread Main Thread QPushButton::`scalar deleting destructor' Normal
    2. Unflagged 48388 0 Worker Thread _TppWaiterpThread@4 _ZwWaitForMultipleObjects@20 Normal
    3. Unflagged 47932 0 Worker Thread _TppWorkerThread@4 _NtWaitForWorkViaWorkerFactory@8 Normal
    4. Unflagged 48856 0 Worker Thread _TppWorkerThread@4 _NtWaitForWorkViaWorkerFactory@8 Normal
    5. Unflagged 31392 0 RPC Thread RPC Callback Thread CROIDTable::WorkerThreadLoop Normal
    6. Unflagged 48988 0 Worker Thread _timeThread@4 _ZwWaitForMultipleObjects@20 Time Critical
    7. Unflagged 43132 0 Worker Thread bearerThread _NtWaitForSingleObject@12 Normal
    8. Unflagged > 45812 0 Worker Thread _NotificationApcThreadProc@4 _RaiseException@16 Normal
    9. Unflagged 49048 0 Worker Thread httpThread _ZwWaitForMultipleObjects@20 Normal
    10. Unflagged 48496 0 Worker Thread Thread (pooled) _NtWaitForSingleObject@12 Normal
    11. Unflagged 49036 0 Worker Thread _TppWorkerThread@4 _NtWaitForWorkViaWorkerFactory@8 Normal
    12. Unflagged 48080 0 Worker Thread _SockAsyncThread@4 _ZwRemoveIoCompletion@20 Above Normal
    13. Unflagged 48172 0 Worker Thread Win32 Thread _ZwWaitForMultipleObjects@20 Normal
    14. Unflagged 48000 0 Worker Thread _TppWorkerThread@4 _NtWaitForWorkViaWorkerFactory@8 Normal
    To copy to clipboard, switch view to plain text mode 

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Simplest app with QNetworkAccessManager and First-chance exception

    Is what you posted earlier a complete app you're testing on right now?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  9. #9
    Join Date
    Jan 2013
    Posts
    11
    Qt products
    Qt4 Qt5
    Platforms
    Windows Android

    Default Re: Simplest app with QNetworkAccessManager and First-chance exception

    Quote Originally Posted by wysota View Post
    Is what you posted earlier a complete app you're testing on right now?
    Yes! Nothing more! Just a clear project with one button and simple network request.

  10. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Simplest app with QNetworkAccessManager and First-chance exception

    Try setting a breakpoint in destructor of Test and step through the code to see when it crashes.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  11. #11
    Join Date
    Jan 2013
    Posts
    11
    Qt products
    Qt4 Qt5
    Platforms
    Windows Android

    Default Re: Simplest app with QNetworkAccessManager and First-chance exception

    I found one interesting thing. If I set breakpoint in the destructor of Test class, wait few seconds and continue execution - the exception is not raised.
    Looks like some resources don't have time to be freed...

  12. #12
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Simplest app with QNetworkAccessManager and First-chance exception

    Since the very beginning I was suspecting some problem with threads which could explain what is going on. However you said the code you posted was a complete testbed so the only threads running are those related to QNetworkAccessManager. Or at least that should be the case. On the other hand we can see around 10 threads in your app. Where are they coming from? Are you sure there is no additional code involved? Are you linking with some external libraries or something like that? Where does qmyapp.h come from?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  13. #13
    Join Date
    Jan 2013
    Posts
    11
    Qt products
    Qt4 Qt5
    Platforms
    Windows Android

    Default Re: Simplest app with QNetworkAccessManager and First-chance exception

    Quote Originally Posted by wysota View Post
    On the other hand we can see around 10 threads in your app. Where are they coming from?
    I wonder myself...

    Quote Originally Posted by wysota View Post
    Are you sure there is no additional code involved? Are you linking with some external libraries or something like that? Where does qmyapp.h come from?
    Yes, I'm sure. qmyapp.h - it contained custom QApplication derived class, but now I don't use it. I even removed it from the project - nothing changed.
    Input libraries: qtmaind.lib;QtCored4.lib;QtGuid4.lib;QtNetworkd4.l ib;

    OK, thank you anyway!

  14. #14
    Join Date
    Aug 2013
    Posts
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Simplest app with QNetworkAccessManager and First-chance exception

    Did you solve this? I am running into the exact same problem in my code. Same stacktrace, same simple code, just a get() call with the QNAM. And its 100% reproducible.

  15. #15
    Join Date
    Aug 2013
    Posts
    1
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Simplest app with QNetworkAccessManager and First-chance exception

    I get this error as well, without even using the QNAM. It's loading 'qnativewifibearerd' and then crapping out in it after it tries to to call 'closeHandle'.
    My stack trace looks nearly the same.

    --chris

  16. #16
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Simplest app with QNetworkAccessManager and First-chance exception

    @pke: Are you using exactly the posted code without the customised QApplication, VS2010, and Qt 5.0.0? If so, upgrade your Qt and do a clean build.

    @crioux: So you are crashing in this fashion with a program that contains nothing except a QApplication instantiation and Designer Ui. Forgive me if I do not trust that assertion. Do a complete rebuild. Post a single file example and complete version details if the problem persists.

  17. #17
    Join Date
    Jul 2013
    Posts
    3
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Unhappy Re: Simplest app with QNetworkAccessManager and First-chance exception

    I have the same issue, QNetworkAccessManager cause a debug output like :
    test.exe .. 0x74fcb727 .....: 0x0000000D: The data is invalid


    my test environment is :

    window 7 64 bit
    visual studio 2008
    Qt 5.1

  18. #18
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Simplest app with QNetworkAccessManager and First-chance exception

    Quote Originally Posted by abc100m View Post
    I have the same issue,
    How do you know it is the same issue?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  19. #19
    Join Date
    Jul 2013
    Posts
    3
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Simplest app with QNetworkAccessManager and First-chance exception

    I want to reproduce this issue, but same character is Chinese.

    Ok, I change a bit code that provide by #1. I create a new Qt project, and have two button:

    void Test::Request_finished(QNetworkReply *reply)
    {
    //reply->deleteLater();
    }

    void Test::Button_clicked()
    {
    manager = new QNetworkAccessManager(this);

    QObject::connect(manager, SIGNAL(finished(QNetworkReply *)), this, SLOT(Request_finished(QNetworkReply *)));
    QNetworkRequest request(QUrl("http://www.google.com"));
    reply = manager->get(request);
    }

    void Test::destroy_clicked()
    {
    qDebug() << "to delete reply...";
    if (reply)
    {
    reply->abort();
    delete reply;//->deleteLater();
    reply = NULL;
    }

    qDebug() << "to delete manager...";
    if (manager)
    {
    delete manager;
    manager = NULL;
    }

    qDebug() << "reply, manager destroyed...";
    }

    now, I begin to debug my test program in visual studio IDE(just F5).

    after the program is run, I break it to see how many threads, and now just have 6 threads:
    --------
    0 > 3012 主线程 主线程 _free_base æ*£å¸¸ 0
    0 1228 RPC 线程 RPC 回调线程 7739fd81 æ*£å¸¸ 0
    0 6636 辅助线程 Win32 线程 773a014d æ*£å¸¸ 0
    0 5628 辅助线程 Win32 线程 773a1f36 æ*£å¸¸ 0
    0 5948 辅助线程 Win32 线程 773a1f36 æ*£å¸¸ 0
    0 6696 辅助线程 Win32 线程 773a1f36 æ*£å¸¸ 0
    ------------------

    now I click button1 to execute void Test::Button_clicked(), after executed I see there 14 threads:
    ---------------------
    0 > 3012 主线程 主线程 _free_base æ*£å¸¸ 0
    0 1228 RPC 线程 RPC 回调线程 7739f8c1 æ*£å¸¸ 0
    0 5928 辅助线程 Win32 线程 7739f8c1 æ*£å¸¸ 0
    0 7972 辅助线程 Win32 线程 7739f949 高于æ*£å¸¸ 0
    0 5632 辅助线程 Win32 线程 773a014d 时间关键 0
    0 6636 辅助线程 Win32 线程 773a014d æ*£å¸¸ 0
    0 4404 辅助线程 Win32 线程 773a1f36 æ*£å¸¸ 0
    0 5528 辅助线程 Win32 线程 773a1f36 æ*£å¸¸ 0
    0 5628 辅助线程 Win32 线程 773a1f36 æ*£å¸¸ 0
    0 6260 辅助线程 Win32 线程 773a1f36 æ*£å¸¸ 0
    0 6696 辅助线程 Win32 线程 773a1f36 æ*£å¸¸ 0
    0 6640 辅助线程 Qt HTTP thread QMetaObject::activate æ*£å¸¸ 0
    0 8092 辅助线程 Qt bearer thread QMetaObject::activate æ*£å¸¸ 0
    0 4496 辅助线程 Thread (pooled) QWaitConditionPrivate::wait æ*£å¸¸ 0
    ---------------------

    and these time I click button2 to execute void Test::destroy_clicked(), after execute I see there 10 threads left:
    ---------------------
    0 > 3012 主线程 主线程 _free_base æ*£å¸¸ 0
    0 5928 辅助线程 Win32 线程 7739f8c1 æ*£å¸¸ 0
    0 5632 辅助线程 Win32 线程 773a014d 时间关键 0
    0 6636 辅助线程 Win32 线程 773a014d æ*£å¸¸ 0
    0 3092 辅助线程 Win32 线程 773a1f36 æ*£å¸¸ 0
    0 4060 辅助线程 Win32 线程 773a1f36 æ*£å¸¸ 0
    0 5528 辅助线程 Win32 线程 773a1f36 æ*£å¸¸ 0
    0 5628 辅助线程 Win32 线程 773a1f36 æ*£å¸¸ 0
    0 4912 辅助线程 qt_adopted_thread_watcher_function QArrayData::data æ*£å¸¸ 0
    0 8092 辅助线程 Qt bearer thread QMetaObject::activate æ*£å¸¸ 0
    ---------------------------

    after about 1 minute, I close the test program, and the visual studio debug window shows:
    --------------------------
    to delete reply...
    to delete manager...
    线程 'Qt HTTP thread' (0x19f0) å·²é€€å‡ºï¼Œè¿”å›žå€¼ä ¸º 0 (0x0)。
    reply, manager destroyed...
    线程 'Win32 线程' (0xc14) å·²é€€å‡ºï¼Œè¿”å›žå€¼ä ¸º 0 (0x0)。
    线程 'Win32 线程' (0x15fc) å·²é€€å‡ºï¼Œè¿”å›žå€¼ä ¸º 0 (0x0)。
    test.exe ä¸*çš„ 0x74fcb727 处最可能的异常: 0x0000000D: The data is invalid
    线程 'Win32 线程' (0x1728) å·²é€€å‡ºï¼Œè¿”å›žå€¼ä ¸º 0 (0x0)。
    线程 'qt_adopted_thread_watcher_function' (0x1330) å·²é€€å‡ºï¼Œè¿”å›žå€¼ä ¸º 0 (0x0)。
    线程 'Qt bearer thread' (0x1f9c) å·²é€€å‡ºï¼Œè¿”å›žå€¼ä ¸º 0 (0x0)。
    线程 'Win32 线程' (0x1600) å·²é€€å‡ºï¼Œè¿”å›žå€¼ä ¸º 0 (0x0)。
    线程 'Win32 线程' (0x1338) å·²é€€å‡ºï¼Œè¿”å›žå€¼ä ¸º 0 (0x0)。
    线程 'Win32 线程' (0x1598) å·²é€€å‡ºï¼Œè¿”å›žå€¼ä ¸º 0 (0x0)。
    线程 'Win32 线程' (0xfdc) å·²é€€å‡ºï¼Œè¿”å›žå€¼ä ¸º 0 (0x0)。
    线程 'Win32 线程' (0x19ec) å·²é€€å‡ºï¼Œè¿”å›žå€¼ä ¸º 0 (0x0)。
    线程 'Win32 线程' (0xe9c) å·²é€€å‡ºï¼Œè¿”å›žå€¼ä ¸º 0 (0x0)。
    程序“[4784] test.exe: æœ¬æœºâ€å·²é€€å‡ºï¼Œè¿ ”回值为 0 (0x0)。
    ------------------------------------------------

  20. #20
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Simplest app with QNetworkAccessManager and First-chance exception

    Your code goes way past an empty project with an instance of QNetworkAccessManager that does nothing.

    If your back trace is different than OP's then please start your own thread instead of hijacking this one.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Simplest example for QGraphicsPixmapItem
    By sincnarf in forum Qt Programming
    Replies: 7
    Last Post: 21st September 2012, 14:24
  2. Simplest SQL example
    By janus66 in forum Newbie
    Replies: 3
    Last Post: 21st July 2011, 07:40
  3. the simplest custom slot
    By tommy in forum Qt Programming
    Replies: 30
    Last Post: 12th November 2007, 11:18
  4. simplest / best way to fuse several files with QT?
    By Havard in forum Qt Programming
    Replies: 3
    Last Post: 18th June 2007, 10:06
  5. A simplest ListModel... no example :(
    By tomek in forum Newbie
    Replies: 5
    Last Post: 7th January 2006, 00:32

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.