v icon indicating copy to clipboard operation
v copied to clipboard

Windows: Invalid memory access

Open Eliyaan opened this issue 2 years ago • 4 comments

Describe the bug

When dumping (see below) it outputs an Invalid Memory Access, but only when gg is imported.

Reproduction Steps

import gg


fn main() {
	a := [1]
	dump(a[0] <= 1)
}

Expected Behavior

To see no Invalid Memory Access

Current Behavior

PS C:\Users\PACHECON\_cv\tests> v -g run C:\Users\PACHECON\_cv\tests\bug4.v
bug4.v:1:8: warning: module 'gg' is imported but never used
    1 | import gg
      |        ~~
    2 |
    3 |
Unhandled Exception 0xC0000005
C:/Users/PACHECON/AppData/Local/Temp/v_0/../../../../../..C:\Users\PACHECON\v\vlib\builtin\backtraces_windows.c.v:159: at print_backtrace_skipping_top_frames_tcc: Backtrace
C:/Users/PACHECON/AppData/Local/Temp/v_0/../../../../../..C:\Users\PACHECON\v\vlib\builtin\backtraces_windows.c.v:70: by print_backtrace_skipping_top_frames
C:/Users/PACHECON/AppData/Local/Temp/v_0/../../../../../..C:\Users\PACHECON\v\vlib\builtin\builtin_windows.c.v:108: by unhandled_exception_handler
7ffeefd88b5c : by ???
7ffeef0e43d7 : at ???: RUNTIME ERROR: invalid memory access
C:/Users/PACHECON/AppData/Local/Temp/v_0/../../../../../..C:\Users\PACHECON\AppData\Local\Temp\v_0\bug4.01HN38QQVWM5EAT0G8HJR1V289.tmp.c:17203: by wWinMain
006ebd77 : by ???
006ebed8 : by ???
7ffeedfc7614 : by ???

Possible Solution

No response

Additional Information/Context

No response

V version

V 0.4.4 536bf21.2a68e2b

Environment details (OS name and version, etc.)

V full version: V 0.4.4 536bf21.2a68e2b OS: windows, Microsoft Windows 10 Education v19045 64 bits Processor: 4 cpus, 64bit, little endian,

getwd: C:\Users\PACHECON_cv\tests vexe: C:\Users\PACHECON\v\v.exe vexe mtime: 2024-01-26 15:59:04

vroot: OK, value: C:\Users\PACHECON\v VMODULES: OK, value: C:\Users\PACHECON.vmodules VTMP: OK, value: C:\Users\PACHECON\AppData\Local\Temp\v_0

Git version: git version 2.42.0.windows.2 Git vroot status: weekly.2024.01-191-g2a68e2b7 .git/config present: true

CC version: Error: 'cc' n’est pas reconnu en tant que commande interne ou externe, un programme exécutable ou un fichier de commandes.

thirdparty/tcc status: thirdparty-windows-amd64 e90c2620

[!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.

Eliyaan avatar Jan 26 '24 16:01 Eliyaan

Works fine on Linux.

x.v:1:8: warning: module 'gg' is imported but never used
    1 | import gg
      |        ~~
    2 | 
    3 |
[x.v:6] a[0] <= 1: true

JalonSolov avatar Jan 26 '24 16:01 JalonSolov

Can confirm:

PS D:\Games\Proekti\V\interactions> v run test2.v
test2.v:1:8: warning: module 'gg' is imported but never used
    1 | import gg
      |        ~~
    2 | 
    3 |
Unhandled Exception 0xC0000005
C:/Users/mclr/AppData/Local/Temp/v_0/test2.01HN45BV17NSFPR060P6NS8QCA.tmp.c:10364: at print_backtrace_skipping_top_frames_tcc: Backtrace
C:/Users/mclr/AppData/Local/Temp/v_0/test2.01HN45BV17NSFPR060P6NS8QCA.tmp.c:10331: by print_backtrace_skipping_top_frames
C:/Users/mclr/AppData/Local/Temp/v_0/test2.01HN45BV17NSFPR060P6NS8QCA.tmp.c:11152: by unhandled_exception_handler
7ffecb7bc5fa : by ???
7ffec9db7d57 : at ???: RUNTIME ERROR: invalid memory access
C:/Users/mclr/AppData/Local/Temp/v_0/test2.01HN45BV17NSFPR060P6NS8QCA.tmp.c:27552: by wWinMain
006e7d4f : by ???
006e7eb0 : by ???
7ffecb0953e0 : by ???
PS D:\Games\Proekti\V\interactions> 

MCausc78 avatar Jan 27 '24 00:01 MCausc78

Works if you use -msvc or if dump is not a comparisons. ( However, no problem for string comparisons ) Interesting.

GGRei avatar Jan 27 '24 07:01 GGRei

I'm also getting this error. I'm using Windows and utilizing the net.http module, it works on WSL though.

C:/Users/softw/AppData/Local/Temp/v_0/new_request.01HZRBAC0CNRQDB9ZGWDRM1W3X.tmp.c:12048: at print_backtrace_skipping_top_frames_tcc: Backtrace
C:/Users/softw/AppData/Local/Temp/v_0/new_request.01HZRBAC0CNRQDB9ZGWDRM1W3X.tmp.c:12015: by print_backtrace_skipping_top_frames
C:/Users/softw/AppData/Local/Temp/v_0/new_request.01HZRBAC0CNRQDB9ZGWDRM1W3X.tmp.c:12893: by unhandled_exception_handler
7ffa87a67a7a : by ???
7ffa866796a6 : at ???: RUNTIME ERROR: invalid memory access
C:/Users/softw/Downloads/v/thirdparty/vschannel/vschannel.c:152: by request
C:/Users/softw/AppData/Local/Temp/v_0/new_request.01HZRBAC0CNRQDB9ZGWDRM1W3X.tmp.c:32205: by net__http__vschannel_ssl_do
C:/Users/softw/AppData/Local/Temp/v_0/new_request.01HZRBAC0CNRQDB9ZGWDRM1W3X.tmp.c:32106: by net__http__Request_ssl_do
C:/Users/softw/AppData/Local/Temp/v_0/new_request.01HZRBAC0CNRQDB9ZGWDRM1W3X.tmp.c:34440: by net__http__Request_method_and_url_to_response
C:/Users/softw/AppData/Local/Temp/v_0/new_request.01HZRBAC0CNRQDB9ZGWDRM1W3X.tmp.c:34367: by net__http__Request_do
C:/Users/softw/AppData/Local/Temp/v_0/new_request.01HZRBAC0CNRQDB9ZGWDRM1W3X.tmp.c:33803: by net__http__fetch
C:/Users/softw/AppData/Local/Temp/v_0/new_request.01HZRBAC0CNRQDB9ZGWDRM1W3X.tmp.c:33725: by net__http__post_multipart_form
C:/Users/softw/AppData/Local/Temp/v_0/new_request.01HZRBAC0CNRQDB9ZGWDRM1W3X.tmp.c:35918: by main__main
C:/Users/softw/AppData/Local/Temp/v_0/new_request.01HZRBAC0CNRQDB9ZGWDRM1W3X.tmp.c:36291: by wmain
00844d10 : by ???
00844e73 : by ???
7ffa85d4257d : by ???```

dkmnx avatar Jun 07 '24 03:06 dkmnx