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] Application crashed when removing Part object which is used as a mask of other Part. #291

Closed
2 tasks done
seagetch opened this issue Jun 30, 2023 · 3 comments
Closed
2 tasks done
Labels
Bug Something isn't working Triage PR/Issue needs to be triaged.

Comments

@seagetch
Copy link
Contributor

Validations

  • I have checked for similar bug reports and could not find any.
  • I have tested and confirmed that this is an issue in an official branded build.

Describe the bug

When condition of title is met, application crashed with following crash dump.

hread 1 "inochi-creator" received signal SIGSEGV, Segmentation fault.
0x0000555555bd9c85 in _D8inochi2d4math9transform9Transform6matrixMFZS6inmath6linalg__T6MatrixTfVii4Vii4ZQs (this=..., __HID131=0x7fffffffcf20) at ../inochi2d/source/inochi2d/math/transform.d:88
88 return trs;
(gdb) bt
#0 0x0000555555bd9c85 in _D8inochi2d4math9transform9Transform6matrixMFZS6inmath6linalg__T6MatrixTfVii4Vii4ZQs (this=..., __HID131=0x7fffffffcf20) at ../inochi2d/source/inochi2d/math/transform.d:88
#1 0x0000555555bbefd3 in _D8inochi2d4core5nodes4part4Part__T8drawSelfVbi1ZQoMFZv (
this=0x7ffff6a5c660) at ../inochi2d/source/inochi2d/core/nodes/part/package.d:345
#2 0x0000555555bbd792 in inochi2d.core.nodes.part.Part.renderMask(bool) (this=0x7ffff6a5c660,
dodge=false) at ../inochi2d/source/inochi2d/core/nodes/part/package.d:661
#3 0x0000555555bbe034 in inochi2d.core.nodes.part.Part.drawOne() (this=0x7ffff6a60990)
at ../inochi2d/source/inochi2d/core/nodes/part/package.d:826
#4 0x0000555555bc5a6d in inochi2d.core.puppet.Puppet.draw() (this=0x7ffff69df8a0)
at ../inochi2d/source/inochi2d/core/puppet.d:510
#5 0x0000555555a0a7b5 in creator.viewport.model.incViewportModelDraw(inochi2d.math.camera.Camera) (
camera=0x7ffff69cf080) at source/creator/viewport/model/package.d:229
#6 0x0000555555a0d546 in creator.viewport.incViewportDraw() ()
at source/creator/viewport/package.d:37
#7 0x00005555559bfe7b in creator.panels.viewport.ViewportPanel.onUpdate() (this=0x7ffff69cf200)
at source/creator/panels/viewport.d:117
#8 0x00005555559b0e94 in creator.panels.Panel.update() (this=0x7ffff69cf200)
at source/creator/panels/package.d:121
#9 0x00005555559b0f91 in creator.panels.incUpdatePanels() () at source/creator/panels/package.d:158
#10 0x00005555558b6aa2 in app.incUpdate() () at source/app.d:135
#11 0x00005555558b6a16 in D main (args=...) at source/app.d:97

Reproduction

  1. Add two Part object
  2. Set one Part object to another.
  3. Remove that Part object.

System Architecture

x86_64

Operating System

Linux

Version

No response

Logs

No response

Additional Context

No response

@seagetch seagetch added Bug Something isn't working Triage PR/Issue needs to be triaged. labels Jun 30, 2023
@seagetch
Copy link
Contributor Author

This is caused because removed Part object is not removed from nodes.masks of related nodes at incDeleteChildWithHistory.
But nodes.masks is removed without any undo history, so if we removed Part object from nodes.masks, there's no way to restore nodes.masks state on undo.

@LunaTheFoxgirl
Copy link
Member

Since it's already on the undo stack which would make the reference non-stale; I think the best way to solve the issue would be to only delete the mask completely if the history is emptied, otherwise check if the parent is null for the mask, and if it is; ignoring it.

@seagetch
Copy link
Contributor Author

I sent PR for this fix. (#293)
It seems working well on my environment.

LunaTheFoxgirl pushed a commit that referenced this issue Jul 5, 2023
… related operation. (#296)

* Fix bug: Avoid crash if trying to remove vertex when mirrored by axes, and no correspoinding vertex exists.

* Bug fix: fix for (#291), and additonal undo action for mask addition/removal.

* Bug fix: avoid crash when pair.parts[0] and pair.parts[1] is removed.

* fix wrong guard logic.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Triage PR/Issue needs to be triaged.
Projects
None yet
Development

No branches or pull requests

2 participants