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

neteler@itc.it wrote (Mon, Nov 27 2006 19:08:21):

the graphical frontend to gdb, will get you to the offending line.
There you can check variable settings before the program crashes and so
forth.

I don't know a thing about C, or any other programming language (only basics
of shell and awk). Thus I really doubt debugging C code by me makes much sense.

Maybe you could give 'ddd' a try first? It's really not so difficult.

But I need to now something about how C works, more or less, don't I?

Do you suppose the problem could be due to my setup, not the v.db.select code?

I would greatly appreciate if anybody could try reproducing the segfault.

Maciek

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

Maciek Sieczka via RT wrote:

> Maybe you could give 'ddd' a try first? It's really not so difficult.

But I need to now something about how C works, more or less, don't I?

you can still find out where it breaks, without understanding the "why".

some gdb hints:
GRASS> gdb `which v.db.select`

(gdb) run map=foo where="this = 'that'"
[...]
<segfault>

#full backtrace
(gdb) bt f

#list code at point in source code where it broke
(gdb) l

#change function reference frame (#1, #2, #3, ... in bt list)
frame <number>

#list code at breakpoint (in new frame)
(gdb) l

#print variable value at this point ("bt full" shows all values)
(gdb) p <variable name>

Hamish