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

Some area symbol objects trigger a crash #1608

Closed
valdisj opened this issue May 11, 2020 · 3 comments · Fixed by #1609
Closed

Some area symbol objects trigger a crash #1608

valdisj opened this issue May 11, 2020 · 3 comments · Fixed by #1609

Comments

@valdisj
Copy link

valdisj commented May 11, 2020

Steps to reproduce

  1. Opening OCAD12 file in Mapper

This happens with this OCAD file in attach. Other OCAD files are opening normal. But its worth to check, if something special is making MAPPER to totally crash, since this could be indication of wider problem.

Actual behaviour

Mapper totally crashes.

Expected behaviour

OCAD file is opened.

Configuration

Mapper Version: 0.9.2
Operating System: MacOS
Bargupite_SIkompass-2019.ocd.zip

@lpechacek
Copy link
Member

Possible fix.

diff --git a/src/core/symbols/line_symbol.cpp b/src/core/symbols/line_symbol.cpp
index d0c8ed207a8a..e28f99198972 100644
--- a/src/core/symbols/line_symbol.cpp
+++ b/src/core/symbols/line_symbol.cpp
@@ -403,7 +403,7 @@ void LineSymbol::createSinglePathRenderables(const VirtualPath& path, bool path_
        if ((create_line || create_border) && processed_coords.size() > 1)
        {
                VirtualPath processed_path = { processed_flags, processed_coords };
-               processed_path.path_coords.update(path.first_index);
+               processed_path.path_coords.update(0);
                if (create_line)
                {
                        output.insertRenderable(new LineRenderable(this, processed_path, path_closed));

@dg0yt
Copy link
Member

dg0yt commented May 11, 2020

@lpechacek Yes, this argument should always be zero, or rather processed_path.first_index. Broken since 7c26d51, when I renamed the local variable path (shadowing a parameter with same name) to processed_path.

@dg0yt dg0yt self-assigned this May 11, 2020
@dg0yt dg0yt added this to the v0.9.3 milestone May 11, 2020
@lpechacek
Copy link
Member

Minimal reproducer. The key points are - combined symbol (area+dashed line), line dash longer than the hole in the area, and the hole must have at least one Bézier segment.

crasher.omap.gz

dg0yt added a commit that referenced this issue May 11, 2020
Amends 7c26d51.
Fixes GH-1608 (Crash with particular OCD file).
@dg0yt dg0yt changed the title Opening OCAD file crashes all MAPPER Some area symbol object trigger a crash May 11, 2020
@dg0yt dg0yt changed the title Some area symbol object trigger a crash Some area symbol objects trigger a crash May 11, 2020
dg0yt added a commit that referenced this issue May 12, 2020
When renaming a local identifier (to resolve shadowing) in 7c26d51,
one usage of the identifier was overlooked, leading to refering to
the shadowed parameter instead. This caused out-of-bounds access
in a rare but valid combination of circumstances:
- A combined symbol with an area subsymbol and a dashed line symbol.
- An object with a hole which has at least one Bézier segment.
Fixes GH-1608 (Crash when loading file).
@dg0yt dg0yt mentioned this issue May 12, 2020
dg0yt added a commit that referenced this issue May 12, 2020
When renaming a local identifier (to resolve shadowing) in 7c26d51,
one usage of the identifier was overlooked, leading to refering to
the shadowed parameter instead. This caused out-of-bounds access
in a rare but valid combination of circumstances:
- A combined symbol with an area subsymbol and a dashed line symbol.
- An object with a hole which has at least one Bézier segment.
Fixes GH-1608 (Crash when loading file).
dg0yt added a commit that referenced this issue May 13, 2020
When renaming a local identifier (to resolve shadowing) in 7c26d51,
one usage of the identifier was overlooked, leading to refering to
the shadowed parameter instead. This caused out-of-bounds access
in a rare but valid combination of circumstances:
- A combined symbol with an area subsymbol and a dashed line symbol.
- An object with a hole which has at least one Bézier segment.
Fixes GH-1608 (Crash when loading file).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants