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

Occasional crash when executing M552 S0 #1044

Closed
dc42 opened this issue Sep 17, 2024 · 2 comments
Closed

Occasional crash when executing M552 S0 #1044

dc42 opened this issue Sep 17, 2024 · 2 comments
Assignees
Labels
bug Bug that has been reproduced
Milestone

Comments

@dc42
Copy link
Collaborator

dc42 commented Sep 17, 2024

If M552 S0 is commanded while the network is active, very occasionally the firmware crashes in function NetworkResponder::SendData at line outBuf = OutputBuffer::Release(outBuf) because outbuf has become null even though it was checked to be non-null earlier in the function. This can be reproduced by executing M552 S1 and M552 S0 in a loop, with appropriate G4 delays between them (e.g. 7 seconds after M442 S1 and 2 seconds after M552 S0).

@dc42 dc42 added the bug Bug that has been reproduced label Sep 17, 2024
@dc42 dc42 added this to the 3.5.3 milestone Sep 17, 2024
@dc42 dc42 self-assigned this Sep 17, 2024
@dc42
Copy link
Collaborator Author

dc42 commented Sep 17, 2024

NetworkResponder::SendData is called by the Network task, however when M552 S0 is executed by the Main task it loops through the network responder chain, terminating responders that are active and using that interface. The Terminate function in HttpResponder calls ConnectionLost, which releases the buffer chain and sets outbuf to null. The other types of responder may do likewise. So while the Network task is sending the data, the Main task may release the buffer.

A solution may be to have the Network task terminate the responders instead. The Network task already does the job of terminating the network connection, at least in the case of the WiFi interface.

It's likely that using M586 to repeatedly enable/disable HTTP protocol while a browser attempts to connect will cause a similar crash, because responders are also terminated when a protocol is disabled.

@dc42
Copy link
Collaborator Author

dc42 commented Sep 23, 2024

Fixed in 3.5.3 and 3.6beta1.

@dc42 dc42 closed this as completed Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug that has been reproduced
Projects
None yet
Development

No branches or pull requests

1 participant