Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-38596

Data remains in readChunkBuffer - no readyRead or readAll doesn't deliver

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 5.2.1
    • Serial Port
    • None
    • Windows 7, Qt 5.2.1 MinGW, VirtualBox, stm32102 driver

    Description

      After a while of data exchange, my application hangs as I read a partial message and wait forever on a readRead() signal with the rest.

      Here is some code and a description on StackOverflow:
      http://stackoverflow.com/questions/23014154/qtserialport-readall-doesnt-yield-all-data-and-no-new-readyread-signal?noredirect=1#comment35174230_23014154

      I also modified an example, with which I can reproduces the bug:
      https://gist.github.com/anonymous/ac40a8b47fd38e1961a0

      After the application waits forever, I paused and inspected the issue with the debugger. I appended a screen shot. On readyRead, I check with bytesAvailable() and then append the result of readAll() to msgBuffer. You can see in the screen shot, that msgBuffer holds the incomplete message, while the complete message is in SerialPorts readChunkBuffer.

      Strangely, readyReadEmitted is set to true (is it possible that it was emitted, and my read occured, before the whole message was available?)

      I have debug output from my serial com parter and I can verify that the whole message was sent.

      To rule out any driver and communication issue, I wanted to test with socat under Linux, but QtSerialPort refuses to open PTYs with an error. I will take a look at com0com for further tests.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kuzulis Denis Shienkov
            cptwunderlich Benjamin Maurer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes