Opened 14 years ago

Closed 14 years ago

#1254 closed defect (worksforme)

v.build error

Reported by: akbgf Owned by: grass-dev@…
Priority: normal Milestone: 7.0.0
Component: Vector Version: svn-trunk
Keywords: v.build Cc:
CPU: x86-32 Platform: Linux

Description

Recent changes have turned v.extract and v.build erroneous.
r44825:

v.extract input=cd78refl@CHRIS type=area list=3882 output=tmpa --overwrite
ERROR: Vector map <cd78refl@CHRIS> not found

Vector map of non-overlapping polygons cd78refl is present, can be displayed, and has the polygon of category 3882.
Output of v.info:

v.info map=cd78_refl@CHRIS layer=1
Name: cd78_refl
Mapset: CHRIS
Location: CHRIS_LE
Database: /home/grass
Title: Output from v.patch
Map scale: 1:1
Map format: native
Type of map: vector (level: 2
Number of points: 0
Number of lines: 0
Number of areas: 4503
Number of centroids: 4479
Number of boundaries: 4509
Number of islands: 4503
Map is 3D: No
Number of dblinks: 1

v.build causes segfault: kernel: v.build[20509]: segfault at 2c ip 0804922b sp bfaaa050 error 4 in v.build[8048000+2000]

Attachments (1)

debug04012011.log (2.4 KB ) - added by akbgf 14 years ago.
GDB output of v.build

Download all attachments as: .zip

Change History (12)

in reply to:  description ; comment:1 by martinl, 14 years ago

Replying to akbgf:

Recent changes have turned v.extract and v.build erroneous.
r44825:

v.extract input=cd78refl@CHRIS type=area list=3882 output=tmpa --overwrite
ERROR: Vector map <cd78refl@CHRIS> not found

Vector map of non-overlapping polygons cd78refl is present, can be displayed, and has the polygon of category 3882.
Output of v.info:

v.info map=cd78_refl@CHRIS layer=1

I see underscore in the name...

in reply to:  1 ; comment:2 by akbgf, 14 years ago

Replying to martinl:

ERROR: Vector map <cd78refl@CHRIS> not found Vector map of non-overlapping polygons

..

Output of v.info:

v.info map=cd78_refl@CHRIS layer=1

I see underscore in the name...

Sorry,
first - here I have a typing error;
second - I applied the sequence of commands:

v.extraxt ... output=tmpa
v.build map=tmpa
v.category input=tmpa output=tmpb

After that I received the error message:
ERROR: Unable to open vector map <tmpa@CHRIS> on level 2. Try to rebuild vector topology by v.build.

It seemed to me, that tmpa was missing. Now I see, that the error was caused by segfault of v.build.

in reply to:  2 ; comment:3 by martinl, 14 years ago

Replying to akbgf:

After that I received the error message:
ERROR: Unable to open vector map <tmpa@CHRIS> on level 2. Try to rebuild vector topology by v.build.

Can you reproduce this behaviour with data from spearfish or nc_spm_08?

in reply to:  3 ; comment:4 by akbgf, 14 years ago

Keywords: v.extract removed
Summary: v.extract and v.build errorsv.build error

Replying to martinl:

Replying to akbgf:

After that I received the error message:
ERROR: Unable to open vector map <tmpa@CHRIS> on level 2. Try to rebuild vector topology by v.build.

Can you reproduce this behaviour with data from spearfish or nc_spm_08?

Hi!

GRASS-7.0 r44852
spearfish_grass60data-0.3.tar.gz

v.what --v -a map=fields@PERMANENT east_north=594220.710280,4924144.962617 distance=238.345865
ERROR: You must build topology on vector map <fields@PERMANENT>
v.build map=fields@PERMANENT --overwrite
Building topology for vector map <fields@PERMANENT>...
Registering primitives...
271 primitives registered
1627 vertices registered
Building areas...
65 areas built
11 isles built
Attaching islands...
Attaching centroids...
Number of nodes: 217
Number of primitives: 271
Number of points: 0
Number of lines: 0
Number of boundaries: 208
Number of centroids: 63
Number of areas: 65
Number of isles: 11
Number of areas without centroid: 2
(Tue Jan 4 08:36:30 2011) Command finished (0 sec)
v.what --v -a map=fields@PERMANENT east_north=594266.355140,4924611.214953 distance=238.095238
ERROR: You must build topology on vector map <fields@PERMANENT>

In the /var/log/messages I have:

Jan 4 08:36:30 scorpion kernel: v.build[31129]: segfault at 2c ip 0804922b sp bffd2240 error 4 in v.build[8048000+2000]

Andres Kuusk [[BR} Tartu Observatory, Estonia

in reply to:  4 ; comment:5 by martinl, 14 years ago

Replying to akbgf:

Jan 4 08:36:30 scorpion kernel: v.build[31129]: segfault at 2c ip 0804922b sp bffd2240 error 4 in v.build[8048000+2000]

can you post some debug info?

gdb v.build
run map=field

More info at http://grass.osgeo.org/wiki/GRASS_Debugging

in reply to:  5 ; comment:6 by akbgf, 14 years ago

Replying to martinl:

Replying to akbgf:

Jan 4 08:36:30 scorpion kernel: v.build[31129]: segfault at 2c ip 0804922b sp bffd2240 error 4 in v.build[8048000+2000]

can you post some debug info?

gdb v.build
run map=field

More info at http://grass.osgeo.org/wiki/GRASS_Debugging


Some debug info is in the attached file debug04012011.log.

Andres Kuusk
Tartu Observatory, Estonia

in reply to:  6 comment:7 by mmetz, 14 years ago

Replying to akbgf:

Replying to martinl:

can you post some debug info?

gdb v.build
run map=field

More info at http://grass.osgeo.org/wiki/GRASS_Debugging

Some debug info is in the attached file debug04012011.log.

I see some suspicious settings in the debug log:

show env shows LOCATION_NAME and MAPSET, but not GISDBASE. Further on, I think that LOCATION_NAME, MAPSET, and GISDBASE are usually not visibly with show env, but can usually be shown with g.gisenv, if grass is started by running grass70. If you have set all environment variables required by grass manually, you also need to set GISDBASE.

Then there is

LD_LIBRARY_PATH=/wrk/andres/sw/linux/suse11/src/grass70/grass_trunk/dist.i686-pc-linux-gnu/lib:/usr/lib/mpi/gcc/openmpi/lib:/wrk/andres/sw/linux/suse11/bin/MonitorSoftware/lib:/wrk/andres/sw/linux/suse11/bin/MonitorSoftware/lib
GISBASE=/home/grass
PWD=/wrk/andres/sw/linux/suse11/src/grass70/grass_trunk/dist.i686-pc-linux-gnu/bin

which is strange because GISBASE is supposed to be the location of your grass installation, but it does not match LD_LIBRARY_PATH. Any reason why PWD is in the bin directory of the source build? Once grass is initialized properly, you can run grass modules from anywhere.

I guess that GISBASE and LD_LIBRARY_PATH should be either

LD_LIBRARY_PATH=/wrk/andres/sw/linux/suse11/src/grass70/grass_trunk/dist.i686-pc-linux-gnu/lib:/usr/lib/mpi/gcc/openmpi/lib:/wrk/andres/sw/linux/suse11/bin/MonitorSoftware/lib:/wrk/andres/sw/linux/suse11/bin/MonitorSoftware/lib
GISBASE=/wrk/andres/sw/linux/suse11/src/grass70/grass_trunk/dist.i686-pc-linux-gnu

or

LD_LIBRARY_PATH=/home/grass/lib:/usr/lib/mpi/gcc/openmpi/lib:/wrk/andres/sw/linux/suse11/bin/MonitorSoftware/lib:/wrk/andres/sw/linux/suse11/bin/MonitorSoftware/lib
GISBASE=/home/grass

in case you have installed grass to /home/grass.

Finally,

GISRC=/wrk/andres/.grass7/rc

looks suspicious because grass7 uses a temporary copy of rc, usually located in something like

GISRC=/tmp/grass7-<user name>-<pid>/gisrc

(side note to devs: why not in the grass .tmp directory ?)

Altogether, it seems that grass is not started properly.

Markus M

by akbgf, 14 years ago

Attachment: debug04012011.log added

GDB output of v.build

comment:8 by akbgf, 14 years ago

Hi!

v.build works in r44921.

Andres Kuusk

in reply to:  8 comment:9 by akbgf, 14 years ago

Replying to akbgf:

Hi!

v.build works in r44921.

Andres Kuusk

Sorry, still segfaults. /var/log/messages:
kernel: v.extract[28764]: segfault at 8 ip b77fec0f sp bfc92e78 error 4 in libgrass_vector.7.0.svn.so[b77d5000+47000]
kernel: v.build[28784]: segfault at 2c ip 0804922b sp bffe5ab0 error 4 in v.build[8048000+2000]
v.extract[29368]: segfault at 8 ip b7864c0f sp bfa79d18 error 4 in libgrass_vector.7.0.svn.so[b783b000+47000]
v.build[29399]: segfault at 2c ip 0804922b sp bf8465f0 error 4 in v.build[8048000+2000]

A.K.

comment:10 by akbgf, 14 years ago

Hi!

It works in r45123.
I tested v.extract, v.build, v.category, v.info, v.what, v.db.connect, db.columns, v.db.dropcolumn, v.db.droptable, v.db.addtable, g.mlist, v.rast.stats.

Great! Thank you very much!

Andres Kuusk; Tartu Observatory, Estonia

comment:11 by martinl, 14 years ago

Resolution: worksforme
Status: newclosed
Note: See TracTickets for help on using tickets.