Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

segfault after cancelling transfer #30

Open
nicolas-s opened this issue Dec 13, 2019 · 4 comments
Open

segfault after cancelling transfer #30

nicolas-s opened this issue Dec 13, 2019 · 4 comments

Comments

@nicolas-s
Copy link

I'm using windows 10 and the device run latest master version of uMTP-Responder with functionfs on a 4.14.78 kernel.
Here are the steps to reproduce :

  • Connect the device
  • Copy from the device a file
  • During the copy cancel the transfer
  • Try to copy another file from the device -> segfault

In attachement you have the output of umtprd since I request the cancel (umtprd_log.txt) and the backtrace output of the coredump (umtprd_backtrace.txt).

It seems that after the cancel, the session is closed and on the new session we never pass through the MTP_OPERATION_OPEN_SESSION operation to create the 'fs_db' of the session.

@jfdelnero
Copy link
Member

It seems that after the cancel, the session is closed and on the new session we never pass through the MTP_OPERATION_OPEN_SESSION operation to create the 'fs_db' of the session.

Yes this appears to be the cause of the segfault : The pc didn't see that the connection was closed on the device side and the uMTP should check the session status before responding to commands. But this is not the root cause of the issue. The read error is the problem.
What is your device CPU ? and which Windows 10 version have you ?

@jfdelnero
Copy link
Member

BTW are you using the latest tagged version or the one present on the trunk ?

@nicolas-s
Copy link
Author

I run the uMTP responder on a imx6ul CPU with a 4.14.78 kernel and my Windows 10 pro version is 10.0.18362.

I'm using this commit 39a2999 from the master because with the 1.0.0 release I have read error due to the buffer size.

I also have an RNDIS function configured on the same interface. I'll try to put only the MTP to see if it has an impact.

@jfdelnero
Copy link
Member

i have added the session status check in the operation functions. The mtp responder shouldn't segfault anymore if the usb link is flakey (read error...). Now i will try to add some workaround to keep the connection up even if we have some read error...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants