-
-
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
54 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,22 @@ | ||
# 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. 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 {} | ||
Timeout.timeout(5) { 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