[GRASS-dev] [bug #5341] (grass) v.db.select: segfault

Maciek Sieczka via RT grass-bugs at intevation.de
Tue Nov 28 06:25:07 EST 2006

hamish_nospam at yahoo.com wrote (Tue, Nov 28 2006 00:13:48):

Hamish and All,

Thanks for the hints!

I did some (cough)de(cough)bugging. I have put the coredump for others to try:

To use it:

$ grass63 (any location)
$ gdb v.db.select core

(gdb) bt
#0  0xb76b3943 in free () from /lib/tls/i686/cmov/libc.so.6
#1  0xb76b4a86 in realloc () from /lib/tls/i686/cmov/libc.so.6
#2  0xb7f50069 in db_realloc (s=0x38, n=1293960530) at alloc.c:76
#3  0xb7f53e12 in db_enlarge_string (x=0xbfc9bfd8, len=134832184)
    at string.c:133
#4  0xb7f5407f in db_append_string (x=0xbfc9bfd8,
    s=0x8096040 " WHERE MAPS_COVER='built up'") at string.c:220
#5  0x080494ee in main (argc=3, argv=0x8096040) at main.c:122

Below is the code where it segfaults (frame #5, I guess):

(gdb) l
122            db_append_string ( &sql, buf );
123         }
125         if (db_open_select_cursor(driver, &sql, &cursor, DB_SEQUENTIAL) !=
126             G_fatal_error(_("Cannot open select cursor"));
128         table = db_get_cursor_table (&cursor);
129         ncols = db_get_table_number_of_columns (table);
131         /* column names if horizontal output */

Any good? The coredump is available, anybody savvy can try themselves.


-------------------------------------------- Managed by Request Tracker

More information about the grass-dev mailing list