Skip to content

Segfault when creating multiple IREE SystemContexts #9277

Closed

Description

@hawkinsp

Repro with iree_runtime==20220601.156:

In [1]: import iree.runtime

In [2]: ctx = iree.runtime.SystemContext(config=iree.runtime.Config("dylib"))

In [3]: ctx2 = iree.runtime.SystemContext(config=iree.runtime.Config("dylib"))
zsh: segmentation fault

I'd expect a graceful failure not a segfault.

Activity

  1. added
    bug 🐞
    help wanted
    on Jun 2, 2022
  2. stellaraccident commented on Jun 2, 2022

    @stellaraccident
    Collaborator

    Indeed.. The actual issue is two configs, not two contexts. If you have one global config, that will work.

    (The config API has been in need of work for a long time. Historically we've held off on doing to much there until we have better low level APIs for default config/multi device -- but even barring that, as you say, a crash is not ok and should be fixed)

  3. hawkinsp commented on Jun 2, 2022

    @hawkinsp
    ContributorAuthor

    Note that it's easy to do this in ways that are more subtle. e.g., I think calling load_vm_flatbuffer twice in the same program has the same issue, because it creates a Config internally. That's an API footgun...

  4. stellaraccident commented on Jun 2, 2022

    @stellaraccident
    Collaborator

    Let me take a pass through and clean this up (probably tomorrow). This part of the API has existed since day 1 as a poc and had never gotten any real attention.

  5. added 2 commits that reference this issue on Jun 4, 2022
    6a2ca2a
    a55003d
  6. added
    bindings/python
    on Jun 13, 2022
  7. rsuderman commented on Jul 14, 2022

    @rsuderman
    Collaborator

    Tested at head and no longer failing.

  8. moved this to Done in IREEon Jul 14, 2022
  9. added 2 commits that reference this issue on Jul 28, 2022
    0f9c510
    3813758
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bindings/pythonbug 🐞help wanted

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions