none
MTTY application unable to disconnect from virtual serial port, application hungs RRS feed

  • Question

  • Hi,


    I have made a virtual serial driver and I am able to send data from applications like tty and MTTY, but when ever I want to close the connection. I am constantly observing that application hungs and I cannot shutdown my target machine( I have to hard reset).

    From my past experience with drivers, This usually happens when ever an IO Request is pending( unable to cancel) and user wants to cancel or close the application.

    How Can I solve this issue.?

    Thanks in Advance 


    vidyasagar196

    Monday, December 12, 2016 11:07 AM

Answers

  • As you mention the most likely cause is you are not handling cancelation of pended I/O correctly.   If this is a KMDF driver then you probably have a case where a WDFREQUEST is not placed on a WDFQUEUE.   If this is a WDM driver, things are more complex (this is one of the reasons moving to KMDF), but you have a cancel problem.   With Windbg you can use !irpfind to locate IRP's that your device still has, which should help point you to the problem.


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Monday, December 12, 2016 12:27 PM

All replies

  • As you mention the most likely cause is you are not handling cancelation of pended I/O correctly.   If this is a KMDF driver then you probably have a case where a WDFREQUEST is not placed on a WDFQUEUE.   If this is a WDM driver, things are more complex (this is one of the reasons moving to KMDF), but you have a cancel problem.   With Windbg you can use !irpfind to locate IRP's that your device still has, which should help point you to the problem.


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Monday, December 12, 2016 12:27 PM
  • in KMDF you can use !wdfdevicequeues to show the active requests in a device

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Monday, December 12, 2016 5:27 PM
  • Hi Don,

    I have implemented Request Cancellation, disconnecting is hanging application and mtty is able to connect to same port after re opening the mtty.


    Requests are cancelled after closing the mtty,. 

    Why do disconnect is hanging mtty ?

    Thanks in Advance


    vidyasagar196

    Friday, December 30, 2016 6:02 PM