Possible Race Condition
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 20/100
Research direction
Start with lib/execjs/external_runtime.rb lines 137-144 and the exec_runtime method shown in the issue. Reproduce or trace the reported error, then compare this implementation with the later gem version mentioned in the report. Done means establishing whether the exit-status check is racy and whether upgrading resolves the errors.
Written by the indexing model from the issue text.
Description
I'm looking at an error thrown in a Rails application which uses v2.0.2 of execjs. I think it may be due to a potential race condition in this method, but I want to
- validate my understanding of the error thrown
- check, if my understanding is correct and this has been repaired in a later version of the gem, whether a simple upgrade may resolve the errors
For completeness, the method body (which no longer exists in this manner on most recent version) is
def exec_runtime(filename)
output = sh("#{shell_escape(*(binary.split(' ') << filename))} 2>&1")
if $?.success?
output
else
raise RuntimeError, output
end
end
My understanding so far is that, if the most recent exit code is non-zero, the runtime will raise RuntimeError with the shell output even if the shell script executed successfully. The most recent exit code would not have been from the shell script supplying the output -- i.e. a race condition in examining $?
Thank you for your help.
- Dominant language
- Ruby
- Stars
- 578
- Forks
- 286
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rails/execjs
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
バグ
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
voxpupuli/puppet-epel#186 · 1 comment ·
-
external_created_at is no longer used for the message timestamp since the new message UI (v4.4.0) OpenBug Frontend
Difficulty 2/5 1-3 hours Newbie friendliness 78/100