Skip to content

Halide built with exceptions can produce test failures that don't report errors #6959

@steven-johnson

Description

@steven-johnson

When Halide is built with exceptions enabled (generally the default these days because it's required for PyBind), all of our Error types (and internal_assert, etc) throw exceptions, rather than log-to-stderr-and-exit.

This is a problem for the many, many tests we have that are JIT-based, because they have no try/catch blocks, and when C++ throws an exception with no enclosing catch block, it just calls std::terminate(), which defaults to simply calling abort().

AFAIK, there is no C++-standards-complaint way to install a handler to "catch unhandled exceptions", though MSVC/Win32 provides a way, and anecdotally there are ways to get gcc/g++ to do something similar; it would be good to try to handle this.

And/or, we could add some sort of minimal test framework to our JIT-based tests to ensure that everything is wrapped in try/catch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions