Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: Invalid memory access #20665

Open
Eliyaan opened this issue Jan 26, 2024 · 4 comments
Open

Windows: Invalid memory access #20665

Eliyaan opened this issue Jan 26, 2024 · 4 comments
Labels
Bug This tag is applied to issues which reports bugs. OS: Windows Bugs/feature requests, that are specific to Windows OS. Status: Confirmed This bug has been confirmed to be valid by a contributor. Weird/Undocumented Behaviour This issue is related to a bug, that was surprising and wasted user's time.

Comments

@Eliyaan
Copy link
Contributor

Eliyaan commented Jan 26, 2024

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 Eliyaan added the Bug This tag is applied to issues which reports bugs. label Jan 26, 2024
@JalonSolov
Copy link
Contributor

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 JalonSolov changed the title Invalid memory access Windows: Invalid memory access Jan 26, 2024
@MCausc78
Copy link
Contributor

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> 

@JalonSolov JalonSolov added the Status: Confirmed This bug has been confirmed to be valid by a contributor. label Jan 27, 2024
@GGRei
Copy link
Contributor

GGRei commented Jan 27, 2024

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

@spytheman spytheman added OS: Windows Bugs/feature requests, that are specific to Windows OS. Weird/Undocumented Behaviour This issue is related to a bug, that was surprising and wasted user's time. labels Jan 27, 2024
@bamontales
Copy link

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 ???```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs. OS: Windows Bugs/feature requests, that are specific to Windows OS. Status: Confirmed This bug has been confirmed to be valid by a contributor. Weird/Undocumented Behaviour This issue is related to a bug, that was surprising and wasted user's time.
Projects
None yet
Development

No branches or pull requests

6 participants