Skip to content

Advice for debugging hang in CreateDelegate in my DLR-based language? #277

@spofdamon

Description

@spofdamon

I'm working on a compiler for a little language and keep running into hangs when calling into the compiled delegates with DynamicInvoke. According to dotTrace 42.9% of the time below that is CreateDelegate and the rest seems to be invisible to the profiler. (I assume it's unmanaged.) I've tried pausing in the debugger at random points and ended up deep in the IL generation code somewhere.

Are there any additional debug options I can enable or tips for narrowing this down? I'm linking against debug builds of Microsoft.Dynamic.dll and Microsoft.Scripting.dll, but I think the issue might be farther down.

I'm happy to share access to the repo if anybody is interested in taking a look, but so far I haven't been able to narrow this down to a reproduction case that doesn't involve my compiler and runtime code, which is ~6k lines of C# so far.

I've attached a sample DebugView of the compiled expression tree, but it has dynamic calls back into the runtime. This tree hangs 100% of the time.
failing-expression-tree.txt

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