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

halscope: Add some missing "channel valid" checks #2302

Merged
merged 1 commit into from
Jan 27, 2023

Conversation

jepler
Copy link
Contributor

@jepler jepler commented Jan 26, 2023

There's also some confusion about whether "selected" channel of 0 or -1 denotes "none/invalid".

One of these may have been the cause of a crash @cradek saw in halscope on arm64.

@@ -556,12 +557,12 @@ static double snap(int y) {
}

static void left_drag(int dy, int y, GdkModifierType state) {
if(vert->selected <= 0) return;

Copy link
Collaborator

Choose a reason for hiding this comment

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

This doesn't build -- needs to be moved back down.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

weird, I thought we switched to a modern standard that supported interspersing declarations & other statements. I guess that's in master only, not 2.9.

It has to be before one of the array indexes of vert->selected, otherwise there's still undefined behavior (even though it's probably OK on all normal computers)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh, oops, OK. 😊

There's also some confusion about whether "selected" channel of
0 or -1 denotes "none/invalid".

One of these may have been the cause of a crash cradek saw in halscope
on arm64.
@SebKuzminsky
Copy link
Collaborator

Is the crash reproducible? Does this fix it?

@cradek
Copy link
Collaborator

cradek commented Jan 27, 2023

These changes fix the crash for me. I can reproduce it reliably on the pi400 by turning on (aka leaving at the default setting) compositing in xfce, have linuxcnc running, delete autosave.halscope, unloadrt scope_rt, and then starting halscope. It flashes both windows briefly, and then crashes.

(I accidentally discovered that turning off compositing worked around the problem.)

I don't think it has been reproduced on any other machine. Jeff failed to reproduce on his amd64.

@samcoinc
Copy link
Collaborator

samcoinc commented Jan 27, 2023 via email

@samcoinc
Copy link
Collaborator

samcoinc commented Jan 27, 2023 via email

@cradek
Copy link
Collaborator

cradek commented Jan 27, 2023

That sure seems like it might be the same problem.

@SebKuzminsky SebKuzminsky merged commit 05cfc7a into LinuxCNC:2.9 Jan 27, 2023
@jepler jepler deleted the channel-valid branch January 27, 2023 23:30
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.

4 participants