Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault with ruby 2.4.2, rails 5.0.7.2, mysql2 0.4.10 mojava 10.14.3 #1036

Closed
ThanksSirAlex opened this issue Apr 9, 2019 · 7 comments

Comments

@ThanksSirAlex
Copy link

/Users/thankssiralex/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/activesupport-5.0.7.2/lib/active_support/core_ext/kernel/agnostics.rb:7: [BUG] Segmentation fault at 0x0000000106c42a52
ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-darwin18]

I've try uninstall and reinstall mysql, rbenv rehash, none of them works.
And rails console works well, I can query in rails c. But when I start rails server and try to visit root domain it raise error.

@ThanksSirAlex ThanksSirAlex changed the title Segmentation fault with ruby 2.4.2, rails 5.0.7.2, mysql2 0.4.10 Segmentation fault with ruby 2.4.2, rails 5.0.7.2, mysql2 0.4.10 mojava 10.14.3 Apr 9, 2019
@sodabrew
Copy link
Collaborator

Can you try mysql2 0.5.x?

@jgoodall628
Copy link

jgoodall628 commented Apr 28, 2019

I am having the same issue. When i tried updating to 0.5, i get this error:

Gem::LoadError: Specified 'mysql2' for database adapter, but the gem is not loaded. Add gem 'mysql2' to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).

Gem::LoadError: can't activate mysql2 (< 0.5, >= 0.3.18), already activated mysql2-0.5.2. Make sure all dependencies are added to Gemfile.

Do you know which version of active record uses 0.5.x? Or is there a workaround for this so that I don't have to upgrade rails/active record. I can also provide the crash report if that is helpful for this bug.

@jgoodall628
Copy link

Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rack-mini-profiler-1.0.0/lib/patches/db/mysql2.rb:8: [BUG] Segmentation fault at 0x0000000000019f01
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:0045 p:---- s:0231 e:000230 CFUNC :each
c:0044 p:0018 s:0227 e:000226 METHOD /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rack-mini-profiler-1.0.0/lib/patches/db/mysql2.rb:8 [FINISH]
c:0043 p:---- s:0218 E:001cc0 CFUNC :to_a
c:0042 p:0029 s:0214 e:000213 BLOCK /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.0.1/lib/active_record/connection_adapters/mysq
c:0041 p:0005 s:0210 e:000209 BLOCK /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.0.1/lib/active_record/connection_adapters/mysq
c:0040 p:0013 s:0206 e:000205 METHOD /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.0.1/lib/active_record/connection_adapters/abst
c:0039 p:0024 s:0200 e:000199 METHOD /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.0.1/lib/active_record/connection_adapters/mysq
c:0038 p:0018 s:0193 e:000192 METHOD /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.0.1/lib/active_record/connection_adapters/mysq
c:0037 p:0038 s:0186 e:000185 METHOD /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.0.1/lib/active_record/connection_adapters/abst
c:0036 p:0021 s:0178 e:000177 METHOD /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.0.1/lib/active_record/connection_adapters/abst
c:0035 p:0006 s:0173 e:000172 METHOD /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.0.1/lib/active_record/connection_adapters/abst
c:0034 p:0012 s:0169 e:000167 BLOCK /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.0.1/lib/active_record/connection_adapters/abst [FINISH]
c:0033 p:---- s:0164 e:000163 CFUNC :tap
c:0032 p:0010 s:0160 e:000159 METHOD /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.0.1/lib/active_record/connection_adapters/abst
c:0031 p:0015 s:0156 e:000155 METHOD /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.0.1/lib/active_record/schema_migration.rb:25
c:0030 p:0012 s:0151 e:000150 METHOD /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.0.1/lib/active_record/connection_adapters/abst
c:0029 p:0075 s:0147 e:000146 METHOD /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.0.1/lib/active_record/migration.rb:1109 [FINISH]
c:0028 p:---- s:0140 e:000139 CFUNC :new
c:0027 p:0034 s:0133 e:000132 METHOD /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.0.1/lib/active_record/migration.rb:1006
c:0026 p:0064 s:0126 e:000125 METHOD /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.0.1/lib/active_record/migration.rb:984
c:0025 p:0126 s:0119 e:000118 METHOD /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.0.1/lib/active_record/tasks/database_tasks.rb:
c:0024 p:0006 s:0111 e:000110 METHOD /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/strong_migrations-0.2.2/lib/strong_migrations/database_tasks.
c:0023 p:0015 s:0106 e:000105 BLOCK /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.0.1/lib/active_record/railties/databases.rake: [FINISH]
c:0022 p:0009 s:0103 e:000102 BLOCK /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/task.rb:271 [FINISH]
c:0021 p:---- s:0099 e:000098 CFUNC :each
c:0020 p:0127 s:0095 e:000094 METHOD /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/task.rb:271
c:0019 p:0009 s:0090 e:000089 METHOD /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/airbrake-6.0.0/lib/airbrake/rake/task_ext.rb:19
c:0018 p:0159 s:0084 e:000083 BLOCK /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/task.rb:213
c:0017 p:0007 s:0080 e:000079 METHOD /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/2.5.0/monitor.rb:226
c:0016 p:0024 s:0076 e:000075 METHOD /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/task.rb:193
c:0015 p:0033 s:0069 e:000068 METHOD /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/task.rb:182
c:0014 p:0030 s:0063 e:000062 METHOD /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:160
c:0013 p:0007 s:0055 e:000054 BLOCK /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:116 [FINISH]
c:0012 p:---- s:0051 e:000050 CFUNC :each
c:0011 p:0037 s:0047 e:000046 BLOCK /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:116
c:0010 p:0024 s:0044 e:000043 METHOD /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:125
c:0009 p:0005 s:0039 e:000038 METHOD /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:110
c:0008 p:0044 s:0035 e:000034 BLOCK /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.0.1/lib/rails/commands/rake_proxy.rb:14
c:0007 p:0002 s:0032 e:000031 METHOD /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:186
c:0006 p:0032 s:0027 e:000026 METHOD /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.0.1/lib/rails/commands/rake_proxy.rb:11
c:0005 p:0035 s:0022 e:000021 METHOD /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:51
c:0004 p:0115 s:0017 e:000016 TOP /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.0.1/lib/rails/commands.rb:18 [FINISH]
c:0003 p:---- s:0012 e:000011 CFUNC :require
c:0002 p:0053 s:0007 E:002398 EVAL bin/rails:9 [FINISH]
c:0001 p:0000 s:0003 E:002520 (none) [FINISH]

-- Ruby level backtrace information ----------------------------------------
bin/rails:9:in <main>' bin/rails:9:in require'
/Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.0.1/lib/rails/commands.rb:18:in <top (required)>' /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:51:in run_command!'
/Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.0.1/lib/rails/commands/rake_proxy.rb:11:in run_rake_task' /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:186:in standard_exception_handling'
/Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.0.1/lib/rails/commands/rake_proxy.rb:14:in block in run_rake_task' /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:110:in top_level'
/Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:125:in run_with_threads' /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:116:in block in top_level'
/Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:116:in each' /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:116:in block (2 levels) in top_level'
/Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/application.rb:160:in invoke_task' /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/task.rb:182:in invoke'
/Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/task.rb:193:in invoke_with_call_chain' /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/2.5.0/monitor.rb:226:in mon_synchronize'
/Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/task.rb:213:in block in invoke_with_call_chain' /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/airbrake-6.0.0/lib/airbrake/rake/task_ext.rb:19:in execute'
/Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/task.rb:271:in execute' /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/task.rb:271:in each'
/Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rake-12.3.1/lib/rake/task.rb:271:in block in execute' /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.0.1/lib/active_record/railties/databases.rake:58:in block (2 levels) in <top (required)>'
/Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/strong_migrations-0.2.2/lib/strong_migrations/database_tasks.rb:4:in migrate' /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.0.1/lib/active_record/tasks/database_tasks.rb:161:in migrate'
/Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.0.1/lib/active_record/migration.rb:984:in migrate' /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.0.1/lib/active_record/migration.rb:1006:in up'
/Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.0.1/lib/active_record/migration.rb:1006:in new' /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.0.1/lib/active_record/migration.rb:1109:in initialize'
/Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.0.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:1010:in initialize_schema_migrations_table' /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.0.1/lib/active_record/schema_migration.rb:25:in create_table'
/Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.0.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:78:in internal_string_options_for_primary_key' /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.0.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:78:in tap'
/Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.0.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:79:in block in internal_string_options_for_primary_key' /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.0.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:301:in charset'
/Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.0.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:595:in show_variable' /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:54:in select_value'
/Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.0.1/lib/active_record/connection_adapters/mysql/database_statements.rb:19:in select_rows' /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.0.1/lib/active_record/connection_adapters/mysql/database_statements.rb:65:in select_result'
/Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.0.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:225:in execute_and_free' /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.0.1/lib/active_record/connection_adapters/mysql/database_statements.rb:65:in block in select_result'
/Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.0.1/lib/active_record/connection_adapters/mysql/database_statements.rb:21:in block in select_rows' /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.0.1/lib/active_record/connection_adapters/mysql/database_statements.rb:21:in to_a'
/Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rack-mini-profiler-1.0.0/lib/patches/db/mysql2.rb:8:in each' /Users/jeffgoodall/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rack-mini-profiler-1.0.0/lib/patches/db/mysql2.rb:8:in each'

-- Machine register context ------------------------------------------------
rax: 0x00000000811c9dc5 rbx: 0x00007ffee0616244 rcx: 0x000000010f880100
rdx: 0x00007ffee06161b8 rdi: 0x0000000000019f01 rsi: 0x0000000000019f01
rbp: 0x00007ffee0616140 rsp: 0x00007ffee0616140 r8: 0x0000000000000006
r9: 0x00007ff80bc0bbf0 r10: 0x00007ff81031c6f0 r11: 0x000000010f64fc00
r12: 0x00007ff813a04908 r13: 0x00007ff80bc0df00 r14: 0x00007ffee06161b8
r15: 0x0000000000000000 rip: 0x000000010f764769 rfl: 0x0000000000010246

-- C level backtrace information -------------------------------------------
0 ruby 0x000000010f7eb5a8 rb_vm_bugreport + 136
1 ruby 0x000000010f661cc3 rb_bug_context + 467
2 ruby 0x000000010f758e21 sigsegv + 81
3 libsystem_platform.dylib 0x00007fff6e1d7b3d sigtramp + 29
4 ruby 0x000000010f764769 strcasehash + 9
5 ruby 0x000000010f761417 st_lookup + 39
6 ruby 0x000000010f64fc3a rb_enc_find_index + 58
7 mysql2.bundle 0x00000001100ad3ae rb_mysql_result_fetch_row + 1502
8 mysql2.bundle 0x00000001100adb2d rb_mysql_result_each
+ 461
9 mysql2.bundle 0x00000001100ac011 rb_mysql_result_each + 833
10 ruby 0x000000010f7de0d3 vm_call_cfunc + 307
11 ruby 0x000000010f7c4ed4 vm_exec_core + 10580
12 ruby 0x000000010f7d87b8 vm_exec + 184
13 ruby 0x000000010f7d3157 rb_call + 247
14 ruby 0x000000010f7d3f1e rb_iterate0 + 206
15 ruby 0x000000010f7d400c rb_block_call + 76
16 ruby 0x000000010f654f59 enum_to_a + 57
17 ruby 0x000000010f7de0d3 vm_call_cfunc + 307
18 ruby 0x000000010f7c598e vm_exec_core + 13326
19 ruby 0x000000010f7d87b8 vm_exec + 184
20 ruby 0x000000010f7e67aa invoke_block_from_c_bh + 378
21 ruby 0x000000010f7d39ce rb_yield + 158
22 ruby 0x000000010f6d3e2e rb_obj_tap + 14
23 ruby 0x000000010f7de0d3 vm_call_cfunc + 307
24 ruby 0x000000010f7c4ed4 vm_exec_core + 10580
25 ruby 0x000000010f7d87b8 vm_exec + 184
26 ruby 0x000000010f7d09e5 rb_funcallv + 245
27 ruby 0x000000010f6d4579 rb_class_s_new + 41
28 ruby 0x000000010f7de0d3 vm_call_cfunc + 307
29 ruby 0x000000010f7c598e vm_exec_core + 13326
30 ruby 0x000000010f7d87b8 vm_exec + 184
31 ruby 0x000000010f7d728a vm_invoke_proc + 362
32 ruby 0x000000010f7df64f vm_call_opt_call + 159
33 ruby 0x000000010f7c598e vm_exec_core + 13326
34 ruby 0x000000010f7d87b8 vm_exec + 184
35 ruby 0x000000010f7e67aa invoke_block_from_c_bh + 378
36 ruby 0x000000010f7d39ce rb_yield + 158
37 ruby 0x000000010f5ea329 rb_ary_each + 57
38 ruby 0x000000010f7de0d3 vm_call_cfunc + 307
39 ruby 0x000000010f7c4ed4 vm_exec_core + 10580
40 ruby 0x000000010f7d87b8 vm_exec + 184
41 ruby 0x000000010f7e67aa invoke_block_from_c_bh + 378
42 ruby 0x000000010f7d39ce rb_yield + 158
43 ruby 0x000000010f5ea329 rb_ary_each + 57
44 ruby 0x000000010f7de0d3 vm_call_cfunc + 307
45 ruby 0x000000010f7c4ed4 vm_exec_core + 10580
46 ruby 0x000000010f7d87b8 vm_exec + 184
47 ruby 0x000000010f6b3694 rb_load_internal0 + 340
48 ruby 0x000000010f6b3f3c rb_require_internal + 1724
49 ruby 0x000000010f6b3728 rb_f_require + 24
50 ruby 0x000000010f7de0d3 vm_call_cfunc + 307
51 ruby 0x000000010f7c598e vm_exec_core + 13326
52 ruby 0x000000010f7d87b8 vm_exec + 184
53 ruby 0x000000010f66bc9f ruby_exec_internal + 175
54 ruby 0x000000010f66bb98 ruby_run_node + 56
55 ruby 0x000000010f5e756f main + 79

@sodabrew
Copy link
Collaborator

With Rails 5.0.7 you should be able to use mysql2 0.5.x as documented here:
https://github.com/brianmario/mysql2#compatibility

This error shouldn't occur with AR 5.0.7+ double check that you're up to date?

Gem::LoadError: can't activate mysql2 (< 0.5, >= 0.3.18), already activated mysql2-0.5.2. Make sure all dependencies are added to Gemfile.

@nurali-techie
Copy link

I am also facing same issue Segmentation fault with ruby 2.3.0 rails 5.1.5 and mysql2 0.4.10 [Fedora 29 (Workstation Edition)] from 26-apr-2019. The same setup was working before, so I have no idea what made to start this issue on my system.

@sodabrew I have tried with mysql2 0.5.2 with rails 5.1.5 but still same issue.

Any other alternative available ??
Anyone knows what's the root cause of this issue ??

@Egrifo
Copy link

Egrifo commented May 8, 2019

I am having the same issue. When i tried updating to 0.5, i get this error:

Gem::LoadError: Specified 'mysql2' for database adapter, but the gem is not loaded. Add gem 'mysql2' to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).

Gem::LoadError: can't activate mysql2 (< 0.5, >= 0.3.18), already activated mysql2-0.5.2. Make sure all dependencies are added to Gemfile.

Do you know which version of active record uses 0.5.x? Or is there a workaround for this so that I don't have to upgrade rails/active record. I can also provide the crash report if that is helpful for this bug.

Hi jgoodall628,

did you try to force your RoR development environment to use the DBMS that you want (preconfigure)?
Try this command when you start the new application

rails new_app -d mysql

@wdeviers
Copy link

wdeviers commented May 29, 2019

I noticed this problem today when attempting to build the gem against libperconaserverclient20 on Ubuntu 18.04. Deleting the gem and replacing libperconaserverclient20 with libmysqlclient20 fixed my segfault problem.

Note that in both cases it compiles correctly, but it segfaults trying to use the gem when compiled against libperconaserverclient20. This is against ruby 2.5.1p57, the embedded version that ships with Chef 14.3.

ii  libperconaserverclient20-dev    5.7.22-22-1.bionic                          amd64        Percona Server database development files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants