Skip to content

Bug in String deallocation #357

Description

@brychcy

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions