Results 1 to 7 of 7

Thread: Using QtSerialPort results in "APPCRASH"

  1. #1
    Join Date
    Mar 2013
    Posts
    29
    Thanks
    4
    Thanked 4 Times in 2 Posts

    Question Using QtSerialPort results in "APPCRASH"

    Hi,

    i'm trying to use the QtSerialPort Libary (http://qt-project.org/wiki/QtSerialPort). The install process worked fine (with Perl installed).
    The problem is, as soon as i start my test program (debug or release mode) it crashes with this error:

    Problemsignatur:
    Problemereignisname: APPCRASH
    Anwendungsname: Test.exe
    Anwendungsversion: 0.0.0.0
    Anwendungszeitstempel: 51a3623c
    Fehlermodulname: Qt5Cored.dll
    Fehlermodulversion: 5.0.2.0
    Fehlermodulzeitstempel: 516367ae
    Ausnahmecode: c0000005
    Ausnahmeoffset: 00021f3b
    Betriebsystemversion: 6.1.7601.2.1.0.256.48
    Gebietsschema-ID: 1031
    Zusatzinformation 1: 0a9e
    Zusatzinformation 2: 0a9e372d3b4ad19135b953a78882e789
    Zusatzinformation 3: 0a9e
    Zusatzinformation 4: 0a9e372d3b4ad19135b953a78882e789


    .cpp file:
    Qt Code:
    1. #include <QtCore/QCoreApplication>
    2. #include <QtCore/QDebug>
    3.  
    4. #include <QtSerialPort/QSerialPort>
    5. #include <QtSerialPort/QSerialPortInfo>
    6.  
    7. QT_USE_NAMESPACE
    8.  
    9. int main(int argc, char *argv[])
    10. {
    11. QCoreApplication a(argc, argv);
    12.  
    13. qDebug() << "Begin";
    14.  
    15. // Example use QSerialPortInfo
    16. foreach (const QSerialPortInfo &info, QSerialPortInfo::availablePorts()) {
    17. qDebug() << "Name : " << info.portName();
    18. qDebug() << "Description : " << info.description();
    19. qDebug() << "Manufacturer: " << info.manufacturer();
    20.  
    21. // Example use QSerialPort
    22. QSerialPort serial;
    23. serial.setPort(info);
    24. if (serial.open(QIODevice::ReadWrite))
    25. serial.close();
    26. }
    27.  
    28. qDebug() << "End";
    29. return a.exec();
    30. }
    To copy to clipboard, switch view to plain text mode 

    .pro file:
    Qt Code:
    1. #-------------------------------------------------
    2. #
    3. # Project created by QtCreator 2013-05-10T15:50:24
    4. #
    5. #-------------------------------------------------
    6.  
    7. QT += core
    8.  
    9. QT -= gui
    10.  
    11. QT += serialport
    12.  
    13. TARGET = Test
    14. CONFIG += console
    15. CONFIG -= app_bundle
    16.  
    17. TEMPLATE = app
    18.  
    19.  
    20. SOURCES += main.cpp
    To copy to clipboard, switch view to plain text mode 


    My setup is:
    Windows 7 Prof. 64 bit
    Qt 5.0.2 32 bit
    QtSerialPort Stable (f301591)


    Any ideas?

  2. #2
    Join Date
    Feb 2011
    Location
    Bangalore
    Posts
    207
    Thanks
    20
    Thanked 28 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Using QtSerialPort results in "APPCRASH"

    Your exe is not able to find the correct dll for QSerialPort. It is able to link properly but absence of dll causes it to crash. Check the dll with right name (QSerialPort0.dll / QSerialPort.dll, check the wiki...) is available in the path of executable.

  3. #3
    Join Date
    Mar 2013
    Posts
    29
    Thanks
    4
    Thanked 4 Times in 2 Posts

    Default Re: Using QtSerialPort results in "APPCRASH"

    I tried your suggestion and copied Qt5SerialPort.dll and Qt5SerialPortd.dll into the *.exe folder but it didn't work.
    I still get the same error.


    Added after 15 minutes:


    I tracked the error with debug mode and there i get a "SIGSEGV" "Segmentation fault" error within the file: "qserialportinfo_win.cpp" in line 132 (QByteArray data(datasize, 0)) while creating the QByteArray. (datasize = 10 btw)
    In my opinion the error seems to be somewhere in the QByteArray constructor, but i doubt that...

    Any further ideas?
    Last edited by M4chin3; 3rd June 2013 at 14:23.

  4. #4
    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: Using QtSerialPort results in "APPCRASH"

    Run your program in your debugger. When it crashes inspect the stack backtrace. Starting at the top work down until you find which line of your code is triggering the problem. Is it listing the ports, constructing the QSerialPort, or trying to open/close it?

  5. #5
    Join Date
    Mar 2013
    Posts
    29
    Thanks
    4
    Thanked 4 Times in 2 Posts

    Default Re: Using QtSerialPort results in "APPCRASH"

    I tracked the error with debug mode and there i get a "SIGSEGV" "Segmentation fault" error within the file: "qserialportinfo_win.cpp" in line 132 (QByteArray data(datasize, 0)) while creating the QByteArray. (datasize = 10 btw)
    In my opinion the error seems to be somewhere in the QByteArray constructor, but i doubt that...

    Any further ideas?

  6. #6
    Join Date
    Mar 2013
    Posts
    29
    Thanks
    4
    Thanked 4 Times in 2 Posts

    Default Re: Using QtSerialPort results in "APPCRASH"

    Is anyone able to reproduce this error?

    I also tried the same on a Windows XP 32 bit machine, and got the same error.

  7. #7
    Join Date
    Mar 2013
    Posts
    29
    Thanks
    4
    Thanked 4 Times in 2 Posts

    Default Re: Using QtSerialPort results in "APPCRASH"

    I also tried it with the newest release version of QtSerialPort. But i still get this error on both machines (Win7 64bit and WinXP 32bit)

Similar Threads

  1. Compiling Qt 4.8.2 results in "ld.exe: final link failed: Memory exhausted"
    By themagician in forum Installation and Deployment
    Replies: 8
    Last Post: 26th July 2012, 20:53
  2. Replies: 1
    Last Post: 12th October 2010, 14:43
  3. Replies: 1
    Last Post: 7th April 2010, 21:46
  4. Replies: 3
    Last Post: 8th July 2008, 19:37
  5. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 19:05

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.