Bug or compile issue?

Charles Day cedayiv at gmail.com
Tue Jan 27 06:37:42 EST 2009


I'm seeing some CRIT messages on my Mac, which is running the latest code
from SVN trunk. I've used gdb to try to figure out what's happening, and it
seems a bit weird, like a possible compile or other platform-specific issue.
The CRIT messages look like:
* 03:28:15  CRIT <gnc.ledger>         [gnc_split_register_get_trans_split()]
bad row
* 03:28:15  CRIT <gnc.register.gnome>
gnucash_sheet_cursor_set_from_table: assertion `gnucash_sheet_cell_valid
(sheet, v_loc)' failed

The specific line that seems to fail is line 1471 of
src/register/register-core/table-allgui.c:
  vloc = *virt_loc;

This statement is supposed to copy a struct:

(gdb) whatis vloc
type = VirtualLocation
(gdb) whatis *virt_loc
type = VirtualLocation
(gdb) ptype VirtualLocation
type = struct _VirtualLocation {
    VirtualCellLocation vcell_loc;
    int phys_row_offset;
    int phys_col_offset;
}
(gdb) ptype VirtualCellLocation
type = struct _VirtualCellLocation {
    int virt_row;
    int virt_col;
}

However, the struct only seems to be copied properly *sometimes*.  For
example:
(gdb) next
1471  vloc = *virt_loc;
(gdb) print *virt_loc
$82 = {
  vcell_loc = {
    virt_row = 2,
    virt_col = 0
  },
  phys_row_offset = 0,
  phys_col_offset = 0
}
(gdb) next
1473  vcell = gnc_table_get_virtual_cell (table, vloc.vcell_loc);
(gdb) print vloc
$90 = {
  vcell_loc = {
    virt_row = 2,
    virt_col = 0
  },
  phys_row_offset = -1073749880,
  phys_col_offset = 720727
}

So part of the struct copied OK (virt_row, virt_col) and the rest seems to
be garbage (phys_row_offset, phys_col_offset). Even stepping forward a few
more times doesn't change the result. Any ideas how this could be happening?
Some kind of optimization I should turn off perhaps?

I don't think it is a gdb problem, as I still get the CRIT messages without
gdb.

Cheers,
Charles


More information about the gnucash-devel mailing list