<?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>10222764 - [lldb] Avoid data race in IOHandlerProcessSTDIO</title>
        <link>http://172.16.0.5:8080/history/llvm-project-15.0.7/lldb/test/API/iohandler/stdio/Makefile#10222764</link>
        <description>[lldb] Avoid data race in IOHandlerProcessSTDIOThis patch fixes a data race in IOHandlerProcessSTDIO. The race ishappens between the main thread and the event handling thread. The mainthread is running the IOHandler (IOHandlerProcessSTDIO::Run()) when anevent comes in that makes us pop the process IO handler which involvescancelling the IOHandler (IOHandlerProcessSTDIO::Cancel). The lattercalls SetIsDone(true) which modifies m_is_done. At the same time, wehave the main thread reading the variable through GetIsDone().This patch avoids the race by using a mutex to synchronize the twothreads. On the event thread, in IOHandlerProcessSTDIO ::Cancel method,we obtain the lock before changing the value of m_is_done. On the mainthread, in IOHandlerProcessSTDIO::Run(), we obtain the lock beforereading the value of m_is_done. Additionally, we delay calling SetIsDoneuntil after the loop exists, to avoid a potential race between the twowrites.  Write of size 1 at 0x00010b66bb68 by thread T7 (mutexes: write M2862, write M718324145051843688):    #0 lldb_private::IOHandler::SetIsDone(bool) IOHandler.h:90 (liblldb.15.0.0git.dylib:arm64+0x971d84)    #1 IOHandlerProcessSTDIO::Cancel() Process.cpp:4382 (liblldb.15.0.0git.dylib:arm64+0x5ddfec)    #2 lldb_private::Debugger::PopIOHandler(std::__1::shared_ptr&lt;lldb_private::IOHandler&gt; const&amp;) Debugger.cpp:1156 (liblldb.15.0.0git.dylib:arm64+0x3cb2a8)    #3 lldb_private::Debugger::RemoveIOHandler(std::__1::shared_ptr&lt;lldb_private::IOHandler&gt; const&amp;) Debugger.cpp:1063 (liblldb.15.0.0git.dylib:arm64+0x3cbd2c)    #4 lldb_private::Process::PopProcessIOHandler() Process.cpp:4487 (liblldb.15.0.0git.dylib:arm64+0x5c583c)    #5 lldb_private::Debugger::HandleProcessEvent(std::__1::shared_ptr&lt;lldb_private::Event&gt; const&amp;) Debugger.cpp:1549 (liblldb.15.0.0git.dylib:arm64+0x3ceabc)    #6 lldb_private::Debugger::DefaultEventHandler() Debugger.cpp:1622 (liblldb.15.0.0git.dylib:arm64+0x3cf2c0)    #7 std::__1::__function::__func&lt;lldb_private::Debugger::StartEventHandlerThread()::$_2, std::__1::allocator&lt;lldb_private::Debugger::StartEventHandlerThread()::$_2&gt;, void* ()&gt;::operator()() function.h:352 (liblldb.15.0.0git.dylib:arm64+0x3d1bd8)    #8 lldb_private::HostNativeThreadBase::ThreadCreateTrampoline(void*) HostNativeThreadBase.cpp:62 (liblldb.15.0.0git.dylib:arm64+0x4c71ac)    #9 lldb_private::HostThreadMacOSX::ThreadCreateTrampoline(void*) HostThreadMacOSX.mm:18 (liblldb.15.0.0git.dylib:arm64+0x29ef544)  Previous read of size 1 at 0x00010b66bb68 by main thread:    #0 lldb_private::IOHandler::GetIsDone() IOHandler.h:92 (liblldb.15.0.0git.dylib:arm64+0x971db8)    #1 IOHandlerProcessSTDIO::Run() Process.cpp:4339 (liblldb.15.0.0git.dylib:arm64+0x5ddc7c)    #2 lldb_private::Debugger::RunIOHandlers() Debugger.cpp:982 (liblldb.15.0.0git.dylib:arm64+0x3cb48c)    #3 lldb_private::CommandInterpreter::RunCommandInterpreter(lldb_private::CommandInterpreterRunOptions&amp;) CommandInterpreter.cpp:3298 (liblldb.15.0.0git.dylib:arm64+0x506478)    #4 lldb::SBDebugger::RunCommandInterpreter(bool, bool) SBDebugger.cpp:1166 (liblldb.15.0.0git.dylib:arm64+0x53604)    #5 Driver::MainLoop() Driver.cpp:634 (lldb:arm64+0x100006294)    #6 main Driver.cpp:853 (lldb:arm64+0x100007344)Differential revision: https://reviews.llvm.org/D120762

            List of files:
            /llvm-project-15.0.7/lldb/test/API/iohandler/stdio/Makefile</description>
        <pubDate>Wed, 02 Mar 2022 19:59:55 +0000</pubDate>
        <dc:creator>Jonas Devlieghere &lt;jonas@devlieghere.com&gt;</dc:creator>
    </item>
</channel>
</rss>
