2.8.1: ExecJS.compile consistently exits 1 in one environment and 0 elsewhere.
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Start with the reproduction script and the ExecJS entry points in lib/execjs/module.rb, runtime.rb, and external_runtime.rb, then compare the behavior introduced by a6abf130c721ca6ec05cfc7ed79cf2e87a7dcc35 with 2.8.0. Reproduce the exit-status difference using Node 12.21.0 in the affected RHEL environment and verify that compilation succeeds with exit code 0 without regressing the hanging-process fix.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I have a few environments I'm testing execjs's compile in combination with uglifier and have a strange problem that happens consistently in one environment but not elsewhere. I have minimized the problem to this commit: a6abf130c721ca6ec05cfc7ed79cf2e87a7dcc35 released in 2.8.1 and can reliably recreate it with this script:
require 'bundler/inline'
gemfile do
source 'http://rubygems.org'
gem 'execjs', "=2.8.1"
gem 'uglifier', "=3.0.4"
end
require 'uglifier'
puts "Uglifier: #{Uglifier::VERSION}"
puts "ExecJS: #{ExecJS::VERSION}"
puts "Running test..."
ExecJS.compile(File.read(Uglifier::SourceMapPath)); nil
puts $?
In the bad environment, I'm seeing that this exits with 'ok' but with exit code 1:
Uglifier: 3.0.4
ExecJS: 2.8.1
Running test...
Traceback (most recent call last):
7: from XXX/gems/execjs-2.8.1/lib/execjs/module.rb:27:in `compile'
6: from XXX/gems/execjs-2.8.1/lib/execjs/runtime.rb:72:in `compile'
5: from XXX/gems/execjs-2.8.1/lib/execjs/runtime.rb:72:in `new'
4: from XXX/gems/execjs-2.8.1/lib/execjs/external_runtime.rb:14:in `initialize'
3: from XXX/gems/execjs-2.8.1/lib/execjs/external_runtime.rb:39:in `exec'
2: from XXX/gems/execjs-2.8.1/lib/execjs/external_runtime.rb:219:in `exec_runtime'
1: from (execjs):1
ExecJS::RuntimeError (["ok"])
pid 134 exit 1
When I try to recreate this issue in other environments with 2.8.1, it exits correctly with exit code 0.
I determined it was this change: a6abf130c721ca6ec05cfc7ed79cf2e87a7dcc35 by testing this bad environment with execjs 2.8.0 and 2.7.0 without changing anything else and they both exit with exit code 0 as expected:
Uglifier: 3.0.4
ExecJS: 2.7.0
Running test...
pid 364 exit 0
Uglifier: 3.0.4
ExecJS: 2.8.0
Running test...
pid 249 exit 0
I'm using node 12.21.0 and it works on OSX and RHEL 8.4 and debian. The bad environment is also RHEL 8.4 based with a very similar setup as the working one.
It looks like we're explicitly calling process.exit() to avoid it hanging: c5fd11d7b0338ae7779f69a293964f3440ee3787. The docs say:
Rather than calling process.exit() directly, the code should set the process.exitCode and allow the process to exit naturally by avoiding scheduling any additional work for the event loop
The commit for 2.8.1 is such a minor change. I don't know if the process isn't gracefully terminating or some other low level error is happening but I cannot get more information to determine why this exits 1, which in turn makes execjs believe it failed. I've tried getting more output from node but the following options didn't give me anything extra:
--report-uncaught-exception
--report-on-fatalerror
Do you have any ideas on things I can try? Thanks!
- Ngôn ngữ chính
- Ruby
- Star
- 578
- Fork
- 286
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của rails/execjs
-
Runtime stderr is missing from ruby error messageCó thể đã có người làm @arpitjain099 đã nhận 123 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 10/100
Issue tương tự
-
Add ZammadCó thể đã có người làm @Arslan-TR đã nhận hôm nay. Đang mởrequest
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
endoflife-date/endoflife.date#11298 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
performance v/6
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
WITCodingClub/calendar-backend#689 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
rubys/roundhouse#571 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area/web interface
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
mastodon/mastodon#40924 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày