-
Couldn't load subscription status.
- Fork 10
Crash less #8
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
base: master
Are you sure you want to change the base?
Crash less #8
Conversation
I'm not sure if we can guarantee these addresses to be consistent with the actual file descriptors, this should ensure that the FD value and the hash key are indeed equivalent.
We now use the same pattern for timeouts and inputs, and seemingly prevent quite a lot of crashes around input_remove. Also some usual cosmetic touchups.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine :)
| s_evLoopInputEvent *inputEvent = handle; | ||
| s_evLoopInput *input = inputEvent->parent; | ||
| // Why is this here? XXX | ||
| if (g_list_find(input->events, inputEvent) == NULL) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is used to check if the input actually exists in our hash, but granted it's probably pointless here.
purple needs a guint ID, which is 32bit. 64bit pointers would get trimmed, and would later blow up when converted back to the pointers, as we'd get a different value than we actually allocated and initialized. This switches it to a lookup table with meaningless integers for the IDs.
| input_event->parent = input_handle; | ||
| input_handle->events = g_list_append(input_handle->events, input_event); | ||
|
|
||
| input_event->id = evLoopState.last_event_id++; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably check if we didn't overflow here – how knows for how many decades it can run now that it got as stable as it is ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can check if evLoopState.last_event_id is maxint if you like, but honestly...meeeh
|
FYI the last commit caused lots of crashes on bifrost, I had to roll back by one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Crashed :(
Can't reproduce :/ Would it be possible to get a core dump if you're still getting it? |
An assortment of fixes which seem to significantly improve stability – though it was never predictable or reproducible, so I may have just gotten lucky with the results here. They do seem to make sense though.
I've seen a crash on startup still happening a few times with input_remove getting a completely bogus handle as an argument according to gdb, so I left the logs in (as
g_warningso that they're always on) in case it happens again, to give us something to work with.