problem with debian Buster and debugging thread in Qt5

Le
Vincent charente
--000000000000a2824f05bebcc958
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

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

--000000000000a2824f05bebcc958
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<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>

--000000000000a2824f05bebcc958--
  • Partager ce contenu :
Vos réponses
Trier par : date / pertinence
Lisandro Damián Nicanor Pérez Meyer
Le #26570326
Hi Vincent!
On Tue, 30 Mar 2021 at 05:29, Vincent charente
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/
Lisandro Damián Nicanor Pérez Meyer
Le #26570325
Hi again!
On Tue, 30 Mar 2021 at 09:55, Lisandro Damián Nicanor Pérez Meyer

[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/
Vincent charente
Le #26570323
--000000000000cf32d505bec1b341
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
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 <
a ̓©crit :
Hi again!
On Tue, 30 Mar 2021 at 09:55, Lisandro Dami̓¡n Nicanor P̓©rez Meyer

[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/


--000000000000cf32d505bec1b341
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<br>
On Tue, 30 Mar 2021 at 09:55, Lisandro Dami̓¡n Nicanor P̓©rez Meyer<br>
&lt; &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:// &gt; forget to upload this test code, it&#39;s very straightforward and so a<br>
&gt; nice example for an upstream issue.<br>
<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>
<br>
You can tell Qt Creator to ignore the signal. Check<br>
<br>
I&#39;ve added<br>
<br>
͂  handle SIGSTOP pass nostop noprint<br>
<br>
And it just worked :-)<br>
<br>
-- <br>
Lisandro Dami̓¡n Nicanor P̓©rez Meyer<br>
</div>
--000000000000cf32d505bec1b341--
Poster une réponse
Anonyme