-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We would segv when using proj and then fork a process. This is fixed by using proj's thread-safe context. Fixes #39
- Loading branch information
Showing
4 changed files
with
55 additions
and
20 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative "test_helper" | ||
require "timeout" | ||
|
||
class NonRegressionTest < Minitest::Test | ||
# When this test fail, you should end up with a segv or this test will | ||
# hang forever. In both cases, you'll see that there is an issue. Note | ||
# that it does not fail systematically, so running it ~10 times will | ||
# help you be sure that you are not regressing on that topic again. | ||
# | ||
# See https://github.com/rgeo/rgeo-proj4/issues/39. | ||
def test_forking_issue39 | ||
RGeo::CoordSys::Proj4.create("EPSG:4326") | ||
pid = Process.fork {} | ||
Process.wait pid | ||
ensure | ||
begin | ||
Process.kill(9, pid) | ||
rescue Errno::ESRCH # rubocop:disable Lint/SuppressedException | ||
end | ||
end | ||
end |
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