Skip to content

Conversation

@tadzik
Copy link

@tadzik tadzik commented Sep 15, 2021

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_warning so that they're always on) in case it happens again, to give us something to work with.

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.
@tadzik tadzik requested a review from a team September 15, 2021 08:42
Copy link

@Half-Shot Half-Shot left a 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) {

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++;
Copy link
Author

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 ;)

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

@Half-Shot
Copy link

FYI the last commit caused lots of crashes on bifrost, I had to roll back by one.

@Half-Shot Half-Shot self-requested a review September 21, 2021 13:18
Copy link

@Half-Shot Half-Shot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Crashed :(

@tadzik
Copy link
Author

tadzik commented Sep 23, 2021

Crashed :(

Can't reproduce :/ Would it be possible to get a core dump if you're still getting it?

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

Successfully merging this pull request may close these issues.

3 participants