optimizely / ruby-sdk

Ruby SDK for Optimizely Feature Experimentation and Optimizely Full Stack (legacy)
https://docs.developers.optimizely.com/experimentation/v4.0.0-full-stack/docs/ruby-sdk
Apache License 2.0
24 stars 29 forks source link

Setting up the SDK in a Rails initializer causes a segmentation fault #201

Closed matthewmcgarvey closed 4 years ago

matthewmcgarvey commented 5 years ago

This happens during the initial page load for me. It does not happen in our docker containers which use Centos.

Mac version: 10.14.6 (Mojave) Ruby version: 2.5.1 Rails version: 5.2.3 optimizely-sdk version: 3.2.0

Output:

/Users/matthew.mcgarvey/.asdf/installs/ruby/2.5.1/lib/ruby/2.5.0/socket.rb:227: [BUG] Segmentation fault at 0x0000000110796a3a
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin18]

-- 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:0013 p:---- s:0125 e:000124 CFUNC  :getaddrinfo
c:0012 p:0034 s:0115 e:000114 METHOD /Users/matthew.mcgarvey/.asdf/installs/ruby/2.5.1/lib/ruby/2.5.0/socket.rb:227
c:0011 p:0073 s:0104 e:000103 METHOD /Users/matthew.mcgarvey/.asdf/installs/ruby/2.5.1/lib/ruby/2.5.0/socket.rb:631
c:0010 p:0034 s:0091 e:000090 METHOD /Users/matthew.mcgarvey/.asdf/installs/ruby/2.5.1/lib/ruby/gems/2.5.0/gems/webpacker-4.0.7/lib/webpacker/dev_server.rb:16
c:0009 p:0026 s:0087 e:000086 METHOD /Users/matthew.mcgarvey/.asdf/installs/ruby/2.5.1/lib/ruby/gems/2.5.0/gems/webpacker-4.0.7/lib/webpacker/dev_server_proxy.rb:14
c:0008 p:0014 s:0079 E:001ac8 METHOD /Users/matthew.mcgarvey/.asdf/installs/ruby/2.5.1/lib/ruby/gems/2.5.0/gems/rack-proxy-0.6.5/lib/rack/proxy.rb:57
c:0007 p:0020 s:0074 E:001b30 METHOD /Users/matthew.mcgarvey/.asdf/installs/ruby/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/engine.rb:524
c:0006 p:0026 s:0068 E:001b88 METHOD /Users/matthew.mcgarvey/.asdf/installs/ruby/2.5.1/lib/ruby/gems/2.5.0/gems/puma-4.1.1/lib/puma/configuration.rb:228
c:0005 p:0262 s:0063 E:001c88 METHOD /Users/matthew.mcgarvey/.asdf/installs/ruby/2.5.1/lib/ruby/gems/2.5.0/gems/puma-4.1.1/lib/puma/server.rb:664
c:0004 p:0026 s:0038 E:001d20 METHOD /Users/matthew.mcgarvey/.asdf/installs/ruby/2.5.1/lib/ruby/gems/2.5.0/gems/puma-4.1.1/lib/puma/server.rb:467
c:0003 p:0065 s:0026 E:001da8 BLOCK  /Users/matthew.mcgarvey/.asdf/installs/ruby/2.5.1/lib/ruby/gems/2.5.0/gems/puma-4.1.1/lib/puma/server.rb:328 [FINISH]
c:0002 p:0125 s:0016 E:001e50 BLOCK  /Users/matthew.mcgarvey/.asdf/installs/ruby/2.5.1/lib/ruby/gems/2.5.0/gems/puma-4.1.1/lib/puma/thread_pool.rb:135 [FINISH]
c:0001 p:---- s:0003 e:000002 (none) [FINISH]

-- Ruby level backtrace information ----------------------------------------
/Users/matthew.mcgarvey/.asdf/installs/ruby/2.5.1/lib/ruby/gems/2.5.0/gems/puma-4.1.1/lib/puma/thread_pool.rb:135:in `block in spawn_thread'
/Users/matthew.mcgarvey/.asdf/installs/ruby/2.5.1/lib/ruby/gems/2.5.0/gems/puma-4.1.1/lib/puma/server.rb:328:in `block in run'
/Users/matthew.mcgarvey/.asdf/installs/ruby/2.5.1/lib/ruby/gems/2.5.0/gems/puma-4.1.1/lib/puma/server.rb:467:in `process_client'
/Users/matthew.mcgarvey/.asdf/installs/ruby/2.5.1/lib/ruby/gems/2.5.0/gems/puma-4.1.1/lib/puma/server.rb:664:in `handle_request'
/Users/matthew.mcgarvey/.asdf/installs/ruby/2.5.1/lib/ruby/gems/2.5.0/gems/puma-4.1.1/lib/puma/configuration.rb:228:in `call'
/Users/matthew.mcgarvey/.asdf/installs/ruby/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/engine.rb:524:in `call'
/Users/matthew.mcgarvey/.asdf/installs/ruby/2.5.1/lib/ruby/gems/2.5.0/gems/rack-proxy-0.6.5/lib/rack/proxy.rb:57:in `call'
/Users/matthew.mcgarvey/.asdf/installs/ruby/2.5.1/lib/ruby/gems/2.5.0/gems/webpacker-4.0.7/lib/webpacker/dev_server_proxy.rb:14:in `rewrite_response'
/Users/matthew.mcgarvey/.asdf/installs/ruby/2.5.1/lib/ruby/gems/2.5.0/gems/webpacker-4.0.7/lib/webpacker/dev_server.rb:16:in `running?'
/Users/matthew.mcgarvey/.asdf/installs/ruby/2.5.1/lib/ruby/2.5.0/socket.rb:631:in `tcp'
/Users/matthew.mcgarvey/.asdf/installs/ruby/2.5.1/lib/ruby/2.5.0/socket.rb:227:in `foreach'
/Users/matthew.mcgarvey/.asdf/installs/ruby/2.5.1/lib/ruby/2.5.0/socket.rb:227:in `getaddrinfo'

-- Machine register context ------------------------------------------------
 rax: 0x0000000110796a38 rbx: 0x00007fe81652eb20 rcx: 0x000070000c13b0ac
 rdx: 0x0000000000000000 rdi: 0x00007fe81652eb20 rsi: 0x0000000000000001
 rbp: 0x000070000c138e50 rsp: 0x000070000c138a10  r8: 0x0000000000000067
  r9: 0x0000000000000000 r10: 0x0000000000000003 r11: 0xfffff017f5bf6a18
 r12: 0x00007fe81652eb20 r13: 0x0000000000000000 r14: 0x0000000000000002
 r15: 0x0000000110796a3c rip: 0x00007fff59daa90a rfl: 0x0000000000010202

-- C level backtrace information -------------------------------------------
0   ruby                                0x000000011014a487 rb_vm_bugreport + 135
1   ruby                                0x000000010ffc1ae3 rb_bug_context + 467
2   ruby                                0x00000001100b7e71 sigsegv + 81
3   libsystem_platform.dylib            0x00007fff59d87b5d _sigtramp + 29
4   libsystem_trace.dylib               0x00007fff59daa90a _os_log_preferences_refresh + 76
5   libsystem_trace.dylib               0x00007fff59dab13d os_log_type_enabled + 627
6   libsystem_info.dylib                0x00007fff59cbd709 si_destination_compare_statistics + 1993
7   libsystem_info.dylib                0x00007fff59cbc1a5 si_destination_compare_internal + 661
8   libsystem_info.dylib                0x00007fff59cbbd3f si_destination_compare + 559
9   libsystem_info.dylib                0x00007fff59c9a6df _gai_addr_sort + 111
10  libsystem_c.dylib                   0x00007fff59c44e5b _isort + 193
11  libsystem_c.dylib                   0x00007fff59c44d88 _qsort + 2125
12  libsystem_info.dylib                0x00007fff59c91f2d _gai_sort_list + 781
13  libsystem_info.dylib                0x00007fff59c90885 si_addrinfo + 2021
14  libsystem_info.dylib                0x00007fff59c8ff77 _getaddrinfo_internal + 231
15  libsystem_info.dylib                0x00007fff59c8fe7d getaddrinfo + 61
16  socket.bundle                       0x00000001107f8275 nogvl_getaddrinfo + 181
17  ruby                                0x00000001100f2ce2 rb_thread_call_without_gvl + 82
18  socket.bundle                       0x00000001107f80ce rb_getaddrinfo + 1934
19  socket.bundle                       0x00000001107f8546 rsock_getaddrinfo + 150
20  socket.bundle                       0x00000001107fc616 call_getaddrinfo + 182
21  socket.bundle                       0x00000001107fa920 addrinfo_s_getaddrinfo + 144
22  ruby                                0x000000011013cf77 vm_call_cfunc + 295
23  ruby                                0x000000011012465e vm_exec_core + 13262
24  ruby                                0x0000000110137600 vm_exec + 144
25  ruby                                0x000000011013609a vm_invoke_proc + 362
26  ruby                                0x000000011013e4af vm_call_opt_call + 159
27  ruby                                0x000000011012465e vm_exec_core + 13262
28  ruby                                0x0000000110137600 vm_exec + 144
29  ruby                                0x000000011013609a vm_invoke_proc + 362
30  ruby                                0x00000001100f9a52 thread_start_func_2 + 1762
31  ruby                                0x00000001100f9348 thread_start_func_1 + 184
32  libsystem_pthread.dylib             0x00007fff59d902eb _pthread_body + 126
33  libsystem_pthread.dylib             0x00007fff59d93249 _pthread_start + 66
mikeproeng37 commented 5 years ago

Thanks for reporting. We are looking into this issue and will get back with more information. Any way you can provide sample code with how you have the SDK setup so we can accurately reproduce it?

mikeproeng37 commented 4 years ago

Closing due to inactivity and us not able to repro.