Skip to content

Memory leak in iree/vm:list_test #2463

Closed

Description

@GMNGeoffrey

Importing into Google, I'm seeing asan leaks in the vm list test, likely introduced in 56a77fb.

We need asan testing in OSS :-)

I double checked and these are not fixed by #2459

Activity

  1. self-assigned this
    on Jul 9, 2020
  2. GMNGeoffrey commented on Jul 9, 2020

    @GMNGeoffrey
    MemberAuthor

    PR into google branch is #2462

  3. GMNGeoffrey commented on Jul 9, 2020

    @GMNGeoffrey
    MemberAuthor
    Direct leak of 80 byte(s) in 1 object(s) allocated from:
        ...
        #1 0x7f291d7a2b07 in iree_allocator_system_allocate iree/base/api.cc:140:13
        #2 0x7f291d7a2751 in iree_allocator_malloc iree/base/api.cc:100:10
        #3 0x7f291d7b2c7c in iree_vm_list_create iree/vm/list.c:73:3
        #4 0x7f291d7d85ee in (anonymous namespace)::VMListTest_Reserve_Test::TestBody() iree/vm/list_test.cc:203:3
        ...
    
  4. GMNGeoffrey commented on Jul 9, 2020

    @GMNGeoffrey
    MemberAuthor

    Minimal repro:

      iree_vm_type_def_t element_type = iree_vm_type_def_make_variant_type();
      iree_host_size_t initial_capacity = 0;
      iree_vm_list_t* list = nullptr;
      IREE_ASSERT_OK(iree_vm_list_create(&element_type, initial_capacity,
                                         IREE_ALLOCATOR_SYSTEM, &list));
      iree_vm_list_release(list);
    
  5. benvanik commented on Jul 10, 2020

    @benvanik
    Collaborator

    Yeah, we need ASAN ASAP - go go go

  6. GMNGeoffrey commented on Jul 10, 2020

    @GMNGeoffrey
    MemberAuthor

    Issue is that the list type isn't registered, so its destroy function is falsey and we don't call destroy. iree_vm_list_register_types() is actually not declared in the list.h header. Was that an oversight?

  7. benvanik commented on Jul 10, 2020

    @benvanik
    Collaborator

    just found the same thing and added the right call/test setup - sending now

  8. GMNGeoffrey commented on Jul 10, 2020

    @GMNGeoffrey
    MemberAuthor

    Thanks!

  9. added a commit that references this issue on Jul 10, 2020
    e67f1ac
  10. added a commit that references this issue on Jul 10, 2020
    dde06c0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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