Opened 16 years ago

Closed 16 years ago

#41 closed defect (fixed)

g.mapsets crash

Reported by: neteler Owned by: grass-dev@…
Priority: major Milestone: 6.4.0
Component: Default Version: svn-trunk
Keywords: Cc:
CPU: Unspecified Platform: Unspecified

Description

When launching g.mapsets in a new mapset which was generated on command line (this is needed to do parallel computations on a cluster):

grass63 ~/grassdata/pat/aqua_lst1km20020706.LST_Night_1km.filt

it crashes:

GRASS 6.3.svn (pat):~ > g.mapsets add=modisLSTaqua,modisLSTterra
Segmentation fault

GRASS 6.3.svn (pat):~ > gdb `which g.mapsets`
GNU gdb 6.6-1mdv2007.1 (Mandriva Linux release 2007.1)
Copyright (C) 2006 Free Software Foundation, Inc.
...
This GDB was configured as "x86_64-mandriva-linux-gnu"...
Using host libthread_db library "/lib64/libthread_db.so.1".
(gdb) r add=modisLSTaqua,modisLSTterra
Starting program: /home/neteler/grass63/dist.x86_64-unknown-linux-gnu/bin/g.mapsets add=modisLSTaqua,modisLSTterra

Program received signal SIGSEGV, Segmentation fault.
0x00002ba0dad1904c in G__mapset_name (n=0) at mapset_nme.c:46
46          return mapset_name[n];
(gdb) bt full
#0  0x00002ba0dad1904c in G__mapset_name (n=0) at mapset_nme.c:46
No locals.
#1  0x0000000000401353 in main (argc=2, argv=0x7fffcffdd058) at main_cmd.c:119
        oldname = 0x0
        n = 0
        i = 0
        skip = 0
        cur_mapset = 0x0
        ptr = (char **) 0x0
        tokens = (char **) 0x0
        no_tokens = 11168
        fp = (FILE *) 0x401a50
        module = (struct GModule *) 0x2ba0daf51680
        opt1 = (struct Option *) 0x2ba0daf515e0
        opt2 = (struct Option *) 0x6074a0
        print = (struct Flag *) 0x607560
        list = (struct Flag *) 0x2ba0daf515a0
(gdb)

The mapset contains at this stage:

ls -l ~/grassdata/pat/aqua_lst1km20020706.LST_Night_1km.filt/
total 4
drwxr-xr-x 2 neteler neteler 1024 Feb  9 09:08 dbf/
drwx------ 2 neteler neteler 1024 Feb  9 09:09 tmp/
-rw-r--r-- 1 neteler neteler   66 Feb  9 09:08 VAR
-rw----r-- 1 neteler neteler  293 Feb  9 09:08 WIND

Also crashes

g.mapsets -p
Segmentation fault

for possibly the same (to me unknown) reason.

My tries to debug that with 'ddd' failed.

Markus

Change History (5)

comment:1 by neteler, 16 years ago

Update: apparently the mapset name LENGTH matters:

grass63 ~/grassdata/pat/abcdefghijklmnopqrstuvwxyz123456
GRASS 6.3.svn (pat):~ > g.mapsets -p
abcdefghijklmnopqrstuvwxyz123456 PERMANENT
exit

grass63 ~/grassdata/pat/abcdefghijklmnopqrstuvwxyz1234567
GRASS 6.3.svn (pat):~ > g.mapsets -p
Segmentation fault

echo -n abcdefghijklmnopqrstuvwxyz1234567 | wc -c
33


comment:2 by neteler, 16 years ago

The new g.mapsets changesets [30031] (longer buffers) and [30030] (use GMAPSET_MAX, GPATH_MAX) did not help.

comment:3 by neteler, 16 years ago

As suggested by Paul, fixed as [30032] (http://trac.osgeo.org/grass/changeset/30032).

I am not sure yet about the exit status of the function.

comment:4 by neteler, 16 years ago

Milestone: 6.3.06.4.0

comment:5 by neteler, 16 years ago

Resolution: fixed
Status: newclosed

Now it works. Closed.

Note: See TracTickets for help on using tickets.