[GRASS-dev] GRASS and QGIS on Win32, testing etc.

Moritz Lennert mlennert at club.worldonline.be
Thu May 24 18:13:02 EDT 2007


On Tue, May 22, 2007 05:05, Glynn Clements wrote:
>
> Moritz Lennert wrote:
>
>> > 1. The DBF driver deadlocks randomly!
>> > Any GRASS module that needs to access the attribute table (DBF format)
>> > of a vector map is prone to this: E.g. I tried running v.out.ogr on a
>> > map with ca. 3000 points repeatedly. Out of ten runs, 2 or 3 deadlock
>> at
>> > a random point. The task manager shows that v.out.ogr is sleeping with
>> > 0% CPU.
>>
>> I can reproduce this, both with your location and in spearfish. And at
>> first glance, it really does appear random. The only thing that I think
>> I
>> noticed, was that it happens more often when the machine is busy with
>> something else. My first very wild guess would be something system
>> resources, but as I said, this is very wild.
>>
>> Glynn, any hints as to where I should begin searching ?
>
> Run v.out.ogr under gdb; when it deadlocks, hit Ctrl-C, then type
> "where" to get a backtrace (assuming that this works on Windows).

It does. Backtrace attached. However, I am not sure that this backtrace is
very useful (many ??). Looking for an explanation, I found this:

http://www.cygwin.com/ml/cygwin/2006-09/msg00409.html

But maybe I have to compile with some debug option of gcc ? (gcc -g ?)

(
If others want to try, these are the commands I used:

gdb (from MinGW)
> file v.out.ogr
> run in=points dsn=c:/testing olayer=points type=point
> Ctrl-C when it deadlocks
> set logging on
> where
> quit
)


>
> Or, if you can figure out how to attach gdb to a running process,
> better still, as you can also get a backtrace for the DBF driver (on
> Unix, you use "attach <pid>", but I don't know if that works on
> Windows).

It's possible:
- In the Windows Task-Manager (Ctrl-Alt-Delete) go to View->Select Columns
and add PID.
- run v.out.ogr command
- when it deadlocks, run gdb in another cmd.exe window
- use 'attach PID'

backtrace attached. Same ?? problem.

>
> Also, "g.gisenv set=DEBUG=3" might help.

I didn't have the feeling that it did, but I have attached an excerpt with
the last lines.

Moritz
-------------- next part --------------
#0  0x7c87533d in KERNEL32!GetConsoleCharType ()
   from C:\WINDOWS\system32\kernel32.dll
#1  0x00000000 in ?? () from 
#2  0x013af7ac in ?? ()
#3  0x00000000 in ?? () from 
#4  0x40010005 in ?? ()
#5  0x00000000 in ?? () from 
#6  0x00000000 in ?? () from 
#7  0x7c87533d in KERNEL32!GetConsoleCharType ()
   from C:\WINDOWS\system32\kernel32.dll
#8  0x00000000 in ?? () from 
#9  0x80502592 in ?? ()
#10 0x00780010 in libgdal!asDatumInfoList ()
#11 0x00000008 in ?? ()
#12 0x00000000 in ?? () from 
#13 0x00000000 in ?? () from 
#14 0x00000000 in ?? () from 
#15 0x804fef02 in ?? ()
#16 0x00000001 in ?? ()
#17 0x00010002 in ?? ()
#18 0x00000000 in ?? () from 
#19 0x7c810659 in KERNEL32!CreateThread ()
   from C:\WINDOWS\system32\kernel32.dll
#20 0x87e29020 in ?? ()
#21 0xa7943d50 in ?? ()
#22 0x00000000 in ?? () from 
#23 0x87e29108 in ?? ()
#24 0xa7943c01 in ?? ()
#25 0x00000000 in ?? () from 
#26 0x890a2020 in ?? ()
#27 0x00000000 in ?? () from 
#28 0x00000000 in ?? () from 
#29 0x010aff2c in ?? ()
#30 0x00000000 in ?? () from 
#31 0x010affdc in ?? ()
#32 0x7c839aa8 in ValidateLocale () from C:\WINDOWS\system32\kernel32.dll
#33 0x7c875460 in KERNEL32!GetConsoleCharType ()
   from C:\WINDOWS\system32\kernel32.dll
#34 0x00000000 in ?? () from 
#35 0x010affec in ?? ()
#36 0x7c80b683 in KERNEL32!GetModuleFileNameA ()
   from C:\WINDOWS\system32\kernel32.dll
#37 0x00000000 in ?? () from 
#38 0x00000000 in ?? () from 
#39 0x013af7ac in ?? ()
#40 0x00000000 in ?? () from 
#41 0x7ffde000 in ?? ()
#42 0x89aaf600 in ?? ()
#43 0x010affc0 in ?? ()
#44 0x87e26718 in ?? ()
#45 0xffffffff in ?? ()
#46 0x7c839aa8 in ValidateLocale () from C:\WINDOWS\system32\kernel32.dll
#47 0x7c80b690 in KERNEL32!GetModuleFileNameA ()
   from C:\WINDOWS\system32\kernel32.dll
#48 0x00000000 in ?? () from 
#49 0x00000000 in ?? () from 
#50 0x00000000 in ?? () from 
#51 0x7c875280 in KERNEL32!GetConsoleCharType ()
   from C:\WINDOWS\system32\kernel32.dll
#52 0x00000000 in ?? () from 
#53 0x00000000 in ?? () from 
Cannot access memory at address 0x10b0000
-------------- next part --------------
#0  0x7c911231 in ntdll!DbgUiConnectToDbg () from C:\WINDOWS\system32\ntdll.dll
#1  0x7c9607a8 in ntdll!KiIntSystemCall () from C:\WINDOWS\system32\ntdll.dll
#2  0x00000005 in ?? ()
#3  0x00000004 in ?? ()
#4  0x00000001 in ?? ()
#5  0x0089ffd0 in ?? ()
#6  0x00000246 in ?? ()
#7  0xffffffff in ?? ()
#8  0x7c91ee18 in strchr () from C:\WINDOWS\system32\ntdll.dll
#9  0x7c9607c8 in ntdll!KiIntSystemCall () from C:\WINDOWS\system32\ntdll.dll
#10 0x00000000 in ?? () from 
#11 0x00000000 in ?? () from 
#12 0x00000000 in ?? () from 
#13 0x00000000 in ?? () from 
Cannot access memory at address 0x8a0000
ContinueDebugEvent (cpid=5748, ctid=2864, DBG_CONTINUE);
Detaching from program: c:\grass\grass-6.3.cvs\driver\db\dbf.exe, Pid 5748
gdb: child_close, inferior_ptid=0
-------------- next part --------------
D2/3: SQL: SELECT * FROM points WHERE cat = 2885
D3/3: SQL statement parsed successfully: SELECT * FROM points WHERE cat = 2885
D2/3: find_table(): table = points
D2/3:   ? points
D2/3: load_table_head(): tab = 0, C:/grassdata/qgis-test/user/dbf//points.dbf
D3/3: Doing SQL command <4> on DBF table... (see include/sqlp.h)
D2/3: SELECT
D2/3: sel(): tab = 0
D2/3: load_table(): tab = 0
D2/3: load_table_head(): tab = 0, C:/grassdata/qgis-test/user/dbf//points.dbf
D2/3: col 0 : val = 2885
D2/3:   colctype = 2
D2/3: col 1 : val = 2885
D2/3:   colctype = 3
D2/3: col 2 : val = 71.71
D2/3:   colctype = 3
D3/3: Vect_read_line()
D3/3: V2_read_line_nat(): line = 2886
D3/3: Vect__Read_line_nat: offset = 83679
D3/3:     type = 1, do_cats = 1 dead = 0
D3/3:     n_cats = 1
D3/3:     n_points = 1
D3/3:     off = 83708
D2/3: line = 2886 type = 1
D2/3: mk_att() cat = 2886, doatt = 1
D2/3: SQL: SELECT * FROM points WHERE cat = 2886
D3/3: SQL statement parsed successfully: SELECT * FROM points WHERE cat = 2886
D2/3: find_table(): table = points
D2/3:   ? points
D2/3: load_table_head(): tab = 0, C:/grassdata/qgis-test/user/dbf//points.dbf
D3/3: Doing SQL command <4> on DBF table... (see include/sqlp.h)
D2/3: SELECT
D2/3: sel(): tab = 0
D2/3: load_table(): tab = 0
D2/3: load_table_head(): tab = 0, C:/grassdata/qgis-test/user/dbf//points.dbf
D2/3: col 0 : val = 2886
D2/3:   colctype = 2
D2/3: col 1 : val = 2886
D2/3:   colctype = 3
D2/3: col 2 : val = 71.8
D2/3:   colctype = 3
D3/3: Vect_read_line()
D3/3: V2_read_line_nat(): line = 2887
D3/3: Vect__Read_line_nat: offset = 83708
D3/3:     type = 1, do_cats = 1 dead = 0
D3/3:     n_cats = 1
D3/3:     n_points = 1
D3/3:     off = 83737
D2/3: line = 2887 type = 1
D2/3: mk_att() cat = 2887, doatt = 1
D2/3: SQL: SELECT * FROM points WHERE cat = 2887
D3/3: SQL statement parsed successfully: SELECT * FROM points WHERE cat = 2887
D2/3: find_table(): table = points
D2/3:   ? points
D2/3: load_table_head(): tab = 0, C:/grassdata/qgis-test/user/dbf//points.dbf
D3/3: Doing SQL command <4> on DBF table... (see include/sqlp.h)
D2/3: SELECT
D2/3: sel(): tab = 0
D2/3: load_table(): tab = 0
D2/3: load_table_head(): tab = 0, C:/grassdata/qgis-test/user/dbf//points.dbf
D2/3: col 0 : val = 2887
D2/3:   colctype = 2
D2/3: col 1 : val = 2887
D2/3:   colctype = 3
D2/3: col 2 : val = 71.72
D2/3:   colctype = 3
D3/3: Vect_read_line()
D3/3: V2_read_line_nat(): line = 2888
D3/3: Vect__Read_line_nat: offset = 83737
D3/3:     type = 1, do_cats = 1 dead = 0
D3/3:     n_cats = 1
D3/3:     n_points = 1
D3/3:     off = 83766
D2/3: line = 2888 type = 1
D2/3: mk_att() cat = 2888, doatt = 1
D2/3: SQL: SELECT * FROM points WHERE cat = 2888
D3/3: SQL statement parsed successfully: SELECT * FROM points WHERE cat = 2888
D2/3: find_table(): table = points
D2/3:   ? points
D2/3: load_table_head(): tab = 0, C:/grassdata/qgis-test/user/dbf//points.dbf
D3/3: Doing SQL command <4> on DBF table... (see include/sqlp.h)
D2/3: SELECT
D2/3: sel(): tab = 0
D2/3: load_table(): tab = 0
D2/3: load_table_head(): tab = 0, C:/grassdata/qgis-test/user/dbf//points.dbf
^C


More information about the grass-dev mailing list