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

gg: Copy gg.Event results in runtime memory access error #24157

Open
mike-ward opened this issue Apr 7, 2025 · 1 comment
Open

gg: Copy gg.Event results in runtime memory access error #24157

mike-ward opened this issue Apr 7, 2025 · 1 comment
Labels
Bug This tag is applied to issues which reports bugs.

Comments

@mike-ward
Copy link
Contributor

mike-ward commented Apr 7, 2025

Describe the bug

Copy gg.Event struct results in runtime memory access error.

Reproduction Steps

import gg

fn main() {
	e := gg.Event{}
	ev := gg.Event{
		...e
	}
	println(ev)
}

v run .

Expected Behavior

Should print ev

Current Behavior

v2.01JR83TN7DRH9DKT8B2464W4BX.tmp.c:114707: at v__gen__c__Gen_struct_init: RUNTIME ERROR: invalid memory access
v2.01JR83TN7DRH9DKT8B2464W4BX.tmp.c:94321: by v__gen__c__Gen_expr
v2.01JR83TN7DRH9DKT8B2464W4BX.tmp.c:87051: by v__gen__c__Gen_assign_stmt
v2.01JR83TN7DRH9DKT8B2464W4BX.tmp.c:92710: by v__gen__c__Gen_stmt
v2.01JR83TN7DRH9DKT8B2464W4BX.tmp.c:92508: by v__gen__c__Gen_stmts_with_tmp_var
v2.01JR83TN7DRH9DKT8B2464W4BX.tmp.c:92347: by v__gen__c__Gen_stmts
v2.01JR83TN7DRH9DKT8B2464W4BX.tmp.c:103105: by v__gen__c__Gen_gen_fn_decl
v2.01JR83TN7DRH9DKT8B2464W4BX.tmp.c:102636: by v__gen__c__Gen_fn_decl
v2.01JR83TN7DRH9DKT8B2464W4BX.tmp.c:92696: by v__gen__c__Gen_stmt
v2.01JR83TN7DRH9DKT8B2464W4BX.tmp.c:92508: by v__gen__c__Gen_stmts_with_tmp_var
v2.01JR83TN7DRH9DKT8B2464W4BX.tmp.c:92347: by v__gen__c__Gen_stmts
v2.01JR83TN7DRH9DKT8B2464W4BX.tmp.c:91195: by v__gen__c__Gen_gen_file
v2.01JR83TN7DRH9DKT8B2464W4BX.tmp.c:91132: by v__gen__c__cgen_process_one_file_cb
v2.01JR83TN7DRH9DKT8B2464W4BX.tmp.c:33284: by sync__pool__process_in_thread
v2.01JR83TN7DRH9DKT8B2464W4BX.tmp.c:15949: by sync__pool__process_in_thread_thread_wrapper
0x197f682e4 : by ???
0x197f630fc : by ???
^C

Possible Solution

Copying touches resolves the issue.

import gg

fn main() {
	e := gg.Event{}
	ev := gg.Event{
		...e
		touches: e.touches
	}
	println(ev)
}

Additional Information/Context

No response

V version

V 0.4.10 3cbc141

Environment details (OS name and version, etc.)

V full version V 0.4.10 da3112e.3cbc141
OS macos, macOS, 15.3.2, 24D81
Processor 8 cpus, 64bit, little endian, Apple M2
Memory 0.17GB/8GB
V executable /Users/mike/Documents/github/v/v
V last modified time 2025-04-07 12:32:58
V home dir OK, value: /Users/mike/Documents/github/v
VMODULES OK, value: /Users/mike/.vmodules
VTMP OK, value: /tmp/v_501
Current working dir OK, value: /Users/mike/Documents/github/bug
env VFLAGS "-path /Users/mike/Documents/github/gui/src
Git version git version 2.49.0
V git status weekly.2025.13-68-g3cbc141c (2 commit(s) behind V master)
.git/config present true
cc version Apple clang version 17.0.0 (clang-1700.0.13.3)
gcc version Apple clang version 17.0.0 (clang-1700.0.13.3)
clang version Apple clang version 17.0.0 (clang-1700.0.13.3)
tcc version tcc version 0.9.28rc 2024-02-05 HEAD@105d70f7 (AArch64 Darwin)
tcc git status thirdparty-macos-arm64 c8df4e27
emcc version N/A
glibc version N/A

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.

@mike-ward mike-ward added the Bug This tag is applied to issues which reports bugs. label Apr 7, 2025
Copy link

Connected to Huly®: V_0.6-22547

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.
Projects
None yet
Development

No branches or pull requests

1 participant