• problem with debian Buster and debugging thread in Qt5

    From Vincent charente@21:1/5 to All on Tue Mar 30 10:30:02 2021
    XPost: linux.debian.user.french

    Dear All,



    I am sending you this email because I encounter a problem with Debian
    Buster and default Qt5 package.

    I installed packages below :

    · debian 10.8 x86_64 (amd64)

    · apt-get install build-essentials

    · apt-get install gdb

    · apt-get install qt5-default

    · apt-get install qtcreator



    I have tried to debug an application which contains a thread with GBD but
    GDB stops when thread starts. I tried to build GDB with last sources but
    the problem still remains.

    *This problem doesn’t exist with Debian 9 *with the same procedure of installation.

    You can find a simple example which increments a counter in a thread every 500ms at the URL below https://pastebin.com/WegsL9vd.



    Do you know if there is a way to solve this problem ?



    Best regards

    <div dir="ltr">
    <p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:&quot;Calibri&quot;,sans-serif"><span style="color:rgb(31,73,125)">Dear All,</span><span><span></span></span></p>

    <p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:&quot;Calibri&quot;,sans-serif"><span style="color:rgb(31,73,125)"> </span><span><span></span></span></p>

    <p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:&quot;Calibri&quot;,sans-serif"><span style="color:rgb(31,73,125)">I am sending you this email because I
    encounter a problem with Debian Buster and default Qt5 package.</span><span><span></span></span></p>

    <p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:&quot;Calibri&quot;,sans-serif"><span style="color:rgb(31,73,125)">I installed packages below :<span></span></span></p>

    <p style="margin:0cm 0cm 0.0001pt 36pt;font-size:11pt;font-family:&quot;Calibri&quot;,sans-serif"><span style="font-family:Symbol;color:rgb(31,73,125)"><span>·<span style="font:7pt &quot;Times New Roman&quot;">       
    </span></span></span><span style="color:rgb(31,73,125)">debian 10.8
    x86_64 (amd64)<span></span></span></p>

    <p style="margin:0cm 0cm 0.0001pt 36pt;font-size:11pt;font-family:&quot;Calibri&quot;,sans-serif"><span style="font-family:Symbol;color:rgb(31,73,125)"><span>·<span style="font:7pt &quot;Times New Roman&quot;">       
    </span></span></span><span style="color:rgb(31,73,125)">apt-get
    install build-essentials<span></span></span></p>

    <p style="margin:0cm 0cm 0.0001pt 36pt;font-size:11pt;font-family:&quot;Calibri&quot;,sans-serif"><span style="font-family:Symbol;color:rgb(31,73,125)"><span>·<span style="font:7pt &quot;Times New Roman&quot;">       
    </span></span></span><span style="color:rgb(31,73,125)">apt-get
    install gdb<span></span></span></p>

    <p style="margin:0cm 0cm 0.0001pt 36pt;font-size:11pt;font-family:&quot;Calibri&quot;,sans-serif"><span style="font-family:Symbol;color:rgb(31,73,125)"><span>·<span style="font:7pt &quot;Times New Roman&quot;">       
    </span></span></span><span style="color:rgb(31,73,125)">apt-get
    install qt5-default<span></span></span></p>

    <p style="margin:0cm 0cm 0.0001pt 36pt;font-size:11pt;font-family:&quot;Calibri&quot;,sans-serif"><span style="font-family:Symbol;color:rgb(31,73,125)"><span>·<span style="font:7pt &quot;Times New Roman&quot;">       
    </span></span></span><span style="color:rgb(31,73,125)">apt-get
    install qtcreator<span></span></span></p>

    <p style="margin:0cm 0cm 0.0001pt 36pt;font-size:11pt;font-family:&quot;Calibri&quot;,sans-serif"><span style="color:rgb(31,73,125)"><span> </span></span></p>

    <p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:&quot;Calibri&quot;,sans-serif"><span style="color:rgb(31,73,125)">I have tried to debug an application
    which contains a thread with GBD but GDB stops when thread starts. I tried to build GDB with last sources but the problem still remains.</span><span><span></span></span></p>

    <p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:&quot;Calibri&quot;,sans-serif"><span style="color:rgb(31,73,125)"><u>This problem doesn’t exist with
    Debian 9 </u>with the same procedure of installation. <br></span></p><p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:&quot;Calibri&quot;,sans-serif"><span style="color:rgb(31,73,125)">You can find a simple example which
    increments a
    counter in a thread every 500ms at the URL below <a href="https://pastebin.com/WegsL9vd">https://pastebin.com/WegsL9vd</a>.</span><span><span></span></span></p>

    <p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:&quot;Calibri&quot;,sans-serif"><span style="color:rgb(31,73,125)"> </span><span><span></span></span></p>

    <p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:&quot;Calibri&quot;,sans-serif"><span style="color:rgb(31,73,125)">Do you know if there is a way to solve
    this problem ?</span><span><span></span></span></p>

    <p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:&quot;Calibri&quot;,sans-serif"><span style="color:rgb(31,73,125)"> </span><span><span></span></span></p>

    <p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:&quot;Calibri&quot;,sans-serif"><span style="color:rgb(31,73,125)">Best regards</span></p>

    </div>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Lisandro_Dami=C3=A1n_Nica@21:1/5 to perezmeyer@gmail.com on Tue Mar 30 15:10:02 2021
    XPost: linux.debian.user.french

    Hi again!

    On Tue, 30 Mar 2021 at 09:55, Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com> wrote:

    [snip]

    In fact I can reproduce your issue and at the same time I can make it
    work under gdb itself, so the issue seems to be in Qt Creator. I've reproduced the issue with Qt Creator from unstable, so let me suggest
    you to file a bug upstream: http://https://bugreports.qt.io Do not
    forget to upload this test code, it's very straightforward and so a
    nice example for an upstream issue.

    Actually it is not an issue but a feature. Qt Creator is stopping the
    execution when it receives a signal from gdb, in this case SIGSTOP.
    Add a breakpoint inside the thread code and press F5 to start
    debugging. If you accept the message and press F10 (step) some times
    you will be able to reach the code.

    You can tell Qt Creator to ignore the signal. Check https://forum.qt.io/topic/100958/catching-unix-interrupt-signal-on-console-application-when-debugging-with-qtcreator/2

    I've added

    handle SIGSTOP pass nostop noprint

    And it just worked :-)

    --
    Lisandro Damián Nicanor Pérez Meyer
    http://perezmeyer.com.ar/
    http://perezmeyer.blogspot.com/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Lisandro_Dami=C3=A1n_Nica@21:1/5 to Vincent charente on Tue Mar 30 15:00:01 2021
    XPost: linux.debian.user.french

    Hi Vincent!

    On Tue, 30 Mar 2021 at 05:29, Vincent charente <vincecharente@gmail.com> wrote:

    Dear All,



    I am sending you this email because I encounter a problem with Debian Buster and default Qt5 package.

    I installed packages below :

    · debian 10.8 x86_64 (amd64)

    · apt-get install build-essentials

    · apt-get install gdb

    · apt-get install qt5-default

    This one is really not needed at all, feel free to remove it.

    · apt-get install qtcreator

    I have tried to debug an application which contains a thread with GBD but GDB stops when thread starts. I tried to build GDB with last sources but the problem still remains.

    This problem doesn’t exist with Debian 9 with the same procedure of installation.

    You can find a simple example which increments a counter in a thread every 500ms at the URL below https://pastebin.com/WegsL9vd.


    Do you know if there is a way to solve this problem ?

    In fact I can reproduce your issue and at the same time I can make it
    work under gdb itself, so the issue seems to be in Qt Creator. I've
    reproduced the issue with Qt Creator from unstable, so let me suggest
    you to file a bug upstream: http://https://bugreports.qt.io Do not
    forget to upload this test code, it's very straightforward and so a
    nice example for an upstream issue.


    --
    Lisandro Damián Nicanor Pérez Meyer
    http://perezmeyer.com.ar/
    http://perezmeyer.blogspot.com/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Vincent charente@21:1/5 to All on Tue Mar 30 16:30:02 2021
    XPost: linux.debian.user.french

    Hi Lisandro,

    Great, it works with handle SIGSTOP pass nostop noprint. I think I had
    already tried but I forgot "pass".

    Thank you very much

    Le mar. 30 mars 2021 à 15:04, Lisandro Damián Nicanor Pérez Meyer < perezmeyer@gmail.com> a écrit :

    Hi again!

    On Tue, 30 Mar 2021 at 09:55, Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com> wrote:

    [snip]

    In fact I can reproduce your issue and at the same time I can make it
    work under gdb itself, so the issue seems to be in Qt Creator. I've reproduced the issue with Qt Creator from unstable, so let me suggest
    you to file a bug upstream: http://https://bugreports.qt.io Do not
    forget to upload this test code, it's very straightforward and so a
    nice example for an upstream issue.

    Actually it is not an issue but a feature. Qt Creator is stopping the execution when it receives a signal from gdb, in this case SIGSTOP.
    Add a breakpoint inside the thread code and press F5 to start
    debugging. If you accept the message and press F10 (step) some times
    you will be able to reach the code.

    You can tell Qt Creator to ignore the signal. Check

    https://forum.qt.io/topic/100958/catching-unix-interrupt-signal-on-console-application-when-debugging-with-qtcreator/2

    I've added

    handle SIGSTOP pass nostop noprint

    And it just worked :-)

    --
    Lisandro Damián Nicanor Pérez Meyer
    http://perezmeyer.com.ar/
    http://perezmeyer.blogspot.com/


    <div dir="ltr"><div>Hi Lisandro,</div><div><br></div><div>Great, it works with handle SIGSTOP pass nostop noprint. I think I had already tried but I forgot &quot;pass&quot;.</div><div><br></div><div>Thank you very much<br>

    </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mar. 30 mars 2021 à 15:04, Lisandro Damián Nicanor Pérez Meyer &lt;<a href="mailto:perezmeyer@gmail.com">perezmeyer@gmail.com</a>&gt; a écrit :<br></div><blockquote
    class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi again!<br>

    On Tue, 30 Mar 2021 at 09:55, Lisandro Damián Nicanor Pérez Meyer<br>
    &lt;<a href="mailto:perezmeyer@gmail.com" target="_blank">perezmeyer@gmail.com</a>&gt; wrote:<br>
    &gt;<br>
    [snip]<br>
    &gt;<br>
    &gt; In fact I can reproduce your issue and at the same time I can make it<br> &gt; work under gdb itself, so the issue seems to be in Qt Creator. I&#39;ve<br>
    &gt; reproduced the issue with Qt Creator from unstable, so let me suggest<br> &gt; you to file a bug upstream: http://<a href="https://bugreports.qt.io" rel="noreferrer" target="_blank">https://bugreports.qt.io</a> Do not<br>
    &gt; forget to upload this test code, it&#39;s very straightforward and so a<br>
    &gt; nice example for an upstream issue.<br>

    Actually it is not an issue but a feature. Qt Creator is stopping the<br> execution when it receives a signal from gdb, in this case SIGSTOP.<br>
    Add a breakpoint inside the thread code and press F5 to start<br>
    debugging. If you accept the message and press F10 (step) some times<br>
    you will be able to reach the code.<br>

    You can tell Qt Creator to ignore the signal. Check<br>
    <a href="https://forum.qt.io/topic/100958/catching-unix-interrupt-signal-on-console-application-when-debugging-with-qtcreator/2" rel="noreferrer" target="_blank">https://forum.qt.io/topic/100958/catching-unix-interrupt-signal-on-console-application-when-
    debugging-with-qtcreator/2</a><br>

    I&#39;ve added<br>

      handle SIGSTOP pass nostop noprint<br>

    And it just worked :-)<br>

    -- <br>
    Lisandro Damián Nicanor Pérez Meyer<br>
    <a href="http://perezmeyer.com.ar/" rel="noreferrer" target="_blank">http://perezmeyer.com.ar/</a><br>
    <a href="http://perezmeyer.blogspot.com/" rel="noreferrer" target="_blank">http://perezmeyer.blogspot.com/</a><br>
    </blockquote></div>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)