Giter Site home page Giter Site logo

Comments (18)

oblitum avatar oblitum commented on September 24, 2024

Sometimes cgdb freezes for me too on exit (on Ubuntu). I have to send a kill -9...

from cgdb.

brasko avatar brasko commented on September 24, 2024

On Tue, Mar 04, 2014 at 06:44:39PM -0800, Francisco Lopes wrote:

Sometimes cgdb freezes for me too on exit (on Ubuntu). I have to send a kill -9...

When it's frozen, can a stack trace be sent to us?

I've never seen this behavior.

Thanks,
Bob Rossi

from cgdb.

oblitum avatar oblitum commented on September 24, 2024

@brasko anytime I get it I'll send it here.

from cgdb.

oblitum avatar oblitum commented on September 24, 2024

Hi @brasko, I just freezed now while debugging some Go code, backtrace is the following:

(gdb) bt
#0  0x00007f4478478d3b in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007f44783f5f1c in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#2  0x00007f44783f34c5 in malloc () from /lib/x86_64-linux-gnu/libc.so.6
#3  0x00007f4478ec5939 in xmalloc () from /lib/x86_64-linux-gnu/libreadline.so.6
#4  0x00007f4478ebefb3 in rl_copy_text () from /lib/x86_64-linux-gnu/libreadline.so.6
#5  0x00007f4478ec2b19 in rl_delete_text () from /lib/x86_64-linux-gnu/libreadline.so.6
#6  0x00000000004181a0 in rline_clear (rline=<optimized out>) at ../../../../cgdb/lib/rline/rline.c:207
#7  0x0000000000404d50 in rl_sigint_recved () at ../../../cgdb/cgdb/cgdb.c:638
#8  0x00000000004096d5 in signal_handler (signo=17) at ../../../cgdb/cgdb/interface.c:720
#9  <signal handler called>
#10 0x00007f44783f0750 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#11 0x0000000000418521 in ibuf_free (s=0xdba010) at ../../../../cgdb/lib/adt/ibuf.c:37
#12 0x0000000000404d81 in cleanup () at ../../../cgdb/cgdb/cgdb.c:1422
#13 0x000000000040510f in process_commands (tgdb=0xdbd350) at ../../../cgdb/cgdb/cgdb.c:1040
#14 gdb_input () at ../../../cgdb/cgdb/cgdb.c:1116
#15 0x0000000000403f8f in main_loop () at ../../../cgdb/cgdb/cgdb.c:1388
#16 main (argc=<optimized out>, argv=<optimized out>) at ../../../cgdb/cgdb/cgdb.c:1737

I got freezed in this situation:

(gdb) q
A debugging session is active.

        Inferior 1 [process 28310] will be killed.

Quit anyway? (y or n) y
A debugging session is active.

        Inferior 1 [process 28310] will be killed.

After that I have to kill it with kill -9.

Notice that I'm on tip, but also with some very minimal changes applied so to have some display of UTF-8 text.

GNU gdb (GDB) 7.6.50.20140101-cvs

from cgdb.

zhangyafeikimi avatar zhangyafeikimi commented on September 24, 2024

I met the issue in Mac OS X 10.9.2.
GNU gdb (GDB) 7.7, installed from homebrew.
CGDB 0.6.7, installed from homebrew.

from cgdb.

brasko avatar brasko commented on September 24, 2024

On Thu, Mar 20, 2014 at 11:43:33PM -0700, Francisco Lopes wrote:

Hi @brasko, I just freezed now while debugging some Go code, backtrace is the following:

(gdb) bt
#0  0x00007f4478478d3b in ?? () from /lib/x86_64-linux-gnu/libc.so.6
...
#16 main (argc=<optimized out>, argv=<optimized out>) at ../../../cgdb/cgdb/cgdb.c:1737

I got freezed in this situation:

(gdb) q
A debugging session is active.

        Inferior 1 [process 28310] will be killed.

Quit anyway? (y or n) y
A debugging session is active.

        Inferior 1 [process 28310] will be killed.

After that I have to kill it with kill -9.

Notice that I'm on tip, but also with some very minimal changes applied so to have some display of UTF-8 text.

Please don't ask why, but i just saw this email now.

For my sanity sake, do you know if you get the freezes with out your
patches?

Thanks,
Bob Rossi

from cgdb.

oblitum avatar oblitum commented on September 24, 2024

I used to get freezes before this patch, not sure whether they're more frequent now... Also, I expect to be the only one using this patch,

from cgdb.

oblitum avatar oblitum commented on September 24, 2024

I'm using mavericks now, no patches. It's also freezing as stated here.

from cgdb.

oblitum avatar oblitum commented on September 24, 2024

It has freezed on process termination, I'm unable to enter a command to quit cgdb.

from cgdb.

brasko avatar brasko commented on September 24, 2024

On Tue, Mar 04, 2014 at 01:17:57AM -0800, Gregory Pakosz wrote:

Hello, I seem to face the same problem as reported in #35 (which as been closed by the reporter without further comment).

When using gdb 7.7 (installed with homebrew and self signed), quitting gdb while debugging works. When using cgdb, quitting while debugging hangs. I then need to hit CTRL-C.

Hi,

I finally reproduced this behavior and understand why it hangs on exit.

The basic issue is, when gdb dies, the OS sends a SIGCHLD to CGDB. CGDB
is in the middle of a malloc (or some other operation) when that signal
is received. In the signal handler it again calls malloc, which locks a
mutex causing CGDB to hang.

I'll be fixing the issue over the next few days and probably doing a
release after that. Thanks for continuing to follow up with this issue.

Below is the stack trace that shows the issue.

Thanks,
Bob Rossi

(gdb) bt
#0 __lll_lock_wait_private () at
../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95
#1 in _L_lock_12779 () at malloc.c:5206
#2 in __GI___libc_malloc (bytes=1) at malloc.c:2887
#3 in xmalloc () from /lib/x86_64-linux-gnu/libreadline.so.6
#4 in rl_copy_text () from /lib/x86_64-linux-gnu/libreadline.so.6
#5 in rl_delete_text () from /lib/x86_64-linux-gnu/libreadline.so.6
#6 in rline_clear (rline=) at
../../../cgdb/lib/rline/rline.c:207
#7 in rl_sigint_recved () at ../../cgdb/cgdb/cgdb.c:638
#8 in signal_handler (signo=17) at ../../cgdb/cgdb/interface.c:720
#9
#10 malloc_consolidate (av=av@entry=0x7f02b3a64760 <main_arena>) at
malloc.c:4143
#11 in _int_malloc (av=0x7f02b3a64760 <main_arena>, bytes=4097) at
malloc.c:3423
#12 in __GI___libc_malloc (bytes=4097) at malloc.c:2891
#13 in gdb_input () at ../../cgdb/cgdb/cgdb.c:1100
#14 in main_loop () at ../../cgdb/cgdb/cgdb.c:1388
#15 main (argc=, argv=) at
../../cgdb/cgdb/cgdb.c:1737

from cgdb.

oblitum avatar oblitum commented on September 24, 2024

looks similar to the previous :-)

from cgdb.

brasko avatar brasko commented on September 24, 2024

On Fri, Jul 11, 2014 at 06:48:20AM -0700, Francisco Lopes wrote:

looks similar to the previous :-)

You are right. I'm sorry I didn't recognize this earlier.

The good news here is that we can confirm the behavior is the same issue
and this means this should probably fix the issue for good.

I'll be working on a formal fix shortly.

Thanks,
Bob Rossi

from cgdb.

brasko avatar brasko commented on September 24, 2024

On Fri, Jul 11, 2014 at 01:17:55PM -0400, Bob Rossi wrote:

On Fri, Jul 11, 2014 at 06:48:20AM -0700, Francisco Lopes wrote:

looks similar to the previous :-)

You are right. I'm sorry I didn't recognize this earlier.

The good news here is that we can confirm the behavior is the same issue
and this means this should probably fix the issue for good.

I'll be working on a formal fix shortly.

Finally fixed upstream.

Bob Rossi

from cgdb.

oblitum avatar oblitum commented on September 24, 2024

@brasko hi, sadly, it's still hanging consistently for me. For the following simple testcase it has hanged the two times I've tried:

I had to kill it with kill -9 and also, when hanging cgdb gets 100% CPU usage.

I'm on OS X Mavericks, configure line was

../../cgdb/configure --prefix=/opt/local --with-readline=/usr/local/opt/readline

where readline is provided by homebrew.

from cgdb.

oblitum avatar oblitum commented on September 24, 2024

by the way, it seems usage of cgdb coupled with tmux is not very good, it's the first time I tried it.

from cgdb.

oblitum avatar oblitum commented on September 24, 2024

Also, I didn't quit. It hanged on continue command, and the process terminated but I didn't get the control back.

from cgdb.

brasko avatar brasko commented on September 24, 2024

On Fri, Jul 18, 2014 at 08:50:11PM -0700, Francisco Lopes wrote:

Also, I didn't quit. It hanged on continue command, and the process terminated but I didn't get the control back.

You need to rebuild cgdb from source and then do 'make && make install'
and run the newly installed cgdb.

If you do that, you should be at hash
da718d2
and the hangs should no longer occur. I'm positive I've fixed the
original issue.

If you still see an issue, please provide me with another backtrace.

Thanks!
Bob Rossi

from cgdb.

oblitum avatar oblitum commented on September 24, 2024

ok @brasko, I think I will open another issue as this seems unrelated and it's the first time I'm using it on Mavericks.

from cgdb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.