Bug #17382

Segfault in String#inspect

Added by lionelperrin (Lionel Perrin) 3 months ago. Updated 3 months ago.

Target version:
ruby -v:
ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]



We experienced a segfault in our application. It seems that it happened right after we've upgraded from ruby 2.6 to ruby 2.7.2.
The faulting ruby code is actionpack-

info "  Parameters: #{params.inspect}" unless params.empty?

However, the problem seems to be due to string.c:10702

Here is an extract of the output from ruby (full output attached):

-- Control frame information -----------------------------------------------
c:0073 p:---- s:0500 e:000499 CFUNC  :inspect
c:0072 p:---- s:0497 e:000496 CFUNC  :inspect
c:0071 p:0137 s:0493 e:000490 METHOD /usr/app/rubygems/ruby/2.7.0/gems/actionpack-
c:0070 p:0038 s:0483 e:000482 METHOD /usr/app/rubygems/ruby/2.7.0/gems/activesupport-
-- Ruby level backtrace information ----------------------------------------
/usr/app/rubygems/ruby/2.7.0/gems/puma-5.0.4/lib/puma/thread_pool.rb:145:in `block in spawn_thread'
/usr/app/rubygems/ruby/2.7.0/gems/puma-5.0.4/lib/puma/server.rb:430:in `process_client'
/usr/app/rubygems/ruby/2.7.0/gems/puma-5.0.4/lib/puma/request.rb:75:in `handle_request'
-- Machine register context ------------------------------------------------
 RIP: 0x00007fd7ab8b0f5c RBP: 0x00007fd7844b92c8 RSP: 0x00007fd7a4af7fe0
 RAX: 0x00005597fb1672c0 RBX: 0x0000000000000000 RCX: 0x00007fd7ab8b1060
 RDX: 0x0000000000000000 RDI: 0x0000000000000000 RSI: 0x0000000000000000
  R8: 0x00007fd7a4bf8d50  R9: 0x00005597ffce6378 R10: 0x0000000055550083
 R11: 0x0000000000000000 R12: 0x0000000000000000 R13: 0x00005597fb1b0038
 R14: 0x00005597fb1672c0 R15: 0x0000000000000000 EFL: 0x0000000000010206
-- C level backtrace information -------------------------------------------
/usr/local/lib/ [0x7fd7ab9176f5] vm_dump.c:755
/usr/local/lib/ [0x7fd7ab88311b] signal.c:946
/lib/x86_64-linux-gnu/ [0x7fd7ab45f730]
/usr/local/lib/ [0x7fd7ab8b0f5c] string.c:10702
/usr/local/lib/ [0x7fd7ab8b107a] string.c:10761
/usr/local/lib/ [0x7fd7ab90bb68] vm_eval.c:1013


ruby_segfault_log.txt (86.2 KB) ruby_segfault_log.txt lionelperrin (Lionel Perrin), 12/09/2020 03:32 PM

Related issues

Related to Ruby master - Bug #17289: Time#strftime occurs Segmentation Fault on ruby-2.7.2p137Assignedshyouhei (Shyouhei Urabe)Actions
Related to Ruby master - Bug #17362: Thread core dumpFeedbackActions

Updated by mame (Yusuke Endoh) 3 months ago

Thank you for the report. I think that this is the same issue as #17289 and #17362. Unfortunately, the core team has no reproducible code, so we haven't investigated the issue yet. Can you provide your code, or at least, the core dump file?


Updated by mame (Yusuke Endoh) 3 months ago

  • Related to Bug #17289: Time#strftime occurs Segmentation Fault on ruby-2.7.2p137 added

Updated by mame (Yusuke Endoh) 3 months ago

Also available in: Atom PDF