#552 virtual baseclass botch

closed-fixed
Chris Johns
gdb (39)
2005-12-02
2004-04-16
Eugene
No

I have a program compiled by gcc version 3.2.3 (mingw
special 20030504-1).
I use gdb 6.0 taken grom SF and I recompiled gdb 6.0.90
under mingw.

When I have a pointer to class and make print *class I
have a message - "virtual baseclass botch"
It's happens viewing any class. With structures it works
fine.

What can be done here? Can a change gdb or gcc
version help?

Discussion

  • Luke Dunstan
    Luke Dunstan
    2004-04-16

    Logged In: YES
    user_id=30442

    You should probably try a newer release of GCC first. If that
    doesn't help, could you provide a small example program that
    demonstrates the problem?

     
  • Eugene
    Eugene
    2004-04-16

    Logged In: YES
    user_id=1022506

    I've tryed newer gcc ver 3.2.1.
    About a small program... I'll try now to make a small
    reproducible case.

     
  • Luke Dunstan
    Luke Dunstan
    2004-04-16

    Logged In: YES
    user_id=30442

    Actually the latest release of MinGW GCC is 3.3.3. See the
    Candidate section at the top of this list:

    http://www.mingw.org/download.shtml

     
  • Eugene
    Eugene
    2004-04-19

    Logged In: YES
    user_id=1022506

    I've compiled with gcc 3.3.3. And tryed to make a simple
    reproducible case. There are no simple cases for this bug...
    I'll try to make it anyway.
    I can give you not simple but reproducible case.

     
  • Luke Dunstan
    Luke Dunstan
    2004-04-19

    Logged In: YES
    user_id=30442

    That's okay, you don't have to make the test case simple if
    it's too difficult.

     
  • Eugene
    Eugene
    2004-04-19

    Logged In: YES
    user_id=1022506

    Ok. Here is big reproducible case.
    In the file there is a library, sources for that library and the
    main program. There are 2 makefiles - one for compiling library
    if needed. One for compiling main program.
    in main program just put breakpoint in main.cpp:34 and after
    hitting it make print *mem
    Library is compiled with gcc 3.3.3 and binutils 2.15.90 on
    windows mingw edition

     
  • Eugene
    Eugene
    2004-04-19

    Logged In: YES
    user_id=1022506

    Sorry. File was too big.
    It can be downloaded from
    ftp://jetsword:hevonen@62.121.44.28/recent
    uploads/zip/systemc.zip

    And there is the exe file ready too.

     
  • Luke Dunstan
    Luke Dunstan
    2004-04-19

    Logged In: YES
    user_id=30442

    I get this:

    (gdb) p *mem
    $1 = {<simple_bus_slave_if> = {<simple_bus_direct_if> = {<>
    = <invalid address>, <No data fields>}, <No data fields>}, <>
    = {<No data fields>}, current_address = 3131961357,
    bytes_left = 0,
    data_ptr = 0xbaadf00d <Address 0xbaadf00d out of
    bounds>, pli_data = 0x0,
    start_of_transaction = false}
    (gdb) p mem
    $2 = (memory *) 0x3d7e80

    Do you get the same output? Where is the "virtual baseclass
    botch" part?

     
  • Eugene
    Eugene
    2004-04-19

    Logged In: YES
    user_id=1022506

    I get exactly here a message virtual baseclass botch.
    Can you describe full environment where you compiled - which
    versions of packages and which gdb have you used?

    I get this error all the time using gcc and gdb mingw edition.

     
  • Eugene
    Eugene
    2004-04-19

    Logged In: YES
    user_id=1022506

    And can you download on that ftp servet the executable you
    have with debugging information? I want to check it.

     
  • Luke Dunstan
    Luke Dunstan
    2004-04-19

    Logged In: YES
    user_id=30442

    Sorry, I had built the library without the "-g" flag and when I
    added this it does give your error. It seems like a compiler
    bug so it should probably be reported to the GCC bug tracker
    at gcc.gnu.org. If I have time I may try to reduce the code
    or try a prerelease of GCC 3.4.

     
  • Luke Dunstan
    Luke Dunstan
    2004-04-19

    • labels: 480764 --> 103944
     
  • Eugene
    Eugene
    2004-04-19

    Logged In: YES
    user_id=1022506

    Thanks. Where can I get or build prerelease of gcc?

     
  • Eugene
    Eugene
    2004-05-19

    Logged In: YES
    user_id=1022506

    This still happens on gcc 3.4 gdb 6.0 and 6.1 compiled with
    debug information

     
  • Chris Johns
    Chris Johns
    2004-05-22

    • labels: 103944 --> gdb
     
  • Chris Johns
    Chris Johns
    2004-05-22

    Logged In: YES
    user_id=197074

    I ran the posted test case (systemc.zip) and the problem
    seems to be fixed in the CVS main line of GDB. It was not
    fixed in gdb-6.1. I have changed the Category to GDB. Here
    is the GDB output:

    $ /opt/gdb-cvs/bin/gdb.exe systemc_transaction_vhdl.exe
    GNU gdb 2004-05-22-cvs
    Copyright 2004 Free Software Foundation, Inc.
    GDB is free software, covered by the GNU General Public
    License, and you are
    welcome to change it and/or 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.
    This GDB was configured as "i686-pc-mingw32"...
    (gdb) b main.cpp:34
    Breakpoint 1 at 0x401501: file main.cpp, line 34.
    (gdb) r
    Starting program: c:\opt\work\test/systemc_transaction_vhdl.exe

    Breakpoint 1, sc_memory_driver_calltf () at main.cpp:34
    34 return 0;
    (gdb) p *mem
    $1 = {<simple_bus_slave_if> = {<simple_bus_direct_if> =
    {<sc_interface> = {
    _vptr$sc_interface = 0x46f998, static
    m_never_notified = {
    m_simc = 0x3d5a48, m_notify_type = NONE, m_delta =
    -1,
    m_timed = 0x0, m_methods_static =
    {<sc_pvector_base> = {
    m_alloc = 10, m_sz = 0, m_data = 0x3d6578},
    <No data fields>},
    m_methods_dynamic = {<sc_pvector_base> = {m_alloc
    = 10, m_sz = 0,
    m_data = 0x3d65b8}, <No data fields>},
    m_threads_static = {<sc_pvector_base> = {m_alloc =
    10, m_sz = 0,
    m_data = 0x3d65f8}, <No data fields>},
    m_threads_dynamic = {<sc_pvector_base> = {m_alloc
    = 10, m_sz = 0,
    m_data = 0x3d6638}, <No data fields>}}}, <No
    data fields>}, <No data fields>}, <sc_module> = {<sc_object>
    = {_vptr$sc_object = 0x46f9b8,
    static kind_string = 0x46aec3 "sc_object", m_simc =
    0x3d5a48,
    m_ptr = 0x3d8120 "\001bus.mem", m_name = 0x3d8121
    "bus.mem",
    m_attr_cltn = {m_cltn = {<sc_pvector_base> = {m_alloc
    = 10, m_sz = 0,
    m_data = 0x3d80e0}, <No data fields>}}},
    static kind_string = 0x46ac50 "sc_module", sensitive = {
    m_module = 0x3d8054, m_mode = SC_NONE_, m_handle = 0x0},
    sensitive_pos = {m_module = 0x3d8054, m_mode = SC_NONE_,
    m_handle = 0x0},
    sensitive_neg = {m_module = 0x3d8054, m_mode = SC_NONE_,
    m_handle = 0x0},
    m_end_module_called = false, m_port_vec = 0x3d8188,
    m_port_index = 0,
    m_name_gen = 0x3d8208, m_child_objects =
    {<sc_pvector_base> = {
    m_alloc = 10, m_sz = 0, m_data = 0x3d8148}, <No data
    fields>}},
    current_address = 3131961357, bytes_left = 0,
    data_ptr = 0xbaadf00d <Address 0xbaadf00d out of bounds>,
    pli_data = 0x0,
    start_of_transaction = false}
    (gdb) q

     
  • Eugene
    Eugene
    2004-05-23

    Logged In: YES
    user_id=1022506

    Thanks. Can you tell where Is cvs for GDB with this problem
    fixed.
    Or can you exactly tell (if possible) ehich files have been
    fixed?

     
  • Chris Johns
    Chris Johns
    2004-05-23

    Logged In: YES
    user_id=197074

    I am in the process of make a new release for you to test. I
    hope it will allow this PR to be closed.

    I will upload it the MinGW download page and update this PR
    when I have something. It has built and I have the patch. I
    just need to install GDB and package the installer. Makeinfo
    is giving me trouble. It looks like makeinfo in MSYS will
    need to be version 4.7 soon'ish.

     
  • Eugene
    Eugene
    2004-05-23

    Logged In: YES
    user_id=1022506

    Thanks.
    Waiting for the patch and new GDB.

     
  • Chris Johns
    Chris Johns
    2004-05-23

    Logged In: YES
    user_id=197074

    It is on SF under the MinGW Download page. The patch is in
    the package under doc\gdb.

    Please update this PR is the issue is resolved.

     
  • Eugene
    Eugene
    2004-05-24

    Logged In: YES
    user_id=1022506

    Bug is resolved.
    Thank you.

     
  • Chris Johns
    Chris Johns
    2005-12-02

    • status: open --> open-fixed
     
  • Chris Johns
    Chris Johns
    2005-12-02

    Logged In: YES
    user_id=197074

    A later version of GDB resolved this problem.

     
  • Chris Johns
    Chris Johns
    2005-12-02

    • status: open-fixed --> closed-fixed