Skip to content

Affinity freezes when selecting objects with dense/coincident node clusters (Wine d2d1 bug) #143

Description

@Shopatch

Selecting certain vector objects freezes Affinity indefinitely. The app is not
crashed, it is spinning on one core and never finishes.

This is a Wine bug in dlls/d2d1/geometry.c, not a problem with the install.
d2d_geometry_resolve_beziers() subdivides overlapping bezier control
triangles until they separate. When several nodes sit on practically the same
coordinates, subdividing never separates them, and every split appends a
segment that is then tested against all earlier ones. The segment count grows
until memory runs out.

Reproduced with Wine 11.0 (wine-tkg) and 11.16. Diagnosed with gdb: 30 samples
over three minutes, 100% in memmove below
d2d_geometry_sink_Close -> d2d_geometry_resolve_beziers -> d2d_geometry_split_bezier -> d2d_figure_insert_vertex.

Workaround without patching Wine: reduce the node count of the affected object
(simplify the curve, split it, or rasterise it).

Patches and a standalone reproducer are attached to the WineHQ bug:
https://bugs.winehq.org/show_bug.cgi?id=60265

The same two patches as carry patches for the Affinity wine build:
daegalus/wine-tkg-affinity#2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions