• Clemens Backes's avatar
    [wasm][debug] Do not hold lock while recompiling functions · 813c5954
    Clemens Backes authored
    This is to avoid a lock inversion problem. In many situation, the
    {NativeModule} lock is held while getting the {DebugInfo} lock.
    Hence we should never do is the other way around, otherwise we risk a
    deadlock.
    When setting a breakpoint, we hold the {DebugInfo} lock when triggering
    recompilation, but recompilation accesses the {NativeModule} for
    creating the {CompilationEnv}, and therefore takes the {NativeModule}
    lock.
    This CL fixes this lock inversion by giving up the {DebugInfo} lock
    before recompiling functions.
    
    R=thibaudm@chromium.org
    
    Bug: v8:10351
    Change-Id: Ic818c6589b2b532006aee4c16bac92b2fe79fa65
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2139574
    Commit-Queue: Clemens Backes <clemensb@chromium.org>
    Reviewed-by: 's avatarThibaud Michaud <thibaudm@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#67042}
    813c5954
mutex.h 11.3 KB