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

  1. brychcy commented on Jul 30, 2021

    @brychcy
    ContributorAuthor

    See PR #358

  2. karllessard commented on Jul 31, 2021

    @karllessard
    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

  3. brychcy commented on Jul 31, 2021

    @brychcy
    ContributorAuthor

    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.

  4. brychcy commented on Sep 22, 2021

    @brychcy
    ContributorAuthor

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

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