Skip to content

Synfig 1.3.14 crashes on attempt to edit spline (Windows) #1442

Open

Activity

  1. changed the title [-]Synfig 1.3.14 crashes frequently on Windows[/-] [+]Synfig 1.3.14 crashes pn attempt to edit spline (Windows)[/+] on May 24, 2020
  2. morevnaproject commented on May 24, 2020

    @morevnaproject
    MemberAuthor

    I was unable to reproduce that on Linux. Can someone help here? @ice0

  3. morevnaproject commented on May 24, 2020

    @morevnaproject
    MemberAuthor
  4. changed the title [-]Synfig 1.3.14 crashes pn attempt to edit spline (Windows)[/-] [+]Synfig 1.3.14 crashes on attempt to edit spline (Windows)[/+] on May 24, 2020
  5. added this to the v1.4.0 milestone on May 24, 2020
  6. FadhilKwan commented on May 24, 2020

    @FadhilKwan

    @morevnaproject yes ._.?

    I tried to play with this file for quite a while now, and still couldn't find out why it crashes at certain times (still feels random to me).

    However, i found something else that might be somewhat related...
    You don't need to click any vertex points at all to find out if the crash will occur or not.

    You can just click any line (or maybe even any layer), then hover your mouse to the parameter panel and try to scroll it. That also works (in terms of crashing Synfig).

    That should be relatively the same thing, since when you click any point, the parameter panel will automatically scroll and select that exact point.

    With this discovery on hand, i then decided to close the "Parameters" panel and tried to replicate what's in the video again. This time, no crashes occured.

    But, the crash can still happen. The only way to do that is to scroll the "Timetrack" panel down,
    (the "Graph" panel may can also do that, but i couldn't confirm that yet since you can't scroll far down in "Graph" panel.)

    I even tried this with one of my old artwork (which was created in v1.2.2) once and this issue also happened with that file as well.

    Still, I couldn't find what triggers the crash, though. This thing comes up sometimes with no clear sign of whether it'll happen or not.

  7. rodolforg commented on May 24, 2020

    @rodolforg
    Contributor

    It doesn't seem to crash if --console is passed as argument.

    @FadhilKwan could you confirm it? Edit the .bat appending this option on the end of line of synfig executable call

  8. FadhilKwan commented on May 25, 2020

    @FadhilKwan

    It doesn't seem to crash if --console is passed as argument.

    yeah, It kinda occurs..... much less now. (....?)

    Most of the time it won't crash, but once you close the file and load it up again on the same Synfig window, scrolling the "Timeline" (or maybe clicking a point) then crashes it again almost all the time.

    Speaking of the console, i can see more interesting things in it, especially how often the gtk errors pops in on certain conditions.
    Like when i load Synfig, there's no error lines in the console. Same as when i open the file, not even a single arror even when i scroll the "Timetrack" or "Parameters" panel.
    But once i switched workspace to "Synfig Animation 1" (the one that you starts with by default), the errors starts pouring in.

    Maybe the console would do different things with different scenarios as well (such as closing all Synfig workspace windows before opening the file).

    One thing for sure is, Synfig's console pops in some lines of gtk errors for a short time, before then it crashes (still not sure if that was the trigger, though).

  9. Svarov-RZM commented on May 25, 2020

    @Svarov-RZM
    Contributor

    I did some debugging too and here's where I got:
    The crash occurs after the program calls the function "g_closure_invoke" in libgtk with wrong callback address (might be right at the time of calling but later freed for example). I don't know anything about GTK, but I believe the purpose of this function might be to update GUI elements such as scrollable windows for example, because later that function call others such as "gtk_range_get_adjustment".

    The function then rises an "EXCEPTION_ACCESS_VIOLATION" and bam, Synfig closes. The crash happens at exact moment when I switch from one spline to another and select a tangent (click on it). You don't even need to edit it, just select it. Of course, it's random, but under a debugger it happens more often. Below is the picture of Synfig in the moment of crash. I first selected "R2" spline, then selected green dot (circle786), clicked at tangent (you can see yellow dot is being activated) and at that moment Synfig crashed.
    CrashSpline

    Therefore, my theory is that something wrong with the code that handles update of widgets. There's some race condition. Like the memory being freed while it's still being used by the gtk widget (from another thread perhaps?). It happens more frequently when the default tab is opened (Synfig Animation 1), maybe because more widgets are in need of update, so the chances of crash go up.

    Also, if you remove all the widgets, then crash doesn't happen (I might not test enough times though). So try opening the "retestz" example, then remove all widgets so Synfig looks like this:
    NoCrashWoWidgets

    and next try to switch between layers/splines, edit them, and you know, make the program crash. If crash doesn't happen, then issue is definitely somewhere in code handling the update of widgets.

    Moreover, I found another crash that is 100% reproducible under Windows and may lead to some clues with this one. To reproduce:

    1. Open attached "LinkedSplineN" file
      LinkedSplinesN.zip

    2. Click on the top light gray spline

    3. See one gray vertex? It has conversions, so Synfig cannot manage it automatically. Drag it by the spline, not handles. Synfig will greet you with the following error message:
      CrashSplineUM

    4. Hit "Close" and Synfig crashes

    Not sure if it's relatable to current subject, but it might be worth looking at. At least this crash is reproducible and who knows, might have the common case.

  10. rodolforg commented on May 25, 2020

    @rodolforg
    Contributor

    Drag it by the spline, not handles.

    @Svarov-RZM
    What do you mean here? I can't drag anything via the three gray handles (vertex + tangents), and nothing happens if I try (on Linux). I don't know what "drag it by the spline" means. :(

  11. FadhilKwan commented on May 25, 2020

    @FadhilKwan

    Drag it by the spline, not handles.

    What do you mean here? I can't drag anything via the three gray handles (vertex + tangents), and nothing happens if I try (on Linux). I don't know what "drag it by the spline" means. :(

    i think he meant that you should try to drag the line itself to edit its shape, since you can't drag the greyed points.

  12. rodolforg commented on May 25, 2020

    @rodolforg
    Contributor

    Wow! I didn't even know it was possible :)

  13. rodolforg commented on May 25, 2020

    @rodolforg
    Contributor

    Error is thrown here:

    throw Error(_("Direct manipulation of this ValueNode type is not yet supported"));

    And catch here:

    catch (const Action::Error& err) {
    uim->task(action->get_local_name()+' '+_("Failed"));
    if (err.get_type() != Action::Error::TYPE_UNABLE) {
    if (err.get_desc().empty())
    uim->error(action->get_local_name() + ": " + etl::strprintf("%d", err.get_type()));
    else
    uim->error(action->get_local_name() + ": " + err.get_desc());
    }
    // If action failed for whatever reason, just return false and do
    // not add the action onto the list
    return false;

    But the real problem is this thrown:

    if(!duck->signal_edited()(*duck))
    {
    throw String("Bad edit");
    }

    And this is called by:

    BezierDrag_Default::end_bezier_drag(Duckmatic* duckmatic)
    {
    if(is_moving)
    {
    etl::handle<Duck> c1(duckmatic->get_selected_bezier()->c1);
    etl::handle<Duck> c2(duckmatic->get_selected_bezier()->c2);
    duckmatic->signal_edited_duck(c1);
    duckmatic->signal_edited_duck(c2);
    return true;
    }

    called indirectly via:

    if (!end_bezier_drag()) {
    // We didn't move the bezier, just clicked on it
    canvas_view->get_smach().process_event(EventMouse(
    EVENT_WORKAREA_MOUSE_BUTTON_DOWN, BUTTON_LEFT, mouse_pos, pressure, modifier ));
    canvas_view->get_smach().process_event(EventMouse(
    EVENT_WORKAREA_MOUSE_BUTTON_UP, BUTTON_LEFT, mouse_pos, pressure, modifier ));
    }

    that doesn't deal with exception inside a gtk-event signal processing :)

  14. 13 remaining items

  15. morevnaproject commented on Jun 14, 2020

    @morevnaproject
    MemberAuthor

    Thank you for testing and for the video! I will continue digging...

    Will try to revert aeb01c1 and f534533 to see if that will affect the stability...

  16. morevnaproject commented on Jun 14, 2020

    @morevnaproject
    MemberAuthor

    I have reverted aeb01c1, let's wait when build finishes...

  17. FadhilKwan commented on Jun 15, 2020

    @FadhilKwan

    Anyone? ^__^

    umm.. yeah... apologies ._.v
    I'm currently pretty busy at the moment. But i did try the testing build a bit.

    And i'd say, nothing's different in my part, still crashes the same way, though i haven't tried it a bit more, so i didn't want to make a hasty statement.

    Still crashes in exact same way.....

    so... this issue still persists, right? ._.

  18. FadhilKwan commented on Jun 17, 2020

    @FadhilKwan

    Wow, this one actually feels really promising!

    I've tried to twiddle the test file with this one in the ways they could crash the synfig (scrolling parameters panel, clicking points, closing and reopening the file, switching files, etc). I've done those things for many times now, and so far, No Crashes At All, Sweet! ^O^

    I think i could say that this issue has been resolved, but maybe i should test it a bit more just to make sure. Also we should wait until Svarov have tested this one and can confirm it as well

  19. Svarov-RZM commented on Jun 17, 2020

    @Svarov-RZM
    Contributor

    Yep, can also confirm — no crashes in this version. I did pretty much the same as FadhilKwan in terms of testing and Synfig didn't crash once.

  20. morevnaproject commented on Jun 19, 2020

    @morevnaproject
    MemberAuthor

    Thanks to everyone for testing! So, it looks like all instability is about this commit - aeb01c1.
    I wonder what do we loose after reverting it? Looks like it fixes issues with synchronization of horizontal scrolling for Params Panel and TimeTrack Panel...
    But in my tests everything works well even after reverting. Maybe I missed something.

    @ice0 @rodolforg What do you think about that? ^__^

  21. rodolforg commented on Jun 19, 2020

    @rodolforg
    Contributor

    You mean vertical scrolling, right?

  22. morevnaproject commented on Jun 20, 2020

    @morevnaproject
    MemberAuthor

    You mean vertical scrolling, right?

    Vertical scrolling, right. 🤣 Oh, I am messing terms again ^__^"

  23. morevnaproject commented on Jun 20, 2020

    @morevnaproject
    MemberAuthor

    Just to make it clear: here I pushed a commit, which reverts aeb01c1 -
    --> ce37dbe

  24. modified the milestones: v1.4.0, v1.4.1 on Nov 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions