<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="/rss.xsl.xml"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
    <title>Changes in Makefile</title>
    <description></description>
    <language>en</language>
    <copyright>Copyright 2015</copyright>
    <generator>Java</generator><item>
        <title>a2c267e0 - [lldb] Fix race condition between lldb-vscode and stop hooks executor</title>
        <link>http://172.16.0.5:8080/history/llvm-project-15.0.7/lldb/test/API/tools/lldb-vscode/stop-hooks/Makefile#a2c267e0</link>
        <description>[lldb] Fix race condition between lldb-vscode and stop hooks executorThe race is between these two pieces of code that are executed in two separatelldb-vscode threads (the first is in the main thread and another is in theevent-handling thread):```// lldb-vscode.cppg_vsc.debugger.SetAsync(false);g_vsc.target.Launch(launch_info, error);g_vsc.debugger.SetAsync(true);``````// Target.cppbool old_async = debugger.GetAsyncExecution();debugger.SetAsyncExecution(true);debugger.GetCommandInterpreter().HandleCommands(GetCommands(), exc_ctx,                                                options, result);debugger.SetAsyncExecution(old_async);```The sequence that leads to the bug is this one:1. Main thread enables synchronous mode and launches the process.2. When the process is launched, it generates the first stop event.3. This stop event is catched by the event-handling thread and DoOnRemoval   is invoked.4. Inside DoOnRemoval, this thread runs stop hooks. And before running stop   hooks, the current synchronization mode is stored into old_async (and   right now it is equal to &quot;false&quot;).5. The main thread finishes the launch and returns to lldb-vscode, the   synchronization mode is restored to asynchronous by lldb-vscode.6. Event-handling thread finishes stop hooks processing and restores the   synchronization mode according to old_async (i.e. makes the mode synchronous)7. And now the mode is synchronous while lldb-vscode expects it to be   asynchronous. Synchronous mode forbids the process to broadcast public stop   events, so, VS Code just hangs because lldb-vscode doesn&apos;t notify it about   stops.So, this diff makes the target intercept the first stop event if the process islaunched in the synchronous mode, thus preventing stop hooks execution.The bug is only present on Windows because other platforms alreadyintercept this event using their own hijacking listeners.So, this diff also fixes some problems with lldb-vscode tests on Windows to makeit possible to run the related test. Other tests still can&apos;t be enabled becausethe debugged program prints something into stdout and LLDB can&apos;t intercept thisoutput and redirect it to lldb-vscode properly.Reviewed By: jinghamDifferential Revision: https://reviews.llvm.org/D119548

            List of files:
            /llvm-project-15.0.7/lldb/test/API/tools/lldb-vscode/stop-hooks/Makefile</description>
        <pubDate>Tue, 22 Feb 2022 11:48:32 +0000</pubDate>
        <dc:creator>Ilya Nozhkin &lt;nozhkin.ii@gmail.com&gt;</dc:creator>
    </item>
</channel>
</rss>
