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

bbapi transfers save pointer to tdef, which can lead to a crash on resume #81

Open
adammoody opened this issue Aug 29, 2020 · 1 comment

Comments

@adammoody
Copy link
Contributor

adammoody commented Aug 29, 2020

During AXL_Create, we are saving a pointer to a transfer definition in the kvtree, which is then saved to the state file.

kvtree_util_set_ptr(file_list, AXL_BBAPI_KEY_TRANSFERDEF, tdef);

On resume, this pointer is extracted here, which can lead to a crash on StartTransfer:

kvtree_util_get_ptr(file_list, AXL_BBAPI_KEY_TRANSFERDEF, (void**) &tdef);

We need to check any/all pointers that are saved in the kvtree to make sure those values aren't referenced after a resume.

@tonyhutter
Copy link
Collaborator

Thanks for catching this. It's definitely a bug, but not as bad as it may seem (and it only affects BBAPI). The two most common BBAPI cases will work fine and should not trigger the bug:

  1. AXL_Add() + AXL_Dispatch() + app crashes + app restarts and transfer is still going + AXL_Resume() + AXL_Wait()
  2. AXL_Add() + AXL_Dispatch() + app crashes + transfer completes in background + app restarts + AXL_Resume() + AXL_Wait()

That said, I can see this being an issue if you do:

AXL_Add() + app crashes + app restarts + AXL_Resume() + AXL_Wait().

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