Skip to content

Bug in GDBJIT feature implementation: NotifyGDB not always called. #33962

Description

@0xfk0

I think i have found a bug in GDBJIT feature: function NotifyGdb::MethodPrepared not always called. Sometimes methods of managed code might be compiled without notifying GDB of that.

GDB is notified about method compilation in MethodDesc::PrepareInitialCode (prestub.cpp:325):

 324 #if defined(FEATURE_GDBJIT) && defined(TARGET_UNIX) && !defined(CROSSGEN_COMPILE)
 325     NotifyGdb::MethodPrepared(this);
 326 #endif

But in a few cases MethodDesc::PrepareCode is called directly (without call to PrepareInitialCode), so GDB stay not notified about the changes. Such cases are following:

  1. TieredCompilationManager::CompileCodeVersion (tieredcompilation.cpp:780) directly callse PrepareCode;
  2. JitPatchpointWorker (jithelpers.cpp:5055);
  3. CodeVersionManager::PublishVersionableCodeIfNecessary (codeversion.cpp:1702);
  4. MulticoreJitProfilePlayer::CompileMethodDesc (multicorejitplayer.cpp:548).

So, I think there is a bug exists: call to NotifyGdb::MethodPrepared() should be moved from function MethodDesc::PrepareInitialCode to the function ``MethodDesc::PrepareCode`.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions