segfault error
hello,
it looks that I have unintentionally found segmentation error. it occurs for report command:
report fileName lineNumber message
when string is used for lineNumber. below script causes segfault error on my machine:
#!/usr/bin/tclsh
# segmentation fault error
set fileName "fileName"
set lineNumber ""; #let's use an empty string instead of integer for line number
set msg "an example report message"
report $fileName $lineNumber $msg
this could be corrected in upcoming releases
Comments (5)
-
-
- changed status to resolved
fix segfault when casting invalid string to a numerical value - fix
#33→ <<cset 40fd75a2a958>>
-
reporter hi,
thanks for the fix, I have checked that ant it works well now. but I am curious what about negative line numbers?
#!/usr/bin/tclsh set fileName "fileName" set lineNumber -4; #negative integer for line number set msg "an example report message" report $fileName $lineNumber $msg
for instance documentation says (https://bitbucket.org/verateam/vera/wiki/ScriptAPI):
getLine fileName lineNumber
- returns the selected line; line numbers are counted from 1.is it allow to use negative integer numbers for lines numbering?
-
generate an error when reporting a line smaller or equal to 0 - see
#33→ <<cset 72015077b22e>>
-
reporter hi,
thanks again for quick fix
- Log in to comment
I've reproduced this bug here. It seems to be related to the tcl stack display on tcl error introduced in vera++ 1.2.0.
Stack trace is
cpptcl.h:35 is