pytroll / pytroll/aggdraw

Segmentation fault debugging aggdraw.Pen

Open
#58 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
107
Forks
45
Avg merge
13h 41m
Merged PRs (30d)
7

Description

Using aggdraw 1.3.10 in arch linux with cpython 3.7, I get a segmentation fault every time my debugger tries to inspect an aggdraw.Pen object. I tried it debugging with pudb3, with vscode python extension and with pycharm. Here's a minimal code:

from PIL import Image
import aggdraw


def main():
    image = create_image()
    image.show()


def create_image():
    image = Image.new('RGBA', (1024, 1024))
    draw = aggdraw.Draw(image)
    pen = aggdraw.Pen('red', 20)
    draw.line((0, 0, 100, 100), pen)
    draw.flush()
    return image


if __name__ == '__main__':
    main()

Put a breakpoint in the line draw.line((0, 0, 100, 100), pen) and try to inspect pen in your debugger to see if you can reproduce it.

I checked some issues here, and found #22 that also mentions segmentation faults related to Pen, but it seems to be a different issue, and already solved.

And less important, but just to mention it, I don't really want to inspect this object. It's just that debuggers usually show all local variables when you break, so every time I put a breakpoint with a local Pen object, my session crashes and this is the real problem

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the minimal example with aggdraw 1.3.10 on Arch Linux and CPython 3.7, then reproduce the crash by inspecting pen at the draw.line((0, 0, 100, 100), pen) breakpoint in the listed debuggers. Done means debugger inspection no longer causes a segmentation fault.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.