Skip to content

Fix deadlock in SetText#665

Merged
rivo merged 1 commit intorivo:masterfrom
SamWhited:fix_crash
Oct 29, 2021
Merged

Fix deadlock in SetText#665
rivo merged 1 commit intorivo:masterfrom
SamWhited:fix_crash

Conversation

@SamWhited
Copy link
Copy Markdown
Contributor

I realized right as I saw the email that the batch stuff had been merged that my change to the locking in SetText would obviously cause a deadlock (we aquire the lock, then the Write method is called which also tries to aquire the lock).

If you'd permit me, I'd like to write tests for some of the functions in this library, it could have prevented this being merged in the first place if I'd written some tests about it. While you consider it though I've pushed up this fix quickly that at least lets SetText be usable again.

Signed-off-by: Sam Whited <sam@samwhited.com>
@rivo rivo merged commit a4acb08 into rivo:master Oct 29, 2021
@rivo
Copy link
Copy Markdown
Owner

rivo commented Oct 29, 2021

Good catch.

Regarding tests, if you plan on adding tests to this package, you should expect significant reviewing & refactoring work before it's merged. In the past, people have tried to throw in test cases here and there without much structure. I didn't merge them, not because I don't like tests (on the contrary!), but because I just didn't want to have a messy codebase to maintain.

If you haven't seen it yet, you may want to tread this comment: #572 (comment). This is where I would start. If you have ideas about this, you might want to open an issue for some discussion before diving into the code.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants