-
Notifications
You must be signed in to change notification settings - Fork 123
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
relatively rare timer crash. can't get why yet #688
Comments
So I guess timer is null. Which would mean that i>=sRunningTimers.length. Can't really see how. It is also possible that SetSize is not GC-moving safe - have not fully studied it. I should add a test for it. It is also not great to use for resizing here because it does not allow wiggle room in the size and may cause excessive reallocing. Since splice will optimize away the return result if you do not use it, I would recommend just removing the 'setSize' path and always use splice. For simplicity, you could also not bother moving the last element and just |
Yes, it's very likely the cause of my problem, thanks. We sometimes use
Thanks for advice, exaclly this aproach was introduced here:
It will be great. Btw, we have rarely crashes in
We have this gc flags set for now:
|
There are tests for StringMap with Gc: https://github.com/HaxeFoundation/hxcpp/blob/master/test/haxe/TestStringHash.hx |
Crashed thread stack:
Some other threads are doing something gc related, too (doesn't them should wait some semaphore or smth atm?)
Like this one:
@hughsando, I've save minidump and can send to you if it can help. |
So the thread usage looks fine. This looks like your socket thread has called "new" which has triggered a collection. The collection pauses the haxe threads (who will enter a "wait" state) while the collection happens, There are 2 (or more) threads calling "MarkMember". This is ok, since these threads are the GC threads started in SThreadLoop and system is designed to work "lock free" as much as possible while marking and will go dormant once the haxe threads are restarted.
You can also try running with the haxedefs You can also try uncommenting So, if you are hunting this bug, I would first try |
Awesome advice, thank U very much! Seems I found the promlematic code:
Which I count from main haxe thread like this: Now I've done like this |
You can use a string as soon as it is created because they are immutable - but you still need to take care with maps. If you think of them like arrays where when they change size (add or remove item), internally they may create a copy of themselves and switch their state over to the copy. If the "set" happens after the copy is made, but before the state gets set, things will break. function startThread() {
Thread.create( () -> {
var http = new Http(uri);
...
var result = http.data.
Application.runOnMainThread( () -> {
// Absolutely fine to do this here...
loaderLoder.remove(uri);
// and this too...
loder.onLoad(result);
});
});
} |
Please excuse me - it definetly relates to my pull request. #679
Crash is quite rare - ocured only once in 3 days for now ( it's small rollout on ~1000 active users).
Can anyone help me to figure out how it can be possible (crash and generated code below)
The text was updated successfully, but these errors were encountered: