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

sqf::create_unit invoker_lock crash #207

Open
0dr opened this issue Jul 19, 2018 · 3 comments
Open

sqf::create_unit invoker_lock crash #207

0dr opened this issue Jul 19, 2018 · 3 comments

Comments

@0dr
Copy link

0dr commented Jul 19, 2018

branch: master
self compiled dlls
inside custom plugin
tested on: profiling / performance

When creating multiple units in a tight loop, I've experience weird ass random crashes (access violation) in the invoker_lock.

this crashes the game :

	auto group = intercept::sqf::create_group(intercept::sqf::west());
	for (int i = 0; i < 10; i++) {
		intercept::sqf::create_unit(group, "B_Soldier_GL_F", intercept::sqf::get_pos(intercept::sqf::player()));
	}

while this does not :

	auto group = intercept::sqf::create_group(intercept::sqf::west());
	for (int i = 0; i < 10; i++) {
		intercept::sqf::create_unit(group, "B_Soldier_GL_F", intercept::sqf::get_pos(intercept::sqf::player()), {}, 20.f);
	}

(Both as custom sqf command called from ingame so no intercept::client::invoker_lock)

apparently if one tries to create multiple units too close to one another something fails hard.

Exception thrown at 0x0000000000000000 in arma3_x64.exe: 0xC0000005: Access violation executing location 0x0000000000000000.

(invoker.cpp)
(261)..
    game_value invoker::invoke_raw_nolock(binary_function function_, const game_value &left_arg_, const game_value &right_arg_) noexcept {
        volatile uintptr_t arr[64];//artifical stackpushing
        arr[13] = 5;
        return function_(invoker::sqf_game_state, left_arg_, right_arg_); //<---- crash on return
    }
(265)..
@0dr
Copy link
Author

0dr commented Jul 19, 2018

In my main project where I first encountered the crash, I am still failing, create_unit crashes at random in the return of the invoker::invoke_raw_unlock() and I have no clue what to check for.

What I noticed:
Sometimes when stepping through the unit creation, I get random ingame scripts that fail with generic error (the black script error popup)

@dedmen
Copy link
Member

dedmen commented Jul 19, 2018

What if you... Just tell the debugger to continue after the exception?
0x0 access violation sounds like the freeze watchdog.

@0dr
Copy link
Author

0dr commented Jul 19, 2018

hitting "continue" won't get me past that point

*waiting during debug or stepping slow feels like to increase the chance to get past unit creation... wtf.

edit: it dosn't help that I have threads running and a join, there seems to be another bug that is confusing me from time to time. (the crash on unit creation is confirmed because the threads are after but sometimes I get past the unit creation and get the same access violation later on)

edit2: I got another acces violation (not inside invoker), that one I managed to step through

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants