[perl #37287] [TODO] pdb - don't die on exceptions
On Sun Mar 16 10:17:09 2008, [EMAIL PROTECTED] wrote: Friends, Doing cage cleaning today, I noticed that there has been no activity in this thread since last August. Are the issues that were under discussion still live? Should we still be considering the various patches? The issue is still valid, but my patch from last year does not help much to solve it. You can reproduce the bug with the test.pir I attached last August, and by running the following commands: $ make pdb $ ./pdb test.pir (pdb) r The issue is that pdb does not catch an exception. Instead, the exception crashes pdb. Fixing pdb to catch exceptions cleanly would make pdb significantly more useful as a debugger, I think. Mark
[perl #37287] [TODO] pdb - don't die on exceptions
Friends, Doing cage cleaning today, I noticed that there has been no activity in this thread since last August. Are the issues that were under discussion still live? Should we still be considering the various patches? Update sought. Thank you very much. kid51
Re: [perl #37287] [TODO] pdb - don't die on exceptions
This patch makes parrot stop execution of the vm when running as a debugger. This makes the pdb stop executing and shows the exception message instead of silently exiting. Hi, pancake! I have tried to update your patch to svn r20469, see attached patch. Unfortunately, it doesn't work any longer. I wrote a simple test file (see attached test.pir) that just generates an exception. Then I tried to run it under parrot, and it generated an exception, as expected. [EMAIL PROTECTED] ~/parrot $ ./parrot test.pir Null PMC access in get_string() current instr.: 'main' pc 0 (test.pir:3) Problem is, when I then ran it under pdb, it died pretty horribly. [EMAIL PROTECTED] ~/parrot $ ./pdb test.pir Parrot Debugger 0.4.x Please note: the debugger is currently under reconstruction (pdb) r Restarting Hijacked exception: Null PMC access in get_string() Restarting *** glibc detected *** ./pdb: free(): invalid pointer: 0xb6f191b8 *** === Backtrace: = /lib/libc.so.6[0xb6e4efaf] /lib/libc.so.6(__libc_free+0x89)[0xb6e4fce9] /home/paranoid/parrot/blib/lib/libparrot.so.0.4.14(mem_sys_free+0x23)[0xb7c3b9b3] /home/paranoid/parrot/blib/lib/libparrot.so.0.4.14(PDB_free_file+0x98)[0xb7c2eb38] /home/paranoid/parrot/blib/lib/libparrot.so.0.4.14(PDB_disassemble+0x62)[0xb7c2e712] /home/paranoid/parrot/blib/lib/libparrot.so.0.4.14(Parrot_debug+0x65)[0xb7c31c85] /home/paranoid/parrot/blib/lib/libparrot.so.0.4.14(runops_slow_core+0x60)[0xb7c76130] /home/paranoid/parrot/blib/lib/libparrot.so.0.4.14(runops_int+0x190)[0xb7c46b80] /home/paranoid/parrot/blib/lib/libparrot.so.0.4.14(runops+0xfd)[0xb7c474cd] /home/paranoid/parrot/blib/lib/libparrot.so.0.4.14[0xb7c476e6] /home/paranoid/parrot/blib/lib/libparrot.so.0.4.14(Parrot_runops_fromc_args+0x36)[0xb7c477f6] /home/paranoid/parrot/blib/lib/libparrot.so.0.4.14(Parrot_runcode+0x22f)[0xb7c31c0f] ./pdb(main+0x2d2)[0x8048f22] /lib/libc.so.6(__libc_start_main+0xe2)[0xb6dfe9d2] ./pdb[0x8048bb1] === Memory map: 08048000-0804a000 r-xp fe:03 636705 /home/paranoid/parrot/pdb 0804a000-0804b000 rw-p 1000 fe:03 636705 /home/paranoid/parrot/pdb 0804b000-0841 rw-p 0804b000 00:00 0 [heap] b5b0-b5b21000 rw-p b5b0 00:00 0 b5b21000-b5c0 ---p b5b21000 00:00 0 b5cca000-b5d0c000 rw-p b5cca000 00:00 0 b5d0c000-b5d0d000 ---p b5d0c000 00:00 0 b5d0d000-b650d000 rw-p b5d0d000 00:00 0 b650d000-b650e000 ---p b650d000 00:00 0 b650e000-b6d1 rw-p b650e000 00:00 0 b6d1-b6d18000 r-xp fe:00 292092 /usr/lib/gcc-lib/i686-pc-linux-gnu/3.4.6/libgcc_s.so.1 b6d18000-b6d19000 rw-p 7000 fe:00 292092 /usr/lib/gcc-lib/i686-pc-linux-gnu/3.4.6/libgcc_s.so.1 b6d19000-b6ddf000 r-xp fe:00 292103 /usr/lib/gcc-lib/i686-pc-linux-gnu/3.4.6/libstdc++.so.6.0.3 b6ddf000-b6de4000 rw-p 000c6000 fe:00 292103 /usr/lib/gcc-lib/i686-pc-linux-gnu/3.4.6/libstdc++.so.6.0.3 b6de4000-b6de9000 rw-p b6de4000 00:00 0 b6de9000-b6f16000 r-xp 03:01 40041 /lib/libc-2.6.so b6f16000-b6f17000 r--p 0012d000 03:01 40041 /lib/libc-2.6.so b6f17000-b6f19000 rw-p 0012e000 03:01 40041 /lib/libc-2.6.so b6f19000-b6f1c000 rw-p b6f19000 00:00 0 b6f1c000-b6f57000 r-xp 03:01 6397 /lib/libncurses.so.5.6 b6f57000-b6f6 rw-p 0003a000 03:01 6397 /lib/libncurses.so.5.6 b6f6-b6f8c000 r-xp 03:01 20277 /lib/libreadline.so.5.2 b6f8c000-b6f9 rw-p 0002b000 03:01 20277 /lib/libreadline.so.5.2 b6f9-b6f92000 rw-p b6f9 00:00 0 b6f92000-b6fc3000 r-xp fe:00 7746 /usr/lib/libgmp.so.3.4.1 b6fc3000-b6fc4000 rw-p 00031000 fe:00 7746 /usr/lib/libgmp.so.3.4.1 b6fc4000-b6fcb000 r-xp 03:01 35535 /lib/librt-2.6.so b6fcb000-b6fcd000 rw-p 6000 03:01 35535 /lib/librt-2.6.so b6fcd000-b6fcf000 r-xp 03:01 40037 /lib/libutil-2.6.so b6fcf000-b6fd1000 rw-p 1000 03:01 40037 /lib/libutil-2.6.so b6fd1000-b6fd6000 r-xp 03:01 40035 /lib/libcrypt-2.6.so b6fd6000-b6fd8000 rw-p 4000 03:01 40035 /lib/libcrypt-2.6.so b6fd8000-b6fff000 rw-p b6fd8000 00:00 0 b6fff000-b7001000 r-xp 03:01 40028 /lib/libdl-2.6.so b7001000-b7003000 rw-p 1000 03:01 40028 /lib/libdl-2.6.so b7003000-b7016000 r-xp 03:01 6394 /lib/libnsl-2.6.so b7016000-b7018000 rw-p 00012000 03:01 6394 /lib/libnsl-2.6.so b7018000-b701b000 rw-p b7018000 00:00 0 b701b000-b79ca000 r--p fe:00 384232 /usr/lib/libicudata.so.36.0 b79ca000-b79cb000 rw-p 009ae000 fe:00 384232 /usr/lib/libicudata.so.36.0 b79cb000-b7adc000 r-xp fe:00 403052 /usr/lib/libicuuc.so.36.0 b7adc000-b7ae3000 rw-p 00111000 fe:00 403052 /usr/lib/libicuuc.so.36.0 b7ae3000-b7ae5000 rw-p b7ae3000 00:00 0 b7ae5000-b7b08000 r-xp 03:01 40040 /lib/liAborted [EMAIL PROTECTED] ~/parrot $ It's a useful patch, and I think it *almost* works. Maybe pdb itself is broken. Also note I've created a test program[1] for pdb, at
[perl #37287] [TODO] pdb - don't die on exceptions
# New Ticket Created by Joshua Hoblitt # Please include the string: [perl #37287] # in the subject line of all future correspondence about this issue. # URL: https://rt.perl.org/rt3/Ticket/Display.html?id=37287 Subject: Re: [perl #22343] pdb + internal_exception = segfault Date: Wed, 21 Sep 2005 15:03:15 -0400 (EDT) To: Joshua Hoblitt via RT [EMAIL PROTECTED] From: Simon Glover [EMAIL PROTECTED] On Wed, 21 Sep 2005, Joshua Hoblitt via RT wrote: [EMAIL PROTECTED] - Tue May 27 19:30:39 2003]: Currently, if you're in the debugger, and do anything that causes an internal_exception call within the interpreter, you get a segfault. [Backtrace snipped] ...etc I think what's happening is that we're trying to destroy the interpreter that pdb itself is using, which will clearly cause bad things to happen. Does this bug still exist? I've just tried this out with the current snapshot, and you no longer get a segfault. However, I'd still argue that the interaction between pdb and Parrot's exception code remains buggy, as hitting an internal exception call kills not only the currently executing code but also kills the whole pdb session. It would be more useful if it just dropped you back to the main pdb prompt. Whether this is worth fixing depends on the perceived usefulness of pdb, and so isn't my call -- I certainly have no time to work on it for the forseeable future. Regards, Simon