<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/54995>54995</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            lldb with qtcreator as gui ends the program, when the program signals SIGCHLD
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          thomasmaedelrs
      </td>
    </tr>
</table>

<pre>
    lldb 13.0.0
Qt Creator 5.0.2

*** UNEXPECTED STATE TRANSITION:  Debugger::Internal::LldbEngine(0x555bc2e65df0, name = "LldbEngine") "State changed from InferiorStopOk(10) to InferiorRunOk(7)"
*** UNEXPECTED STATE TRANSITION:  Debugger::Internal::LldbEngine(0x555bc2e65df0, name = "LldbEngine") "State changed from InferiorStopOk(10) to InferiorRunOk(7)"
*** UNEXPECTED STATE TRANSITION:  Debugger::Internal::LldbEngine(0x555bc2e65df0, name = "LldbEngine") "State changed from InferiorStopOk(10) to InferiorRunOk(7)"
*** UNEXPECTED STATE TRANSITION:  Debugger::Internal::LldbEngine(0x555bc2e65df0, name = "LldbEngine") "State changed from InferiorStopOk(10) to InferiorRunOk(7)"

LLDB STDERR UNEXPECTED:  "PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.\nStack dump:\n0.\tProgram arguments: /usr/bin/lldb\n"

LLDB STDERR UNEXPECTED:  " #0 0x0000000000227116 (/usr/bin/lldb+0x227116)\n #1 0x00000000002274de (/usr/bin/lldb+0x2274de)\n #2 0x00007f81fecd2b70 (/lib/libpthread.so.0+0x13b70)\n #3 0x00007f81fc81b359 (/opt/lldb/bin/../lib/liblldb.so+0x2a49359)\n #4 0x00007f81fc8150e3 (/opt/lldb/bin/../lib/liblldb.so+0x2a430e3)\n #5 0x00007f81fc82f019 (/opt/lldb/bin/../lib/liblldb.so+0x2a5d019)\n #6 0x00007f81fc82d0cf (/opt/lldb/bin/../lib/liblldb.so+0x2a5b0cf)\n #7 0x00007f81fc82a56d (/opt/lldb/bin/../lib/liblldb.so+0x2a5856d)\n #8 0x00007f81fc817b98 (/opt/lldb/bin/../lib/liblldb.so+0x2a45b98)\n #9 0x00007f81fc8154ed (/opt/lldb/bin/../lib/liblldb.so+0x2a434ed)\n#10 0x00007f81fc814bee (/opt/lldb/bin/../lib/liblldb.so+0x2a42bee)\n#11 0x00007f81fc82f646 (/opt/lldb/bin/../lib/liblldb.so+0x2a5d646)\n#12 0x00007f81fc8315bd (/opt/lldb/bin/../lib/liblldb.so+0x2a5f5bd)\n#13 0x00007f81fc814a17 (/opt/lldb/bin/../lib/liblldb.so+0x2a42a17)\n#14 0x00007f81fc8149ca (/opt/lldb/bin/../lib/liblldb.so+0x2a429ca)\n#15 0x00007f81fc5d8f66 (/opt/lldb/bin/../lib/liblldb.so+0x2806f66)\n#16 0x00007f81fd1b91ea (/opt/lldb/bin/../lib/liblldb.so+0x33e71ea)\n#17 0x00007f81fd1b9ead "

LLDB STDERR UNEXPECTED:  "(/opt/lldb/bin/../lib/liblldb.so+0x33e7ead)\n#18 0x00007f81fd1ba853 (/opt/lldb/bin/../lib/liblldb.so+0x33e8853)\n#19 0x00007f81fc59b1bb (/opt/lldb/bin/../lib/liblldb.so+0x27c91bb)\n#20 0x00007f81fc646407 (/opt/lldb/bin/../lib/liblldb.so+0x2874407)\n#21 0x00007f81fc3d2142 lldb::SBTarget::EvaluateExpression(char const*, lldb::SBExpressionOptions const&) (/opt/lldb/bin/../lib/liblldb.so+0x2600142)\n#22 0x00007f81fc4fbfce (/opt/lldb/bin/../lib/liblldb.so+0x2729fce)\n#23 0x00007f81f92536f5 (/opt/lldb/bin/../lib/../lib/libpython39.so+0x2586f5)\n#24 0x00007f81f91dce70 _PyObject_Call (/opt/lldb/bin/../lib/../lib/libpython39.so+0x1e1e70)\n#25 0x00007f81f91ff41e _PyEval_EvalFrameDefault (/opt/lldb/bin/../lib/../lib/libpython39.so+0x20441e)\n#26 0x00007f81f9200263 (/opt/lldb/bin/../lib/../lib/libpython39.so+0x205263)\n#27 0x00007f81f91dd12e _PyFunction_Vectorcall (/opt/lldb/bin/../lib/../lib/libpython39.so+0x1e212e)\n#28 0x00007f81f91fff0e (/opt/lldb/bin/../lib/../lib/libpython39.so+0x204f0e)\n#29 0x00007f81f91ff1c5 _PyEval_EvalFrameDefault (/opt/lldb/bin/../lib/../lib/libpython39.so+0x2041c5)\n#30 0x00007f81f9200263 (/opt/lldb/bin/../lib/../lib/libpython39.so+0x205263)\n#31 0x00007f81f91dd12e _PyFunction_Vectorcall (/opt/lldb/bin/../lib/../lib/libpython39.so+0x1e212e)\n#32 0x00007f81f91fff0e (/opt/lldb/bin/../lib/../lib/libpython39.so+0x204f0e)\n#33 0x00007f81f91ff1c5 _PyEval_EvalFrameDefault (/opt/lldb/bin/../lib/../lib/libpython39.so+0x2041c5)\n#34 0x00007f81f91dd078 _PyFunction_Vectorcall (/opt/lldb/bin/../lib/../lib/libpython39.so+0x1e2078)\n#35 0x00007f81f91fff0e (/opt/lldb/bin/../lib/../lib/libpython39.so+0x204f0e)\n#36 0x00007f81f91ff1c5 _PyEval_EvalFrameDefault (/opt/lldb/bin/../lib/../lib/libpython39.so+0x2041c5)\n#37 0x00007f81f91dd078 _PyFunction_Vectorcall (/opt/lldb/bin/../lib/../lib/libpython39.so+0x1e2078)\n#38 0x00007f81f91fff0e (/opt/lldb/bin/../lib/../lib/libpython39.so+0x204f0e)\n#39 0x00007f81f91ff1c5 _PyEval_EvalFrameDefault (/opt/lldb/bin/../lib/../lib/libpython39.so+0x2041c5)\n#40 0x00007f81f91dd078 _PyFunction_Vectorcall (/opt/lldb/bin/../lib/../lib/libpython39.so+0x1e2078)\n#41 0x00007f81f91fff0e (/opt/lldb/bin/../lib/../lib/libpython39.so+0x204f0e)\n#42 0x00007f81f91ff1c5 _PyEval_EvalFrameDefault (/opt/lldb/bin/../lib/../lib/libpython39.so+0x2041c5)\n#43 0x00007f81f91dd078 _PyFunction_Vectorcall (/opt/lldb/bin/../lib/../lib/libpython39.so+0x1e2078)\n#44 0x00007f81f91fff0e (/opt/lldb/bin/../lib/../lib/libpython39.so+0x204f0e)\n#45 0x00007f81f91ff1c5 _PyEval_EvalFrameDefault (/opt/lldb/bin/../lib/../lib/libpython39.so+0x2041c5)\n#46 0x00007f81f91dd078 _PyFunction_Vectorcall (/opt/lldb/bin/../lib/../lib/libpython39.so+0x1e2078)\n#47 0x00007f81f91fff0e (/opt/lldb/bin/../lib/../lib/libpython39.so+0x204f0e)\n#48 0x00007f81f91ff1c5 _PyEval_EvalFrameDefault (/opt/lldb/bin/../lib/../lib/libpython39.so+0x2041c5)\n#49 0x00007f81f91dd078 _PyFunction_Vectorcall (/opt/lldb/bin/../lib/../lib/libpython39.so+0x1e2078)\n#50 0x00007f81f91fff0e (/opt/lldb/bin/../lib/../lib/libpython39.so+0x204f0e)\n#51 0x00007f81f91ff1c5 _PyEval_EvalFrameDefault (/opt/lldb/bin/../lib/../lib/libpython39.so+0x2041c5)\n#52 0x00007f81f91dd078 _PyFunction_Vectorcall (/opt/lldb/bin/../lib/../lib/libpython39.so+0x1e2078)\n#53 0x00007f81f91fff0e (/opt/lldb/bin/../lib/../lib/libpython39.so+0x204f0e)\n#54 0x00007f81f91ff1c5 _PyEval_EvalFrameDefault (/opt/lldb/bin/../lib/../lib/libpython39.so+0x2041c5)\n#55 0x00007f81f9200263 (/opt/lldb/bin/../lib/../lib/libpython39.so+0x205263)\n#56 0x00007f81f92e527d PyEval_EvalCode (/opt/lldb/bin/../lib/../lib/libpython39.so+0x2ea27d)\n#57 0x00007f81f93b255c (/opt/lldb/bin/../lib/../lib/libpython39.so+0x3b755c)\n#58 0x00007f81f9253190 (/opt/lldb/bin/../lib/../lib/libpython39.so+0x258190)\n#59 0x00007f81f91fff0e (/opt/lldb/bin/../lib/../lib/libpython39.so+0x204f0e)\n#60 0x00007f81f91ff27c _PyEval_EvalFrameDefault (/opt/lldb/bin/../lib/../lib/libpython39.so+0x20427c)\n#61 0x00007f81f91dd078 _PyFunction_Vectorcall (/opt/lldb/bin/../lib/../lib/libpython39.so+0x1e2078)\n#62 0x00007f81f91fff0e (/opt/lldb/bin/../lib/../lib/libpython39.so+0x204f0e)\n#63 0x00007f81f91ff1c5 _PyEval_EvalFrameDefault (/opt/lldb/bin/../lib/../lib/libpython39.so+0x2041c5)\n#64 0x00007f81f9200263 (/opt/lldb/bin/../lib/../lib/libpython39.so+0x205263)\n#65 0x00007f81f91dd12e _PyFunction_Vectorcall (/opt/lldb/bin/../lib/../lib/libpython39.so+0x1e212e)\n#66 0x00007f81f91fff0e (/opt/lldb/bin/../lib/../lib/libpython39.so+0x204f0e)\n#67 0x00007f81f91ff1c5 _PyEval_EvalFrameDefault (/opt/lldb/bin/../lib/../lib/libpython39.so+0x2041c5)\n#68 0x00007f81f91dd078 _PyFunction_Vectorcall (/opt/lldb/bin/../lib/../lib/libpython39.so+0x1e2078)\n#69 0x00007f81fc7f0c5e (/opt/lldb/bin/../lib/liblldb.so+0x2a1ec5e)\n#70 0x00007f81fd13f1f3 (/opt/lldb/bin/../lib/liblldb.so+0x336d1f3)\n#71 0x00007f81fc5c158a (/opt/lldb/bin/../lib/liblldb.so+0x27ef58a)\n#72 0x00007f81fc5b8391 (/opt/lldb/bin/../lib/liblldb.so+0x27e6391)\n#73 0x00007f81fc5baa14 (/opt/lldb/bin/../lib/liblldb.so+0x27e8a14)\n#74 0x00007f81fc552c5b (/opt/lldb/bin/../lib/liblldb.so+0x2780c5b)\n#75 0x00007f81fc53f9c8 (/opt/lldb/bin/../lib/liblldb.so+0x276d9c8)\n#76 0x00007f81fc5bb77e (/opt/lldb/bin/../lib/liblldb.so+0x27e977e)\n#77 0x00007f81fc2b4197 lldb::SBDebugger::RunCommandInterpreter(bool, bool) (/opt/lldb/bin/../lib/liblldb.so+0x24e2197)\n#78 0x0000000000215459 (/usr/bin/lldb+0x215459)\n#79 0x0000000000216877 (/usr/bin/lldb+0x216877)\n#80 0x0000003000226d0b __libc_start_main (/lib/libc.so.6+0x3000226d0b)\n#81 0x0000000000213819 (/usr/bin/lldb+0x213819)\n"
SOFT ASSERT: "state() == EngineShutdownRequested" in file ../../../../git/src/plugins/debugger/debuggerengine.cpp, line 1675
Debugger::Internal::LldbEngine(0x555bc2e65df0, name = "LldbEngine") "InferiorStopOk"
*** UNEXPECTED STATE TRANSITION:  Debugger::Internal::LldbEngine(0x555bc2e65df0, name = "LldbEngine") "State changed from InferiorStopOk(10) to EngineShutdownFinished(15)"
*** UNEXPECTED STATE TRANSITION:  Debugger::Internal::LldbEngine(0x555bc94e7b40, name = "LldbEngine") "State changed from InferiorStopOk(10) to InferiorRunOk(7)"
*** UNEXPECTED STATE TRANSITION:  Debugger::Internal::LldbEngine(0x555bce5ad050, name = "LldbEngine") "State changed from InferiorStopOk(10) to InferiorRunOk(7)"
*** UNEXPECTED STATE TRANSITION:  Debugger::Internal::LldbEngine(0x555bce5ad050, name = "LldbEngine") "State changed from InferiorStopOk(10) to InferiorRunOk(7)"
*** UNEXPECTED STATE TRANSITION:  Debugger::Internal::LldbEngine(0x555bce5ad050, name = "LldbEngine") "State changed from InferiorStopOk(10) to InferiorRunOk(7)"
*** UNEXPECTED STATE TRANSITION:  Debugger::Internal::LldbEngine(0x555bce5ad050, name = "LldbEngine") "State changed from InferiorStopOk(10) to InferiorRunOk(7)"
*** UNEXPECTED STATE TRANSITION:  Debugger::Internal::LldbEngine(0x555bce5ad050, name = "LldbEngine") "State changed from InferiorStopOk(10) to InferiorRunOk(7)"
*** UNEXPECTED STATE TRANSITION:  Debugger::Internal::LldbEngine(0x555bce5ad050, name = "LldbEngine") "State changed from InferiorStopRequested(9) to InferiorShutdownFinished(13)"
*** UNEXPECTED STATE TRANSITION:  Debugger::Internal::LldbEngine(0x555bd0e2abc0, name = "LldbEngine") "State changed from InferiorStopOk(10) to InferiorRunOk(7)"
*** UNEXPECTED STATE TRANSITION:  Debugger::Internal::LldbEngine(0x555bce911b90, name = "LldbEngine") "State changed from InferiorStopOk(10) to InferiorRunOk(7)"

-------------------------------------------------------------------------------------------------------------------------------------------------
when running lldb from command line, the program is not stopped but prints:

Process 25369 stopped and restarted: thread 38 received signal: SIGCHLD
Process 25369 stopped and restarted: thread 38 received signal: SIGCHLD
Process 25369 stopped and restarted: thread 38 received signal: SIGCHLD

--------------------------------------------------------------------------------------------------------------------------------------------------
as workaround we add 
   signal(SIGCHLD, SIG_IGN);
to main.cpp, then the debugger does not end the program.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJztm1FzozYQgH-N86KpRxII0IMfkthpM5O5pHHa6VtGQsKmh8EFcbn7912B7Qh807tjYtx2kslxNmi_1e5KG8lay0J9mWWZkoh4UzzFEzyf4MtfDboutTBFiRjcpe3d3ZXuftFvHxZ_PCyunxZztHy6fFqgp8fLD8vbp9v7DxPvEqG5lvVqpUt4A7-3udFlLrL23R2oXOSrNNcTGuHPjDEZUx0wleAJvUa52Gg08eZoQqnblE4ot_eWRhiN4rXIV1qhpCw26DZPdJkW5dIU2_uPQCXYNjbF4cljnTcPQrhvUe_mvJszsjnN9e5ufgVGzBePj45ZjRXQ8uFucblcoKqWm9QggcAsVOptURqLXxuzraxV9AZ-4Vk1zbJPm2lRruA9ErlCaR5ntdLIrKHTpajWSIr4oylFrKcTdp2DOfFHpOrN1nLgBra3zUNZrEqxQaJc1RudG6sF-nNTV6XVlOZwtYnCSvyQQfDPwwh_xocfSkNCArgffY1Pr_DntoV1HWizANIH-GDhPwOghQOgO0CYRCTRsaIyxDtAlsr2ujVryHpqWhWQCC2FeNDKgXguJI6I9BjfQYqtOejfdWY6deH2EZDb3gmfg6hD9ntkhrU3kOyBqENmXTJNMBnYZ6ZA1CEHPbLCcTKQLEHUIYc9smCBGkiOQNQhRz0_h5JHA_3MQNQh834EfT2wz74HojuyHfq4R_al1gPJFEQdMumPjcAPho4NEHXItEv2CJNDI5iAqEPuz0FfkHCoN0DUIffnoM9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