[GRASS5] QGIS GRASS digitizer new crash

Dear Developers,

Due to some modification in Grass 6.1, which took place between 25.07.2005
and 13.08.2005, QGIS GRASS digitizer plugin crashes in a situation it used
to handle fine in the past. When a vector file's datatable is edited, which
contains some numerical column *and* a character column, and only the
numerical attribute is filled by the user, while the character column entry
he leaves empty, QGIS crashes in a following way:

QgsGrassEdit::displayDynamic Points = 0x85bacb8 type = 0
QgsGrassEdit::displayDynamic Points = 0 type = 0
No DB record
updated line = 14
node = 27 mNodeSymb = 12
node = 28 mNodeSymb = 12
QObject::connect: No such signal QTabWidget::void currentChanged(QWidget*)
QObject::connect: (sender name: 'tabCats')
QObject::connect: (receiver name: 'QgsGrassAttributesBase')
Value: 14
Value: dbmi: Protocol error
Broken pipe

The datatable of file being edited is described below:

db.describe table=plik_tekst driver=dbf
database=$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/
table:plik_tekst
description:
insert:yes
delete:yes
ncols:3

column:cat
description:
type:INTEGER
len:11
scale:0
precision:10
default:0
nullok:yes
select:yes
update:yes

column:przec
description:
type:DOUBLE PRECISION
len:20
scale:6
precision:18
default:0.000000
nullok:yes
select:yes
update:yes

column:tekst
description:
type:CHARACTER
len:50
scale:0
precision:0
default:
nullok:yes
select:yes
update:yes

After I install a Grass version from CVS at 25.07.2005 all is fine. But using 13.08.2005 or 16.08.2005 CVS I get this crash always if I leave the character field empty when editing attributes in a table containing both character and numerical column.

I don't know what is the matter and if QGIS or GRASS is guilty.

Best,
Maciek

From: "Maciek Sieczka" <werchowyna@epf.pl>
Sent: Wed, 17 Aug 2005 00:06:31 +0200

Dear Developers,

Due to some modification in Grass 6.1, which took place between 25.07.2005
and 13.08.2005, QGIS GRASS digitizer plugin crashes in a situation
it used to handle fine in the past. When a vector file's datatable
is edited, which contains some numerical column *and* a character
column, and only the numerical attribute is filled by the user,
while the character column entry he leaves empty, QGIS crashes in a
following way:

QgsGrassEdit::displayDynamic Points = 0x85bacb8 type = 0
QgsGrassEdit::displayDynamic Points = 0 type = 0
No DB record
updated line = 14
node = 27 mNodeSymb = 12
node = 28 mNodeSymb = 12
QObject::connect: No such signal QTabWidget::void
currentChanged(QWidget*) QObject::connect: (sender name:
'tabCats') QObject::connect: (receiver name:
'QgsGrassAttributesBase') Value: 14 Value: dbmi: Protocol error
Broken pipe

[...]

I don't know what is the matter and if QGIS or GRASS is guilty.

Hi, Maciek. This is probably my fault, as it manifests itself in the dbf
driver, and I've been seriously tweaking that between the dates you mention.

Have you got any idea of where in the QGIS code the update is triggered? I'm
pretty sure this is a problem with interpreting an update statement. Also,
what does an empty char column stand for? NULL? 0-length string ""? That might
also be triggering unchecked insanities in the dbf driver code.

Daniel.

From: "Daniel Calvelo Aros" <dcalvelo@minag.gob.pe>

From: "Maciek Sieczka" <werchowyna@epf.pl>

Due to some modification in Grass 6.1, which took place between 25.07.2005
and 13.08.2005, QGIS GRASS digitizer plugin crashes in a situation
it used to handle fine in the past. When a vector file's datatable
is edited, which contains some numerical column *and* a character
column, and only the numerical attribute is filled by the user,
while the character column entry he leaves empty, QGIS crashes in a
following way:

QgsGrassEdit::displayDynamic Points = 0x85bacb8 type = 0
QgsGrassEdit::displayDynamic Points = 0 type = 0
No DB record
updated line = 14
node = 27 mNodeSymb = 12
node = 28 mNodeSymb = 12
QObject::connect: No such signal QTabWidget::void
currentChanged(QWidget*) QObject::connect: (sender name:
'tabCats') QObject::connect: (receiver name:
'QgsGrassAttributesBase') Value: 14 Value: dbmi: Protocol error
Broken pipe

Hi, Maciek. This is probably my fault, as it manifests itself in the dbf
driver, and I've been seriously tweaking that between the dates you mention.

Have you got any idea of where in the QGIS code the update is triggered?

I completely useles here, sorry. Radim?

I'm pretty sure this is a problem with interpreting an update statement.
Also, what does an empty char column stand for? NULL? 0-length string ""?

I don't know what blank char entry is filled with indeed. The funny thing is that QGIS crashes only when I leave the char column blank but fill the numerical entry. If I leave both blank, all is OK.

Maciek

[me]

> Have you got any idea of where in the QGIS code the update is triggered?

[Maciek]

I completely useles here, sorry. Radim?

> I'm pretty sure this is a problem with interpreting an update statement.
> Also, what does an empty char column stand for? NULL? 0-length string ""?

I don't know what blank char entry is filled with indeed. The funny
thing is that QGIS crashes only when I leave the char column blank
but fill the numerical entry. If I leave both blank, all is OK.

Is there a debugging facility in QGIS, such as a compiler option or an
environment variable that you could use to gather more information referring
to the error?

I'll just download qgis cvs and browse the source... Will keep you posted.

Daniel.

From: "Daniel Calvelo Aros" <dcalvelo@minag.gob.pe>
<snip>

Is there a debugging facility in QGIS, such as a compiler option or an
environment variable that you could use to gather more information referring
to the error?

Yes, but my gdb keeps on telling me:

[trawiarz@quercus ~]$ gdb core.8330
GNU gdb 6.3-3.1.102mdk (Mandrakelinux)
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
"i586-mandrake-linux-gnu"..."/home/trawiarz/core.8330":
not in executable format: File format not recognized

So all I can do is to put the core for downloading so you analyze it yourself. Does that help (I've asked about this few times already on the list)? I could do that tomorrow.

Maciek

On Wed, Aug 17, 2005 at 02:30:39PM -0500, Daniel Calvelo Aros wrote:

[me]
> > Have you got any idea of where in the QGIS code the update is triggered?
[Maciek]
> I completely useles here, sorry. Radim?
>
> > I'm pretty sure this is a problem with interpreting an update statement.
> > Also, what does an empty char column stand for? NULL? 0-length string ""?
>
> I don't know what blank char entry is filled with indeed. The funny
> thing is that QGIS crashes only when I leave the char column blank
> but fill the numerical entry. If I leave both blank, all is OK.

Is there a debugging facility in QGIS, such as a compiler option or an
environment variable that you could use to gather more information referring
to the error?

Yes, this should help to enable QGIS debug:

./configure --help | grep debug
  --enable-debug Enable debuging messages [default=no]

Markus

Hi

Daniel Calvelo <daniel.calvelo@minag.gob.pe> wrote:

Try gdb -core

Steve Halasz <stevehalasz@gmail.com> wrote:

I believe the proper command is: gdb qgis core.8330

Thanks for your guiding. I should have read the http://community.qgis.org/index.php?option=com_content&task=view&id=74&Itemid=58 more carefully :).

Apparently GRASS dbf driver is guilty, not QGIS. Step by step:

1. Built GRASS, cvs 19.08.05 10:00 AM, with:

CXXFLAGS="-g -pipe"
CFLAGS="-g -pipe"
LDFLAGS=""

2. ulimit -c 300000
3. qgis
4. digitize a line in QGIS GRASS digitizer, fill in only the numerical
column (wys) and leave the char column (nazwa) empty
5. crash:

<snip>

QgsGrassEdit::displayDynamic Points = 0 type = 0
No DB record
updated line = 1210
node = 1417 mNodeSymb = 12
node = 1418 mNodeSymb = 12
QObject::connect: No such signal QTabWidget::void currentChanged(QWidget*)
QObject::connect: (sender name: 'tabCats')
QObject::connect: (receiver name: 'QgsGrassAttributesBase')
Value: 1196
Value: dbmi: Protocol error
Broken pipe

6. gdb /usr/local/grass-6.1.cvs/driver/db/dbf core.32751

<snip>

(gdb) bt#0 0xb7e051a3 in strlen () from /lib/tls/libc.so.6
#1 0x0804e4b6 in save_string (val=0x8085198, c=0x0) at str.c:27
#2 0x0804c5bb in set_val (tab=6, row=1169, col=2, val=0x8052bc0)
    at dbfexe.c:407
#3 0x0804c05e in execute (
    sql=0x8052188 "update melio_poz_clear set wys = 18.5, nazwa = null where
cat = 1195", c=0x0) at dbfexe.c:266
#4 0x0804de4c in db__driver_execute_immediate (sql=0xbffff120) at
execute.c:29
#5 0xb7fd4cd4 in db_d_execute_immediate () at d_execute.c:23
#6 0xb7fd6057 in db_driver (argc=1, argv=0xbffff234) at driver.c:106
#7 0x0804e3c3 in main (argc=1, argv=0xbffff234) at main.c:47
(gdb)

Daniel, I'm sending over the core for you in priv like you asked.

Maciek

On 8/18/05, Markus Neteler <neteler@itc.it> wrote:

> Is there a debugging facility in QGIS, such as a compiler option or an
> environment variable that you could use to gather more information referring
> to the error?

Yes, this should help to enable QGIS debug:

./configure --help | grep debug
  --enable-debug Enable debuging messages [default=no]

In GRASS plugin/provider is sometimes used:

#if QGISDEBUG > 3

so to get all messages you have to use something like
export CPPFLAGS="-DQGISDEBUG=5"
before configure.

Radim

From: "Daniel Calvelo" <daniel.calvelo@minag.gob.pe>

Hi, Maciek.

I hack-fixed it in CVS. Give it a try and tell me how it goes.

Tested with today's CVS - editing Grass DBF tables in QGIS is all OK, great. Good luck with the type union.

There's something weird going on with a type union... Consider it fixed
for now, but I'll have to clean up the code anyway.

Daniel

Best,
Maciek