Opened 4 years ago

Closed 4 years ago

#118 closed defect (invalid)

possible problem with ; comments after *date if text is numeric like a date

Reported by: Philip Sargent Owned by: Olly Betts
Priority: minor Milestone:
Component: cavern Version: 1.2.42
Keywords: Cc:

Description (last modified by Olly Betts)

*date 1993.07.17 ; trip 1993-161-15 in logbook

in Loser\caves-1623\161\lhr\arrow.svx

Survex 1.2.42

/mnt/d/CUCC-Expo/t37/loser/kataster/../caves-1623/161/lhr/arrow.svx:75:18: error: Expecting numeric field, found “in”
trip 1993-161-15 in logbook
                  ^~
/mnt/d/CUCC-Expo/t37/loser/kataster/../caves-1623/161/lhr/arrow.svx:75:21: error: Expecting numeric field, found “logbook”
 trip 1993-161-15 in logbook
                     ^~~~~~~

Attachments (1)

arrow.svx (3.9 KB) - added by Philip Sargent 4 years ago.
this is the file, but after I edited it with a LF before the ; in the *date line

Download all attachments as: .zip

Change History (9)

comment:1 Changed 4 years ago by Philip Sargent

Sorry I overwrote the .log file after I fixed it so can't attach it.

comment:2 Changed 4 years ago by Olly Betts

Description: modified (diff)

Can you provide a reproducer (i.e. a self-contained .svx file I can process and get this error)?

I tried to make one, but it processes as expected for me:

olly@gemse:~/git/survex$ cat date-comment-parse-bug.svx 
*begin foo
*date 1993.07.17 ; trip 1993-161-15 in logbook
1 2 10.00 000 00
*end foo
olly@gemse:~/git/survex$ cavern date-comment-parse-bug.svx
Survex 1.2.42
Copyright © 1990-2018 Olly Betts
Survey has no fixed points. Therefore I’ve fixed foo.1 at (0,0,0)

Removing trailing traverses...

Concatenating traverses...

Simplifying network...

Calculating network...

Calculating traverses...

Calculating trailing traverses...

Calculating statistics...

Survey contains 2 survey stations, joined by 1 leg.
There are 0 loops.
Total length of survey legs =   10.00m (  10.00m adjusted)
Total plan length of survey legs =   10.00m
Total vertical length of survey legs =    0.00m
Vertical range = 0.00m (from foo.2 at 0.00m to foo.2 at 0.00m)
North-South range = 10.00m (from foo.2 at 10.00m to foo.1 at 0.00m)
East-West range = 0.00m (from foo.2 at 0.00m to foo.2 at 0.00m)
   2 1-nodes.
CPU time used  0.00s

The line shown after each error in your output with the location highlighted suggests cavern think that trip 1993-161-15 in logbook is a line by itself in your case, so perhaps you have some odd invisible character in that line of your survex file? cat -vet arrow.svx would help see that.

Last edited 4 years ago by Olly Betts (previous) (diff)

comment:3 Changed 4 years ago by Olly Betts

Component: Othercavern
Version: 1.2.42

comment:4 Changed 4 years ago by Philip Sargent

;1998.03.02 AERW sorted begin/end, added comments, refs. and clino calib. ;2020.07.09 PMS fixed bad format for *instrument *team *calibration

; ====== links between surveys in this file: ======

*equate Pntless.13 ptchrp.2.6

*begin PtchRp? ; ====== stations refindable to link to other surveys: ======

*export 2.6 ; boulder opposite rock bridge between two holes in Arrow cha. *export 2.7 ; roof at entrance to Arrow Chamber

*equate 2.1 1.16

*begin 1

; Cave: Kaninchenhöhle, 1623/161 ; Locn: Totes Gebirge, Austria *title "Pitch Ramp Series" *date 1993.07.14 ; trip 1993-161-11 in logbook

*team Notes Lummat *team instrument Dave Galvin *team Tape Nick Proctor

*instrument compass Illuminated Compass 112518 *instrument clino 834867 ; Calibration: (Lummat) : 93 cairn: ; calibrate clino +09.5,+10, (back) -10, -11 ; calibrate compass 042, 041/5 (back) 219, 219 ; Zinken (from higher cairn): +3/5, +3, 251/5, 252

*ref "1993 survey book pp 148-151"

; ====== stations refindable to link to other surveys: ======

*export 16 ; junction to Arrow Chamber

*calibrate clino -0.375

;surveyed out

1 2 3.9 203 -05 3 2 2.5 299 +31 3 4 3.3 118 -13 3 5 12.9 - UP 6 5 2.0 135 -06 7 5 3.4 338 +26 7 8 2.4 011 -38 9 8 2.65 320 +21 5 10 4.85 160 +64 11 10 3.1 310 -11 11 12 3.7 127 -21 13 12 6.7 325 +27 11 14 10.2 163 +78 15 14 6.0 137 +08 15 16 9.5 314 -08 17 16 11.3 285 -13 17 18 4.3 058 +03 19 18 2.0 291 +07 19 20 3.0 307 -50 20 21 3.7 327 -20 22 20 3.5 322 +47 22 23 2.7 142 +32 24 23 2.1 328 -10 25 23 4.0 255 +27 *end 1

*begin 2 *export 1 ; LH wall just beyond T-jn (R to dead end, L to stn 1) *export 6 ; boulder opposite rock bridge between two holes in Arrow cha. *export 7 ; roof at entrance to Arrow Chamber

; Cave: Kaninchenhöhle, 1623/161 ; Locn: Totes Gebirge, Austria *title "Pitchramp to entrance of Arrow Chamber" *date 1993.07.17 ; trip 1993-161-15 in logbook *team Insts Dave Galvin *team Notes Hugh Adams *team Tape Hugh Adams *instrument Compass #721899, Clino #834867 ;Calibration: none (same insts as next survey, so assume calib clino = 0) ;surveyed out *ref "1993 survey book pp 162-163"

; ====== stations refindable to link to other surveys: ======

1 2 4.15 321 -16 2 3 6.25 009 00 3 4 4.10 - UP 5 4 3.58 179 -01 5 6 6.65 042 -19 7 6 10.37 146 -31

*end 2 *end PtchRp?

*begin Pntless

; Cave: Kaninchenhöhle, 1623/161 ; Locn: Totes Gebirge, Austria *title "Pointless and Not Quite" *date 1993.07.18 ; "trip 1993-161-16 in logbook" *team Insts Nick Proctor *team Notes Hugh Adams (Nick) *team Tape Nick and Hugh Adams *instrument Compass #721899, Clino #834867 ; Calibration: (Nick) : 93 cairn: ; calibrate clino +10, (back) -10 ; calibrate compass 040, (back) 220 ; Zinken(from lower cairn): +9, 231 ; Zinken(from higher cairn): +9, 231 ; the figures to Zinken are way off the norm. not clear why. *ref "1993 survey book pp 164-165"

; ====== stations refindable to link to other surveys: ======

*export 13 ; boulder opposite rock bridge between two holes in Arrow cha. ; surveyed out

1 2 5.15 151 -7 1 3 8.89 - UP 3 4 1.57 105 +18 4 5 2.57 029 +7 6 5 2.53 256 -40 6 7 5.52 345 -18 7 8 7.04 - UP 8 9 2.70 287 +36 9 10 29.7 - UP 10 11 4.01 293 +40 11 12 14.75 323 +87 12 13 3.58 025 +11

*end Pntless

Version 0, edited 4 years ago by Philip Sargent (next)

comment:5 Changed 4 years ago by Philip Sargent

bugger that didn't work. Sorry I overwrote the file, I'll have to recover it from tortoise-hg but I'm running something on that directory at the moment

Changed 4 years ago by Philip Sargent

Attachment: arrow.svx added

this is the file, but after I edited it with a LF before the ; in the *date line

comment:6 Changed 4 years ago by Olly Betts

Removing that LF it works for me:

$ cavern arrow.svx
Survex 1.2.42
Copyright © 1990-2018 Olly Betts
Survey has no fixed points. Therefore I’ve fixed ptchrp.2.6 at (0,0,0)

Removing trailing traverses...

Concatenating traverses...

Simplifying network...

Calculating network...

Calculating traverses...

Calculating trailing traverses...

Calculating statistics...

Survey contains 45 survey stations, joined by 44 legs.
There are 0 loops.
Total length of survey legs =  236.81m ( 236.81m adjusted)
Total plan length of survey legs =  138.50m
Total vertical length of survey legs =  136.33m
Vertical range = 71.89m (from ptchrp.2.7 at 5.34m to pntless.2 at -66.55m)
North-South range = 40.77m (from ptchrp.2.7 at 7.37m to ptchrp.1.13 at -33.40m)
East-West range = 23.40m (from ptchrp.1.25 at 18.27m to ptchrp.2.2 at -5.12m)
  10 1-nodes.
  28 2-nodes.
   6 3-nodes.
   1 4-node.
CPU time used  0.00s

comment:7 Changed 4 years ago by Olly Betts

This could be a cavern bug, but I'm not seeing any real evidence of that.

I'm suspecting that you had managed to somehow get a Ctrl+Z (byte value 26) character on that line after the ;, and that got removed by your editor when you added the line break before the ;. If I add that deliberately the errors I get match what you show above:

arrow.svx:79:18: error: Expecting numeric field, found “in”
 trip 1993-161-15 in logbook
                  ^~
arrow.svx:79:21: error: Expecting numeric field, found “logbook”
 trip 1993-161-15 in logbook
                     ^~~~~~~

If this was still trying to parse a *date command the error message would be different as there's no numeric field expected in a *date command, and the line showing the error highlighted would include the *date part too - e.g. if I change the ; to a - I get:

arrow.svx:78:20: error: Expecting date, found “trip”
 *date 1993.07.17 - trip 1993-161-15 in logbook
                    ^~~~

You don't get an error for trip or 1993-161-15 which suggests to me that cavern is parsing this as a line of survey data (from station trip, to station 1993-161-15, then in when it expects an instrument reading).

For compatibility with old DOS text files (which had a Ctrl+Z at the end), cavern treats Ctrl+Z as an EOL character by default. That's no longer useful for any modern OS, but changing it is potentially problematic as it would mean people could no longer process old datasets which contained such files. Perhaps we can make it warn by default so such datasets process but people don't get tripped up by this, though I'm not sure how you'd get a Ctrl+Z in a file with a modern OS.

comment:8 Changed 4 years ago by Olly Betts

Resolution: invalid
Status: newclosed

It appears the reporter no longer has the exact file which triggered this, but we have a plausible explanation for what was going on.

I'd be happy to add a warning if we had a good plan for how it would work, but I don't have one, so given this is the first report of such a problem in about 30 years I'm going to close this.

"Invalid" doesn't seem quite right, but is the closest match of the available resolution options.

Note: See TracTickets for help on using tickets.