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

[BUG] Buffer overrun .. fixing G29 J #22398

Closed
wants to merge 1 commit into from

Conversation

bwspath
Copy link
Contributor

@bwspath bwspath commented Jul 19, 2021

Description

G29 J flushed the current mesh to 1 value .. didn't adjust
found the issue which is pretty much writing out of bounds. compiler complained about it too.

Values were stored at offset that are not located or used ( floats were stored at vector.x )

Requirements

bed probing and mesh tilting

Benefits

G29 J now works and adjusts the bed

Configurations

HAS_BED_PROBE

Related Issues

#22175

G29 J flushed the current mesh to 1 value .. didn't adjust
found the issue which is pretty much writing out of bounds. compiler complained about it too.
@bwspath bwspath changed the title Buffer overrun .. fixing G29 J [BUG] Buffer overrun .. fixing G29 J Jul 19, 2021
@DerAndere1
Copy link
Contributor

DerAndere1 commented Jul 19, 2021

This looks like a reasonable fix of a regression introduced in commit 7726af9. FYI: The original code before commit 7726af9 was:

  new_matrix.vectors[0] = row_0;
  new_matrix.vectors[1] = row_1;
  new_matrix.vectors[2] = row_2;

@bwspath
Copy link
Contributor Author

bwspath commented Jul 19, 2021

@DerAndere1
well reverting back to before 7726af9 (didn't look at is as I am a git noob and still looking at how I can spot previous revisions) looks cleaner. Though I get the issues with adding the axes.. though that isn't an issue in the final transform ... or is it ? would be a stage before/after the first 3 axes transform ... which could be 1...

@DerAndere1
Copy link
Contributor

DerAndere1 commented Jul 20, 2021

@bwspath Sorry, I do not completely understand your final question. The only thing I can say is that your solution looks great. I just showed the original code for reference. Your code should be functionally equivalent. If you are asking about how to deal with axes beyond xyz (i.e. axes I, J, or K): Those are not relevant here. The vectors and 3x3 matrices so far do not deal with axes but rather with 3D coordinates, so they only have x, y and z elements).

@bwspath
Copy link
Contributor Author

bwspath commented Jul 20, 2021

  new_matrix.vectors[0] = row_0;
  new_matrix.vectors[1] = row_1;
  new_matrix.vectors[2] = row_2;

would be a better solution that what I did .. I failed to get my git foo ok to see what it used to be.

@Roxy-3D
Copy link
Member

Roxy-3D commented Jul 20, 2021

@bwspath I agree with your thoughts here: #22398 (comment)

If you zap the Pull Request to reflect that, I'll press the 'Squash & Merge' button! Thank You for the fix!

@Roxy-3D Roxy-3D closed this Jul 20, 2021
@DerAndere1
Copy link
Contributor

the proposed change was added to Marlin bugfix-2.0.x: with commit 154decf

@bwspath bwspath deleted the patch-2 branch July 20, 2021 12:53
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