You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We read a file line by line with os.get_raw_line and use .trim_right('\r\n') and after print interpolated we get an Unhandled Exception with rows complex and large. Tested on windows with both tcc and mingw.
Reproduction Steps
modulemainimportosfnmain() {
muti:=0for {
i +=1mutline:= os.get_raw_line()
if line.len==0 {
break
}
line2:= line.trim_right('\r\n')
// println('${i}: ${line2.len}') OK prints n: 1034 n=1,2,3println('${i}: ${line2}') // error
}
}
Note: the size of the line is calculated and printed ok but not he whole line content.
Expected Behavior
Print three lines with text
1: ...
2: ...
3: ...
Current Behavior
We pass the file using window command C:\type {file} | {v app}
C:\Users\jmireles\issues>type yyy.txt | v run issue.v
1: {"@timestamp":"2025-02-19T15:45:49.746Z","@version":"1","message":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","logger_name":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","thread_name":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","level":"INFO","level_value":20000,"uid":"","request_id":"xxxxxx","session_log_id":"xxxxxxxxxxx","ip":"xxx.xxx.xxx.xxx","referer":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx012345678901234567890123456","processing_time_ms":0,"method":"GET","content_type":"text/javascript","query":null,"type":"xxxxxxxxxxxxxxxx","request_uri":"/pub/js/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.js","status":200}
Unhandled Exception 0x148f8b0
C:/Users/jmireles/AppData/Local/Temp/v_0/win_23764.01JMWADPQ468AA0BXK71T7R3FY.tmp.c:4468: at print_backtrace_skipping_top_frames_tcc: Backtrace
C:/Users/jmireles/AppData/Local/Temp/v_0/win_23764.01JMWADPQ468AA0BXK71T7R3FY.tmp.c:4454: by print_backtrace_skipping_top_frames
C:/Users/jmireles/AppData/Local/Temp/v_0/win_23764.01JMWADPQ468AA0BXK71T7R3FY.tmp.c:4991: by unhandled_exception_handler
7ffa52d13556 : by ???
004265eb : at ???: RUNTIME ERROR: invalid memory access
004266c9 : by ???
004266f4 : by ???
C:/Users/jmireles/AppData/Local/Temp/v_0/win_23764.01JMWADPQ468AA0BXK71T7R3FY.tmp.c:4785: by malloc_noscan
C:/Users/jmireles/AppData/Local/Temp/v_0/win_23764.01JMWADPQ468AA0BXK71T7R3FY.tmp.c:4890: by memdup_noscan
C:/Users/jmireles/AppData/Local/Temp/v_0/win_23764.01JMWADPQ468AA0BXK71T7R3FY.tmp.c:2378: by strings__Builder_str
C:/Users/jmireles/AppData/Local/Temp/v_0/win_23764.01JMWADPQ468AA0BXK71T7R3FY.tmp.c:6405: by str_intp
C:/Users/jmireles/AppData/Local/Temp/v_0/win_23764.01JMWADPQ468AA0BXK71T7R3FY.tmp.c:6661: by main__main
C:/Users/jmireles/AppData/Local/Temp/v_0/win_23764.01JMWADPQ468AA0BXK71T7R3FY.tmp.c:6689: by wmain
00437908 : by ???
00437a6b : by ???
7ffa515fe8d7 : by ???
Fails with both tcc and mingw
yyy.txt data file (same of derived issue mentioned above):
Describe the bug
New bug derived from issue #23764
We read a file line by line with
os.get_raw_lineand use.trim_right('\r\n')and after print interpolated we get an Unhandled Exception with rows complex and large. Tested on windows with bothtccandmingw.Reproduction Steps
Note: the size of the line is calculated and printed ok but not he whole line content.
Expected Behavior
Print three lines with text
Current Behavior
We pass the file using window command
C:\type {file} | {v app}Fails with both
tccandmingwyyy.txtdata file (same of derived issue mentioned above):Simpler files does not fail, seems related with the complexity/size of the rows of this test file.
Possible Solution
No response
Additional Information/Context
No response
V version
30ececc
Environment details (OS name and version, etc.)
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.