[GRASS5] [bug #4184] (grass) v.digit segfaults a lot.

this bug's URL: http://intevation.de/rt/webrt?serial_num=4184
-------------------------------------------------------------------------

Subject: v.digit segfaults a lot.

Platform: Mac OSX
grass obtained from: Mirror of Trento site
grass binary for platform: Downloaded precompiled Binaries
GRASS Version: Moretti's 11.MAR build for OSX

I've been getting a segmentation fault almost every time I launch v.digit, whether in d.m, gis.m, or plain command-line from X11.app (Mac OS X 10.4.5, 2x G5/ 2GB RAM). I'm using the 11 MAR build, but have gotten similar behavior from the 09 MAR and earlier builds. The behavior is consistent: however I choose to activate v.digit, the map gets displayed complete with the color-coded vector topology, and then segfaults.

The segfaults don't seem to be dependent on the database I use (I've tried mysql and dbf as the drivers). Each time v.digit craps out, the topology is lost and so I have to v.clean the last build--though I've taken to creating "sandbox" coverages to work on, since g.copy takes a lot less time than v.clean.

My solution was to build from source (11 MAR cvs) and copy the v.digit binary into the 11 MAR grass61cvs.app. If you want a copy of the configure script, I'll post it on a web page. Surprisingly, swapping the from-source v.digit worked. Interestingly, the v.digit binary runs in the the WISH environment, even though I've got GRASS running in the X11/tcltk environment. But hey--it works, and unlike the v.digit that runs in the X11 environment, it doesn't create a processor race condition while I'm digitizing. That's nice!

Is it relevant that the debug code reports using Vect_open_old? I'm not using old-grass-vector formats.

I will enthusiastically help test potential solutions. I ain't afraid :slight_smile:

This output of the debug code is typical:

GRASS 6.1.cvs (indonesia):~ > v.digit map=east_timor_sandbox
D1/1: Region: N = -7.636000 S = -11.052000 E = 127.666000 W = 123.254000
D1/1: Driver opened
D1/1: Vect_open_old(): name = east_timor_sandbox mapset= jhamner update = 1
D1/1: Vect_set_thresh(): thresh = 0.000000
D1/1: dig_spidx_init()
D1/1: open format file: 'jhamner/vector/east_timor_sandbox/frmt'
D1/1: Vector format: 0 (native)
D1/1: Vect__read_head(): vector = east_timor_sandbox@jhamner
D1/1: Vect_set_thresh(): thresh = 0.000000
D1/1: Level request = 2
D1/1: Vect_open_topo(): name = east_timor_sandbox mapset= jhamner
D1/1: get coor info: /Users/jhamner/grass/indonesia/jhamner/vector/east_timor_sandbox/coor
D1/1: Info->size = 14211, Info->mtime = 1142525369
D1/1: Topo head: coor size = 14211, coor mtime = 0
D1/1: dig_load_plus()
D1/1: dig_spidx_init()
D1/1: V1_open_old_nat(): name = east_timor_sandbox mapset = jhamner
D1/1: get coor info: /Users/jhamner/grass/indonesia/jhamner/vector/east_timor_sandbox/coor
D1/1: Info->size = 14211, Info->mtime = 1142525369
D1/1: coor size in head = 14211, real coor file size= 14211
D1/1: Vect_open_old(): vector opened on level 2
D1/1: Vect_read_dblinks(): map = east_timor_sandbox, mapset = jhamner
D1/1: dbln file: /Users/jhamner/grass/indonesia/jhamner/vector/east_timor_sandbox/dbln
D1/1: dbln: 1 east_timor_sandbox cat grass mysql
D1/1: field = 1 name = (null), table = east_timor_sandbox, key = cat, database = grass, driver = mysql
D1/1: Dblinks read
D1/1: Vect_Rewind(): name = east_timor_sandbox
D1/1: dig_spidx_init()
D1/1: Map opened
Segmentation fault

The output from ~/Library/Logs/CrashReporter/v.digit.crash.log looks like this--and while this is the first entry (i.e. not the 11 MAR build for OS X), it is similar to the rest of the entries:

**********

Host Name: <deleted>
Date/Time: 2006-03-11 14:21:28.294 -0500
OS Version: 10.4.5 (Build 8H14)
Report Version: 4

Command: v.digit
Path: /Applications/Grass/grass61cvs.app/Contents/Resources/grass-6.1.cvs/bin/v.digit
Parent: wish [2582]

Version: Grass (6.1.cvs)

PID: 2627
Thread: 0

Exception: EXC_BAD_ACCESS (0x0001)
Codes: KERN_INVALID_ADDRESS (0x0001) at 0x2f417070

Thread 0 Crashed:
0 libSystem.B.dylib 0x90002fc8 strlen + 8
1 libtcl8.4.dylib 0x0a02e2d4 Tcl_ExternalToUtfDString + 116 (icplusplus.c:27)
2 libtk8.4.dylib 0x0b01ecf4 Tk_MainEx + 632 (icplusplus.c:27)
3 v.digit 0x00009684 main + 984 (crt.c:300)
4 v.digit 0x00002760 _start + 392 (crt.c:267)
5 dyld 0x8fe01048 _dyld_start + 60

Thread 1:
0 libSystem.B.dylib 0x9001f1ec select + 12
1 libtcl8.4.dylib 0x0a07bed4 NotifierThreadProc + 412 (icplusplus.c:27)
2 libSystem.B.dylib 0x9002b1e0 _pthread_body + 96

Thread 0 crashed with PPC Thread State 64:
  srr0: 0x0000000090002fc8 srr1: 0x100000000200d030 vrsave: 0x0000000000000000
    cr: 0x42000448 xer: 0x0000000020000000 lr: 0x000000000a02e2d4 ctr: 0x0000000090002fc0
    r0: 0x00000000000000c8 r1: 0x00000000bfffee90 r2: 0x000000000a08e268 r3: 0x000000002f417070
    r4: 0x000000002f417070 r5: 0xffffffffffffffff r6: 0x00000000bffff030 r7: 0xffffffffffffffff
    r8: 0x00000000bffff03c r9: 0x000000002f417070 r10: 0x00000000bfffeeec r11: 0x000000000a092d48
   r12: 0x0000000090002fc0 r13: 0x0000000000000000 r14: 0x0000000000000000 r15: 0x0000000000000000
   r16: 0x0000000000000000 r17: 0x0000000000000000 r18: 0x0000000000000000 r19: 0x0000000000000000
   r20: 0x000000000000900c r21: 0x000000000b0bea84 r22: 0x000000000b0bea84 r23: 0x00000000005fb588
   r24: 0x00000000005f9408 r25: 0x00000000000000c7 r26: 0x000000002f417070 r27: 0x00000000000e0488
   r28: 0xffffffffffffffff r29: 0x00000000bffff030 r30: 0x00000000bffff03c r31: 0x000000000a02e268

Binary Images Description:
    0x1000 - 0xffff v.digit /Applications/Grass/grass61cvs.app/Contents/Resources/grass-6.1.cvs/bin/v.digit
   0x15000 - 0x16fff libgrass_D.dylib /Applications/Grass/grass61cvs.app/Contents/Resources/grass-6.1.cvs/lib/libgrass_D.dylib
   0x1a000 - 0x20fff libgrass_display.dylib /Applications/Grass/grass61cvs.app/Contents/Resources/grass-6.1.cvs/lib/libgrass_display.dylib
   0x26000 - 0x2afff libgrass_raster.dylib /Applications/Grass/grass61cvs.app/Contents/Resources/grass-6.1.cvs/lib/libgrass_raster.dylib
   0x2e000 - 0x53fff libgrass_vect.dylib /Applications/Grass/grass61cvs.app/Contents/Resources/grass-6.1.cvs/lib/libgrass_vect.dylib
   0x5f000 - 0x6cfff libgrass_dig2.dylib /Applications/Grass/grass61cvs.app/Contents/Resources/grass-6.1.cvs/lib/libgrass_dig2.dylib
   0x72000 - 0x82fff libgrass_dgl.dylib /Applications/Grass/grass61cvs.app/Contents/Resources/grass-6.1.cvs/lib/libgrass_dgl.dylib
   0x88000 - 0x8bfff libgrass_rtree.dylib /Applications/Grass/grass61cvs.app/Contents/Resources/grass-6.1.cvs/lib/libgrass_rtree.dylib
   0x8f000 - 0x8ffff libgrass_linkm.dylib /Applications/Grass/grass61cvs.app/Contents/Resources/grass-6.1.cvs/lib/libgrass_linkm.dylib
   0x92000 - 0x97fff libgrass_dbmiclient.dylib /Applications/Grass/grass61cvs.app/Contents/Resources/grass-6.1.cvs/lib/libgrass_dbmiclient.dylib
   0x9d000 - 0xa6fff libgrass_dbmibase.dylib /Applications/Grass/grass61cvs.app/Contents/Resources/grass-6.1.cvs/lib/libgrass_dbmibase.dylib
   0xae000 - 0xaffff libgrass_form.dylib /Applications/Grass/grass61cvs.app/Contents/Resources/grass-6.1.cvs/lib/libgrass_form.dylib
   0xb2000 - 0xb7fff libgrass_datetime.dylib /Applications/Grass/grass61cvs.app/Contents/Resources/grass-6.1.cvs/lib/libgrass_datetime.dylib
   0xbb000 - 0xc3fff libintl.3.dylib /usr/local/grasslib/lib/libintl.3.dylib
  0x205000 - 0x244fff libgrass_gis.dylib /Applications/Grass/grass61cvs.app/Contents/Resources/grass-6.1.cvs/lib/libgrass_gis.dylib
  0x2b1000 - 0x2dcfff libproj.0.dylib /usr/local/grasslib/lib/libproj.0.dylib
  0x2ec000 - 0x3d0fff libgeos.2.dylib /usr/local/grasslib/lib/libgeos.2.dylib
  0x45e000 - 0x49afff libjasper-1.701.1.dylib /usr/local/grasslib/lib/libjasper-1.701.1.dylib
  0x4ac000 - 0x4c3fff libogdi31.dylib /usr/local/grasslib/lib/libogdi31.dylib
  0x4cb000 - 0x4e0fff libpq.3.dylib /usr/local/grasslib/lib/libpq.3.dylib
  0x4e9000 - 0x538fff libsqlite3.0.dylib /usr/local/grasslib/lib/libsqlite3.0.dylib
  0x546000 - 0x569fff libexpat.1.dylib /usr/local/grasslib/lib/libexpat.1.dylib
0x1008000 - 0x1622fff libgdal.1.dylib /usr/local/grasslib/lib/libgdal.1.dylib
0x1b1e000 - 0x1d91fff libxerces-c.27.dylib /usr/local/grasslib/lib/libxerces-c.27.dylib
0xa000000 - 0xa089fff libtcl8.4.dylib /usr/local/grasslib/lib/libtcl8.4.dylib
0xb000000 - 0xb0adfff libtk8.4.dylib /usr/local/grasslib/lib/libtk8.4.dylib
0x8fe00000 - 0x8fe54fff dyld 44.2 /usr/lib/dyld
0x90000000 - 0x901b3fff libSystem.B.dylib /usr/lib/libSystem.B.dylib
0x9020b000 - 0x9020ffff libmathCommon.A.dylib /usr/lib/system/libmathCommon.A.dylib
0x90211000 - 0x90264fff com.apple.CoreText 1.0.1 (???) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreText.framework/Versions/A/CoreText
0x90291000 - 0x90342fff ATS /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS
0x90371000 - 0x906aefff com.apple.CoreGraphics 1.256.33 (???) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics
0x9073a000 - 0x90813fff com.apple.CoreFoundation 6.4.4 (368.25) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
0x9085c000 - 0x9085cfff com.apple.CoreServices 10.4 (???) /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
0x9085e000 - 0x90960fff libicucore.A.dylib /usr/lib/libicucore.A.dylib
0x909ba000 - 0x90a3efff libobjc.A.dylib /usr/lib/libobjc.A.dylib
0x90a68000 - 0x90ad6fff com.apple.framework.IOKit 1.4 (???) /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
0x90aed000 - 0x90afffff libauto.dylib /usr/lib/libauto.dylib
0x90b06000 - 0x90ddefff com.apple.CoreServices.CarbonCore 681.3 (671.2) /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore
0x90e44000 - 0x90ec4fff com.apple.CoreServices.OSServices 4.1 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices
0x90f0e000 - 0x90f4ffff com.apple.CFNetwork 10.4.4 (129.9) /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CFNetwork.framework/Versions/A/CFNetwork
0x90f64000 - 0x90f7cfff com.apple.WebServices 1.1.2 (1.1.0) /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/WebServicesCore.framework/Versions/A/WebServicesCore
0x90f8c000 - 0x9100dfff com.apple.SearchKit 1.0.5 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit
0x91053000 - 0x9107dfff com.apple.Metadata 10.4.4 (121.34) /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata
0x9108e000 - 0x9109cfff libz.1.dylib /usr/lib/libz.1.dylib
0x9109f000 - 0x91262fff com.apple.security 4.3 (25966) /System/Library/Frameworks/Security.framework/Versions/A/Security
0x91365000 - 0x9136efff com.apple.DiskArbitration 2.1 /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration
0x91375000 - 0x9139cfff com.apple.SystemConfiguration 1.8.2 /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration
0x913af000 - 0x913b7fff libgcc_s.1.dylib /usr/lib/libgcc_s.1.dylib
0x913bc000 - 0x913dcfff libmx.A.dylib /usr/lib/libmx.A.dylib
0x913e2000 - 0x913eafff libbsm.dylib /usr/lib/libbsm.dylib
0x913ee000 - 0x9146efff com.apple.audio.CoreAudio 3.0.2 /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio
0x914ad000 - 0x914adfff com.apple.ApplicationServices 10.4 (???) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices
0x914af000 - 0x914e7fff com.apple.AE 1.5 (297) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE
0x91502000 - 0x915cffff com.apple.ColorSync 4.4.4 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSync.framework/Versions/A/ColorSync
0x91624000 - 0x916b7fff com.apple.print.framework.PrintCore 4.3 (172.3) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore
0x916fe000 - 0x917bbfff com.apple.QD 3.8.18 (???) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD
0x917f9000 - 0x91857fff com.apple.HIServices 1.5.1 (???) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices
0x91885000 - 0x918a9fff com.apple.LangAnalysis 1.6.1 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LangAnalysis.framework/Versions/A/LangAnalysis
0x918bd000 - 0x918e2fff com.apple.FindByContent 1.5 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/FindByContent.framework/Versions/A/FindByContent
0x918f5000 - 0x91937fff com.apple.LaunchServices 168.8 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices
0x91953000 - 0x91967fff com.apple.speech.synthesis.framework 3.3 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis
0x91975000 - 0x919affff com.apple.ImageIO.framework 1.4.4 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO
0x919c4000 - 0x91a8cfff libcrypto.0.9.7.dylib /usr/lib/libcrypto.0.9.7.dylib
0x91ada000 - 0x91aeffff libcups.2.dylib /usr/lib/libcups.2.dylib
0x91af4000 - 0x91b11fff libJPEG.dylib /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib
0x91b16000 - 0x91b85fff libJP2.dylib /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libJP2.dylib
0x91b9c000 - 0x91ba0fff libGIF.dylib /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libGIF.dylib
0x91ba2000 - 0x91bd3fff libRaw.dylib /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libRaw.dylib
0x91bd7000 - 0x91c1afff libTIFF.dylib /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib
0x91c21000 - 0x91c3afff libPng.dylib /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib
0x91c3f000 - 0x91c42fff libRadiance.dylib /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libRadiance.dylib
0x91c44000 - 0x91c44fff com.apple.Accelerate 1.1.1 (Accelerate 1.1.1) /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate
0x91c46000 - 0x91d30fff com.apple.vImage 2.0 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage
0x91d38000 - 0x91d57fff com.apple.Accelerate.vecLib 3.1.1 (vecLib 3.1.1) /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib
0x91dc3000 - 0x91e28fff libvMisc.dylib /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib
0x91e32000 - 0x91ec4fff libvDSP.dylib /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib
0x91ede000 - 0x9246efff libBLAS.dylib /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
0x924b6000 - 0x927c6fff libLAPACK.dylib /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib
0x927f3000 - 0x9287ffff com.apple.DesktopServices 1.3.1 /System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/DesktopServicesPriv
0x928c1000 - 0x92aecfff com.apple.Foundation 6.4.4 (567.25) /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
0x92c0a000 - 0x92ce8fff libxml2.2.dylib /usr/lib/libxml2.2.dylib
0x92d08000 - 0x92df6fff libiconv.2.dylib /usr/lib/libiconv.2.dylib
0x92ea9000 - 0x92ea9fff com.apple.Carbon 10.4 (???) /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon
0x92eab000 - 0x92ebffff com.apple.ImageCapture 3.0 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/ImageCapture.framework/Versions/A/ImageCapture
0x92ed7000 - 0x92ee7fff com.apple.speech.recognition.framework 3.4 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.framework/Versions/A/SpeechRecognition
0x92ef3000 - 0x92f08fff com.apple.securityhi 2.0 (203) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SecurityHI.framework/Versions/A/SecurityHI
0x92f1a000 - 0x92fa1fff com.apple.ink.framework 101.2 (69) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Ink.framework/Versions/A/Ink
0x92fb5000 - 0x92fc0fff com.apple.help 1.0.3 (32) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Help.framework/Versions/A/Help
0x92fca000 - 0x92ff7fff com.apple.openscripting 1.2.4 (???) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/OpenScripting.framework/Versions/A/OpenScripting
0x93011000 - 0x93021fff com.apple.print.framework.Print 5.0 (190.1) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Print.framework/Versions/A/Print
0x9302d000 - 0x93093fff com.apple.htmlrendering 1.1.2 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HTMLRendering.framework/Versions/A/HTMLRendering
0x930c4000 - 0x93116fff com.apple.NavigationServices 3.4.2 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/NavigationServices.framework/Versions/A/NavigationServices
0x93142000 - 0x9315ffff com.apple.audio.SoundManager 3.9 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CarbonSound.framework/Versions/A/CarbonSound
0x93171000 - 0x9317efff com.apple.CommonPanels 1.2.2 (73) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CommonPanels.framework/Versions/A/CommonPanels
0x93187000 - 0x93499fff com.apple.HIToolbox 1.4.5 (???) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox
0x94ab1000 - 0x94ae0fff libssl.0.9.7.dylib /usr/lib/libssl.0.9.7.dylib
0x94af0000 - 0x94b0dfff libresolv.9.dylib /usr/lib/libresolv.9.dylib
0x95012000 - 0x95139fff edu.mit.Kerberos 5.5.20 /System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos
0x97fdd000 - 0x9801cfff libiodbc.2.1.6.dylib /usr/lib/libiodbc.2.1.6.dylib
0x9802c000 - 0x98034fff libiodbcinst.2.dylib /usr/lib/libiodbcinst.2.dylib
0x9ad64000 - 0x9ae2cfff libX11.6.dylib /usr/X11R6/lib/libX11.6.dylib

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