Skip to content

Bug in String deallocation #357

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

Closed
brychcy opened this issue Jul 30, 2021 · 4 comments
Closed

Bug in String deallocation #357

brychcy opened this issue Jul 30, 2021 · 4 comments

Comments

@brychcy
Copy link
Contributor

brychcy commented Jul 30, 2021

When trying to upgrade to 0.3.1 we got junit failures in a class with multiple
tests that load and use saved models with string inputs and outputs.

Tensorflow was for some tests throwing an exception with a message that definitely was wrong.

When the tests were run individually, no error occured.

When the tests were reordered, different tests were failing.

So this smells likely a memory corruption, and I've looked at the changes in 0.3.1 (w.r.t. 0.3.0),
namely #253.

I think I've understood the issue: The problem appears if the underlying TensorBuffers are shared, in which case
the strings should not be deallocated.

I'll send a PR which uses TF_TensorMaybeMove (which in its current implementation returns null if then TensorBuffer is shared, and the tensor itself, if it is not) to detect and avoid the situation (the PR fixes the problem for us)

@brychcy
Copy link
Contributor Author

brychcy commented Jul 30, 2021

See PR #358

@karllessard
Copy link
Collaborator

Thanks for the PR @brychcy , we'll take a look at it.

Can you also please retry with 0.3.2, which was released a few weeks ago? We have fixed a memory leak related to loading/unloading saved models, that might prevent other issues as well

@brychcy
Copy link
Contributor Author

brychcy commented Jul 31, 2021

Happens also with 0.3.2.
Actually I directly tried to upgrade to that but then noted that the problem already appears with 0.3.1.

@brychcy
Copy link
Contributor Author

brychcy commented Sep 22, 2021

This has been fixed on the master and in 0.3.3 so this bug can be closed

@brychcy brychcy closed this as completed Sep 22, 2021
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