libre2를 업그레이드하면 re2 regexp 오류의 Segfaults
묘사
이것은 C 확장의 실제 문제인지, 아니면libre2
가 -fPIC
로 컴파일해야 이런 상황을 피할 수 있다는 것을 의미하는지 모르겠다(테스트할 것이다).libre2가 업데이트될 때마다(예: 최근https://github.com/Homebrew/homebrew-core/blob/40c227a5885561519827edecffd959f6316163d8/Formula/re2.rb#L4error
를 호출하면 re2 seg 장애가 발생한 것 같습니다.운행gem pristine re2
이 이 문제를 복구했지만, 이seg고장을 피할 수 있는지 알고 싶습니다.문제 재현을 위한 간단한 스크립트:require 're2'
regexp = RE2::Regexp.new("{", log_errors: false)
puts regexp.error unless regexp.ok?
$ ruby re-test.rb
re-test.rb:4: [BUG] Segmentation fault at 0x0000000000000000
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin19]
-- Crash Report log information --------------------------------------------
See Crash Report log file under the one of following:
* ~/Library/Logs/DiagnosticReports
* /Library/Logs/DiagnosticReports
for more details.
Don't forget to include the above Crash Report log file in bug reports.
-- Control frame information -----------------------------------------------
c:0003 p:---- s:0012 e:000011 CFUNC :error
c:0002 p:0040 s:0008 E:000f78 EVAL re-test.rb:4 [FINISH]
c:0001 p:0000 s:0003 E:002140 (none) [FINISH]
-- Ruby level backtrace information ----------------------------------------
re-test.rb:4:in `<main>'
re-test.rb:4:in `error'
-- Machine register context ------------------------------------------------
rax: 0x00007fac19584c70 rbx: 0x00007fac098956e0 rcx: 0x0000000107cd12f0
rdx: 0x000000000000000c rdi: 0x0000000000000000 rsi: 0x000000000000000c
rbp: 0x00007ffee8386e10 rsp: 0x00007ffee8386e00 r8: 0x00007fac196d8d28
r9: 0x00007fac20127f90 r10: 0x00007fac1a086600 r11: 0x00007fac19507028
r12: 0x0000000000000000 r13: 0x00007fac098956e0 r14: 0x00007fac195862e0
r15: 0x00007fac09897850 rip: 0x0000000107cd1317 rfl: 0x0000000000010206
-- C level backtrace information -------------------------------------------
/Users/stanhu/.rbenv/versions/2.6.5/lib/libruby.2.6.dylib(rb_vm_bugreport+0x82) [0x107abc572]
/Users/stanhu/.rbenv/versions/2.6.5/lib/libruby.2.6.dylib(rb_bug_context+0x1d6) [0x10790b746]
/Users/stanhu/.rbenv/versions/2.6.5/lib/libruby.2.6.dylib(sigsegv+0x51) [0x107a21261]
/usr/lib/system/libsystem_platform.dylib(_sigtramp+0x1d) [0x7fff6d5235fd]
/Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/re2-1.1.1/lib/re2.bundle(_ZL16re2_regexp_errorm+0x27) [0x107cd1317]
/Users/stanhu/.rbenv/versions/2.6.5/lib/libruby.2.6.dylib(vm_call_cfunc+0x156) [0x107aaede6]
/Users/stanhu/.rbenv/versions/2.6.5/lib/libruby.2.6.dylib(vm_exec_core+0x33da) [0x107a959ba]
/Users/stanhu/.rbenv/versions/2.6.5/lib/libruby.2.6.dylib(rb_vm_exec+0xac4) [0x107aa9834]
/Users/stanhu/.rbenv/versions/2.6.5/lib/libruby.2.6.dylib(ruby_exec_internal+0xe6) [0x1079167c6]
/Users/stanhu/.rbenv/versions/2.6.5/lib/libruby.2.6.dylib(ruby_run_node+0x49) [0x107916639]
/Users/stanhu/.rbenv/versions/2.6.5/bin/ruby(main+0x5d) [0x107878f0d]
-- Other runtime information -----------------------------------------------
* Loaded script: re-test.rb
* Loaded features:
0 enumerator.so
1 thread.rb
2 rational.so
3 complex.so
4 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/x86_64-darwin19/enc/encdb.bundle
5 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/x86_64-darwin19/enc/trans/transdb.bundle
6 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/x86_64-darwin19/rbconfig.rb
7 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/compatibility.rb
8 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/defaults.rb
9 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/deprecate.rb
10 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/errors.rb
11 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/version.rb
12 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/requirement.rb
13 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/platform.rb
14 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/basic_specification.rb
15 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/stub_specification.rb
16 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/delegate.rb
17 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/uri/rfc2396_parser.rb
18 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/uri/rfc3986_parser.rb
19 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/uri/common.rb
20 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/uri/generic.rb
21 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/uri/file.rb
22 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/uri/ftp.rb
23 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/uri/http.rb
24 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/uri/https.rb
25 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/uri/ldap.rb
26 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/uri/ldaps.rb
27 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/uri/mailto.rb
28 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/uri.rb
29 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/specification_policy.rb
30 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/util/list.rb
31 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/x86_64-darwin19/stringio.bundle
32 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/specification.rb
33 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/exceptions.rb
34 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/util.rb
35 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/bundler_version_finder.rb
36 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/dependency.rb
37 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_gem.rb
38 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/monitor.rb
39 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb
40 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_warn.rb
41 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems.rb
42 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/path_support.rb
43 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/did_you_mean-1.3.0/lib/did_you_mean/version.rb
44 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/did_you_mean-1.3.0/lib/did_you_mean/core_ext/name_error.rb
45 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/did_you_mean-1.3.0/lib/did_you_mean/levenshtein.rb
46 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/did_you_mean-1.3.0/lib/did_you_mean/jaro_winkler.rb
47 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/did_you_mean-1.3.0/lib/did_you_mean/spell_checker.rb
48 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/did_you_mean-1.3.0/lib/did_you_mean/spell_checkers/name_error_checkers/class_name_checker.rb
49 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/did_you_mean-1.3.0/lib/did_you_mean/spell_checkers/name_error_checkers/variable_name_checker.rb
50 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/did_you_mean-1.3.0/lib/did_you_mean/spell_checkers/name_error_checkers.rb
51 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/did_you_mean-1.3.0/lib/did_you_mean/spell_checkers/method_name_checker.rb
52 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/did_you_mean-1.3.0/lib/did_you_mean/spell_checkers/key_error_checker.rb
53 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/did_you_mean-1.3.0/lib/did_you_mean/spell_checkers/null_checker.rb
54 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/did_you_mean-1.3.0/lib/did_you_mean/formatters/plain_formatter.rb
55 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/did_you_mean-1.3.0/lib/did_you_mean.rb
56 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/re2-1.1.1/lib/re2.bundle
57 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/re2-1.1.1/lib/re2/scanner.rb
58 /Users/stanhu/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/re2-1.1.1/lib/re2.rb
[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: https://www.ruby-lang.org/bugreport.html
[IMPORTANT]
Don't forget to include the Crash Report log file under
DiagnosticReports directory in bug reports.
Abort trap: 6
때로는 실패할 수도 있다.ruby(46630,0x11203cdc0) malloc: can't allocate region
:*** mach_vm_map(size=140414988976128, flags: 60000100) failed (error code=3)
ruby(46630,0x11203cdc0) malloc: *** set a breakpoint in malloc_error_break to debug
ruby(46630,0x11203cdc0) malloc: can't allocate region
:*** mach_vm_map(size=140414988976128, flags: 60000100) failed (error code=3)
ruby(46630,0x11203cdc0) malloc: *** set a breakpoint in malloc_error_break to debug
Traceback (most recent call last):
re-test.rb: failed to allocate memory (NoMemoryError)
objdump -d
파일의 bundle
표시:토론 #1
로 컴파일하면 이 문제를 해결할 수 없을 것 같다.-fPIC
안녕하세요, stanhu,기사 고마워요.
나는 그것을 복제하는 데 어려움이 있다.저는 MacOS 10.15.4와 Ruby 2.7.1p83(2020-03-31 개정판 a0c7c23c9c)에서 다음과 같은 내용을 시도했습니다.
00000000000032f0 __ZL16re2_regexp_errorm:
32f0: 55 pushq %rbp
32f1: 48 89 e5 movq %rsp, %rbp
32f4: 53 pushq %rbx
32f5: 50 pushq %rax
32f6: 48 89 fb movq %rdi, %rbx
32f9: be 0c 00 00 00 movl $12, %esi
32fe: e8 c9 30 00 00 callq 12489 <re2.cc+0x63cc>
3303: 48 8b 43 20 movq 32(%rbx), %rax
3307: 48 8b 00 movq (%rax), %rax
330a: 83 b8 80 00 00 00 00 cmpl $0, 128(%rax)
3311: 74 1e je 30 <__ZL16re2_regexp_errorm+0x41>
3313: 48 8b 78 78 movq 120(%rax), %rdi
3317: 0f b6 37 movzbl (%rdi), %esi
331a: 40 f6 c6 01 testb $1, %sil
331e: 75 1d jne 29 <__ZL16re2_regexp_errorm+0x4d>
3320: 48 ff c7 incq %rdi
3323: 48 d1 ee shrq %rsi
3326: 48 83 c4 08 addq $8, %rsp
332a: 5b popq %rbx
332b: 5d popq %rbp
332c: e9 49 31 00 00 jmp 12617 <re2.cc+0x647a>
3331: b8 08 00 00 00 movl $8, %eax
3336: 48 83 c4 08 addq $8, %rsp
333a: 5b popq %rbx
333b: 5d popq %rbp
333c: c3 retq
333d: 48 8b 77 08 movq 8(%rdi), %rsi
3341: 48 8b 7f 10 movq 16(%rdi), %rdi
3345: 48 83 c4 08 addq $8, %rsp
3349: 5b popq %rbx
334a: 5d popq %rbp
334b: e9 2a 31 00 00 jmp 12586 <re2.cc+0x647a>
토론 #2
gem install re2
에서 테스트 스크립트 실행: url "https://github.com/google/re2/archive/2020-03-03.tar.gz"
version "20200303"
sha256 "04ee2aaebaa5038554683329afc494e684c30f82f2a1e47eb62450e59338f84d"
# ...
bottle do
cellar :any
sha256 "abb07cfb9def8d6f25a0d5694f0f23ba44b5b500f2d45d25d27515f62802c01b" => :catalina
sha256 "92c4603fad274003e71699376b20a40c6e57c13f878774a894e28a9ef73295c1" => :mojave
sha256 "58ac31c06c851bc5632c3a0703c0d41e55d8b015229cf03de09ee4a8701d92ef" => :high_sierra
end
pry
를 사용하여re2를 20200401:~> pry -rre2
[1] pry(main)> regexp = RE2::Regexp.new("{", log_errors: false)
=> #<RE2::Regexp /{/>
[2] pry(main)> puts regexp.error unless regexp.ok?
=> nil
url "https://github.com/google/re2/archive/2020-04-01.tar.gz"
version "20200401"
sha256 "98794bc5416326817498384a9c43cbb5a406bab8da9f84f83c39ecad43ed5cea"
# ...
bottle do
cellar :any
sha256 "430e7efee518f5235ea75afc039168ce38c5407b525301199ccbc6c698300bb8" => :catalina
sha256 "67eed1f38907d1d7318b5d95f035ca18ff6186d85ee690560b8b1cd387f8afd4" => :mojave
sha256 "f111b7c906ab090d9db56e1f183f94d02e8cf5ce521e4ae4ff8e64d974cb5cbb" => :high_sierra
end
brew upgrade re2
의 링크를 보면 서로 다른 버전에서 일치하는 것 같습니다.~> pry -rre2
[1] pry(main)> regexp = RE2::Regexp.new("{", log_errors: false)
=> #<RE2::Regexp /{/>
[2] pry(main)> puts regexp.error unless regexp.ok?
=> nil
나는re2(추천하지 않는 API 삭제)에 돌파적인 변화가 있다는 것을 알고 있다. 그래서 SONAME는 6에서 7로 바뀌었고 심지어 자체 제작 소프트웨어로re2.bundle
로 업그레이드되었다. 너의 명령은 여전히 나에게 유용하다.~/.gem/ruby/2.6.5/gems/re2-1.2.0/ext/re2> otool -L re2.bundle
re2.bundle:
/usr/local/opt/re2/lib/libre2.0.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 902.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1)
여기서 더 큰 문제는 베이스 라이브러리가 업그레이드될 때gem의 합리적인 행위는 무엇입니까?특히 일부 내부의 RE2API에 변화가 생겼다면(예를 들어 HEAD
몇 년 전에 한 일) 링크 라이브러리가 그 밑에 변화가 생겼다면gem가 무엇을 할 수 있을지 확실하지 않다.우리는 외부 라이브러리에 전적으로 의존하고 gm에서re2를 묶는 것을 피할 수 있지만, 이것은 라이브러리 행위에 대한 중대한 돌파적인 변화인 것 같다.우리가 약간의 작은 문제를 해결할 수 있기를 바란다.
RE2::Match
https://github.com/Homebrew/homebrew-core/blob/549a5c81c67e401fd3c75339157b3b936ebbbbed/Formula/re2.rb.The bigger picture question here is what is reasonable behaviour for the gem when the underlying library is upgraded? Especially if some internal re2 API changes (as RE2::Match did several years ago), I'm not sure what the gem can do if the linked library has shifted under its feet. We could avoid depending on the external library altogether and bundle re2 inside the gem (as Nokogiri does with libxml2) but this seems like a major, breaking change to the behaviour of the library.
이것은 좋은 문제다.우리는
토론 #셋
와 ffi
를 검사했는데 eventmachine
절차가 실패하면 이 검사는 실패할 것이다.만약 베이스 라이브러리에 변화가 발생하면 require
re2
에서 빠르게 효력을 상실할 수 있습니까?이것은 적어도 문제를 더욱 쉽게 진단할 수 있게 할 것이다.require 're2'
아, 이거 성공했어:re2 2020-01-01에 따라gem를 컴파일한 다음에 2020-04-01로 업그레이드하면 내가 토론 #4
를 호출할 때SEGFULT를 초래할 수 있어.봐봐diff between the two versions 나는 돌파적인 ABI 변화가 있다는 것을 발견했다. 구글은soname을 0에서 6으로 바꾸었다.(최신 버전이 있는 것을 보았습니다changed again from 6 to 7.
그러나 ABI 버전이 어떻든지 간에 Homebrew는 라이브러리의soname를 0으로 현저하게 변경할 것 같습니다.삭제 lines from the re2 Formula that change the dylib ID and add symlinks 는 자제 사칭libre2를 중지합니다.6 및 libre27은libre2로 사용됩니다.0 그리고 필요할 때gem의 빠른 실패를 초래합니다:
[1] pry(main)> regexp = RE2::Regexp.new("{", log_errors: false)
=> #<RE2::Regexp /{/>
[2] pry(main)> puts regexp.error unless regexp.ok?
=> nil
Ubuntu에서 볼 때 RE2::Regexp#error
와 libre2-dev
패키지는 공유 라이브러리에 soname 접두사를 정확하게 추가한 것 같아서 이것은 맥OS와 자체 제작의 문제일 뿐이라고 의심한다.Homebrew에 ABI 버전의 덮어쓰기를 중지해 달라고 요청하면, 기본libre2 ABI 버전이 바뀌고 가장 합리적인 방법인 것 같을 때, 덮어쓰기를 시도하면,gem는 곧 실패할 것입니다.
이것은gem 자체에 대해 어떠한 변경도 할 필요가 없습니다.
당신은 어떻게 생각합니까?
libre2-5
현재 자제 핵심에 합병되었다.당신은 최신 레시피(2020-05-01 제1판)로 다시 한 번 시험해 볼 수 있습니까? 만약 그것의 성능이 당신의 기대에 부합된다면 저에게 알려주시겠습니까?아마도 2020-04-01 formulasoname이 0인 re2를 설치할 수 있을 것이다. (비록 6이어야 하지만)
그리고
require
를 사용하여 이 버전의gem를 설치하고 컴파일하며 정상적인 작업을 확인합니다.# Against re 2020-01-01 without the dylib ID changing or symlinks
~> gem install re2
Fetching re2-1.2.0.gem
Building native extensions. This could take a while...
Successfully installed re2-1.2.0
1 gem installed
~/.gem/ruby/2.6.5/gems/re2-1.2.0/ext/re2> otool -L re2.bundle
re2.bundle:
/usr/local/opt/re2/lib/libre2.0.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 902.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1)
# Upgrading to 2020-04-01 without the dylib ID changing or symlinks
~> brew upgrade re2
~/.gem/ruby/2.6.5/gems/re2-1.2.0/ext/re2> otool -L re2.bundle
re2.bundle:
/usr/local/opt/re2/lib/libre2.0.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 902.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1)
# Now libre2.0.dylib is entirely missing
~> ls -la /usr/local/opt/re2/lib
total 2168
drwxr-xr-x 7 mudge admin 224 2 May 10:47 .
drwxr-xr-x 9 mudge admin 288 2 May 10:47 ..
-r--r--r-- 1 mudge admin 348556 2 May 10:47 libre2.6.0.0.dylib
lrwxr-xr-x 1 mudge admin 18 2 May 10:47 libre2.6.dylib -> libre2.6.0.0.dylib
-r--r--r-- 1 mudge admin 755048 2 May 10:47 libre2.a
lrwxr-xr-x 1 mudge admin 18 2 May 10:47 libre2.dylib -> libre2.6.0.0.dylib
drwxr-xr-x 3 mudge admin 96 2 May 10:47 pkgconfig
# Try requiring re2 linked against the now-missing re2 version
~/.gem/ruby/2.6.5/gems/re2-1.2.0/ext/re2> pry -rre2
Traceback (most recent call last):
9: from /Users/mudge/.gem/ruby/2.7.1/bin/pry:23:in `<main>'
8: from /Users/mudge/.gem/ruby/2.7.1/bin/pry:23:in `load'
7: from /Users/mudge/.gem/ruby/2.7.1/gems/pry-0.13.1/bin/pry:12:in `<top (required)>'
6: from /Users/mudge/.gem/ruby/2.7.1/gems/pry-0.13.1/lib/pry/cli.rb:89:in `parse_options'
5: from /Users/mudge/.gem/ruby/2.7.1/gems/pry-0.13.1/lib/pry/pry_class.rb:146:in `final_session_setup'
4: from /Users/mudge/.gem/ruby/2.7.1/gems/pry-0.13.1/lib/pry/pry_class.rb:104:in `load_requires'
3: from /Users/mudge/.gem/ruby/2.7.1/gems/pry-0.13.1/lib/pry/pry_class.rb:104:in `each'
2: from /Users/mudge/.gem/ruby/2.7.1/gems/pry-0.13.1/lib/pry/pry_class.rb:105:in `block in load_requires'
1: from /Users/mudge/.rubies/ruby-2.7.1/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
/Users/mudge/.rubies/ruby-2.7.1/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require': cannot load such file -- re2 (LoadError)
13: from /Users/mudge/.gem/ruby/2.7.1/bin/pry:23:in `<main>'
12: from /Users/mudge/.gem/ruby/2.7.1/bin/pry:23:in `load'
11: from /Users/mudge/.gem/ruby/2.7.1/gems/pry-0.13.1/bin/pry:12:in `<top (required)>'
10: from /Users/mudge/.gem/ruby/2.7.1/gems/pry-0.13.1/lib/pry/cli.rb:89:in `parse_options'
9: from /Users/mudge/.gem/ruby/2.7.1/gems/pry-0.13.1/lib/pry/pry_class.rb:146:in `final_session_setup'
8: from /Users/mudge/.gem/ruby/2.7.1/gems/pry-0.13.1/lib/pry/pry_class.rb:104:in `load_requires'
7: from /Users/mudge/.gem/ruby/2.7.1/gems/pry-0.13.1/lib/pry/pry_class.rb:104:in `each'
6: from /Users/mudge/.gem/ruby/2.7.1/gems/pry-0.13.1/lib/pry/pry_class.rb:105:in `block in load_requires'
5: from /Users/mudge/.rubies/ruby-2.7.1/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:156:in `require'
4: from /Users/mudge/.rubies/ruby-2.7.1/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:168:in `rescue in require'
3: from /Users/mudge/.rubies/ruby-2.7.1/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:168:in `require'
2: from /Users/mudge/.gem/ruby/2.7.1/gems/re2-1.2.0/lib/re2.rb:6:in `<top (required)>'
1: from /Users/mudge/.rubies/ruby-2.7.1/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
/Users/mudge/.rubies/ruby-2.7.1/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require': dlopen(/Users/mudge/.gem/ruby/2.7.1/gems/re2-1.2.0/lib/re2.bundle, 9): Library not loaded: /usr/local/opt/re2/lib/libre2.0.dylib (LoadError)
Referenced from: /Users/mudge/.gem/ruby/2.7.1/gems/re2-1.2.0/lib/re2.bundle
그런 다음 latest, fixed version of the re2 Formula(soname 은 7)로 업그레이드하고 같은 명령을 다시 실행합니다.$ irb -rre2
> RE2('{').error
=> nil
토론 #5
@mudge 정말 좋아요. 저한테도 좋아요.감사합니다!gem install re2
다른 질문을 해야 할지도 모르지만, 토론 #6
지금 당신에게 유용합니까?본 내용:~> irb -rre2
/Users/mudge/.rubies/ruby-2.7.1/lib/ruby/2.7.0/irb/init.rb:290: warning: LoadError: dlopen(/Users/mudge/.gem/ruby/2.7.1/gems/re2-1.2.0/lib/re2.bundle, 9): Library not loaded: /usr/local/opt/re2/lib/libre2.0.dylib
Referenced from: /Users/mudge/.gem/ruby/2.7.1/gems/re2-1.2.0/lib/re2.bundle
Reason: image not found - /Users/mudge/.gem/ruby/2.7.1/gems/re2-1.2.0/lib/re2.bundle
토론 #7
re2 1.2.0으로 업데이트해야 한다고 생각합니다. 2020-05-01에서gem pristine re2
옵션이 삭제되었기 때문에soname bump가 취소되었습니다): 참조https://github.com/mudge/re2/issues/40.토론 #8
@mudge 다시 한 번 감사합니다!성공했어.Reference
이 문제에 관하여(libre2를 업그레이드하면 re2 regexp 오류의 Segfaults), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://github.com/mudge/re2/issues/43텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)