-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: segmation fault occurs when many groups are used (Close #24)
Allocate Onigmo's stack from a heap instead of a stack when many groups are used. see: https://bugs.ruby-lang.org/issues/8716
- Loading branch information
Showing
1 changed file
with
23 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
b9fba1d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this commit usable with threaded onigmo?
After upgrading to
HEAD
I got random crashes (infree
). Reverting this commit seems to have fixed the issue.b9fba1d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this commit with a customized testc.c on Windows and Linux, but I couldn't reproduce the problem.
Actually, I found some deadlock problems. I committed the fixes into the
topic/multithread
branch.b9fba1d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the commit I (often) get the following error:
The stack for that message is the following:
To make onigmo thread safe I define
THREAD_ATOMIC_START
andTHREAD_ATOMIC_END
to lock/unlock apthread_mutex_t
, the code for that can be seen here: setup.c and setup.h.b9fba1d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found another problem with this commit, and updated the
topic/multithread
branch.But I still can't reproduce the problem. I have no idea why the error occurs in
onig_region_free()
.b9fba1d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sorbits Sorry, I didn't notice your comment in the gist. I added a comment.
b9fba1d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
b9fba1d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sorbits Can you try the latest commit in the mutlithread branch (a0efc0a)?
b9fba1d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.