This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: (971023) Addendum: i386-linux-gnulibc1 g++ test results


	May be, I can expand a little on these exception handling problems.
	I'm not quite sure that the following problem is related to those
	that you reported, but it might be one instance of the problem...

	My system is Linux with a 2.0.29 kernel and libc.so.5.3.12.
	The compiler is configured as a i586-pc-linux-gnulibc1.
	The problem is consistently present with all snapshots since (and
    including) 970917, I believe the example worked fine with the 1997-09-10
    but I have to check it once again. My test example (excerpted from blitz++)
    does not work properly.

// Exceptions
// BZ_EXCEPTIONS

#include <typeinfo>

class foo { };

int divide(int a, int b)
{
    if (b == 0)
        throw foo();

    return a / b;
}

int main()
{
    try {
        divide(5,0);
    }
    catch(foo x) {
        return 0;
    }

    return 1;
}

	The problem appears in the function copy_reg of libgcc2.c, which seems
	to get incompatible udata and target_udata parameters for register 16,
	so abort is called. My little knowledge of gcc/egcs internals does not
	allow me to find exactly where is the source of the problem.

	Here is a trace under gdb with except.exe.971016 but I verified backwards
	that it is exactly the same with all the snapshots I mentionned above. The
	970907 snapshot fails with a bus error and since I know that this example
	program has been working with a previous snapshot, that's why I suspect
    that the snapshot 1997-09-10 is working. I have to dowload it again
	to check this out.

hawai->/0/robotvis/papadop/egcs/bin/g++ -g except.cpp -o except.exe.971016
hawai->gdb except.exe.971016
GDB is free software and you are welcome to distribute copies of it
 under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.16 (i586-unknown-linux), Copyright 1996 Free Software Foundation, Inc...
(gdb) b copy_reg
Breakpoint 1 at 0x80497d6: file ./libgcc2.c, line 3566.
(gdb) r
Starting program: /0/robotvis/papadop/INRIA/c++/blitz++/Blitz++-0.2/compiler/except.exe.971016 
warning: Unable to find dynamic linker breakpoint function.
warning: GDB will be unable to debug shared library initializers
warning: and track explicitly loaded dynamic code.
 
Breakpoint 1, copy_reg (reg=3, udata=0xbffff254, target_udata=0xbffff1e4)
    at ./libgcc2.c:3566
3566      if (udata->saved[reg] == REG_SAVED_OFFSET
Current language:  auto; currently c
(gdb) c
Continuing.
 
Breakpoint 1, copy_reg (reg=5, udata=0xbffff254, target_udata=0xbffff1e4)
    at ./libgcc2.c:3566
3566      if (udata->saved[reg] == REG_SAVED_OFFSET
(gdb) 
Continuing.
 
Breakpoint 1, copy_reg (reg=6, udata=0xbffff254, target_udata=0xbffff1e4)
    at ./libgcc2.c:3566
3566      if (udata->saved[reg] == REG_SAVED_OFFSET
(gdb) 
Continuing.
 
Breakpoint 1, copy_reg (reg=8, udata=0xbffff254, target_udata=0xbffff1e4)
    at ./libgcc2.c:3566
3566      if (udata->saved[reg] == REG_SAVED_OFFSET
(gdb) 
Continuing.
 
Breakpoint 1, copy_reg (reg=13, udata=0xbffff254, target_udata=0xbffff1e4)
    at ./libgcc2.c:3566
3566      if (udata->saved[reg] == REG_SAVED_OFFSET
(gdb) 
Continuing.
 
Breakpoint 1, copy_reg (reg=16, udata=0xbffff254, target_udata=0xbffff1e4)
    at ./libgcc2.c:3566
3566      if (udata->saved[reg] == REG_SAVED_OFFSET
(gdb) p *udata
$1 = {cfa = 0xbffff350, eh_ptr = 0x804d160, cfa_offset = 8, args_size = 0, 
  reg_or_offset = {-8, -16, 0, -20, 0, -8, -16, 0, -4, 0, 0, 0, 0, -216, 0, 0, 
    -192, 0}, cfa_reg = 5, retaddr_column = 8, 
  saved = "\000\000\000\001\000\001\001\000\001\000\000\000\000\001\000\000\001"}
(gdb) p *target_udata
$2 = {cfa = 0xbffff33c, eh_ptr = 0x0, cfa_offset = 8, args_size = 0, 
  reg_or_offset = {0, 0, 0, -396, 0, -8, -392, -388, -4, 0, 0, 0, 0, -216, 0, 
    0, 0, 0}, cfa_reg = 5, retaddr_column = 8, 
  saved = "\000\000\000\001\000\001\001\001\001\000\000\000\000\001\000\000\000"}
(gdb) n
3572        abort ();

		Theo.

--------------------------------------------------------------------
Theodore Papadopoulo
 Email:  papadop@sophia.inria.fr               Tel: (33) 93 65 76 01
 --------------------------------------------------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]