Bug #12305

"can't remove str from str_id" at unregister_sym

Added by ks (Konstantin Starodubtsev) almost 4 years ago. Updated 6 months ago.

Target version:
ruby -v:
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]


I'm experiencing random occurrences of "can't remove str from str_id" crash.

Message string looks like this one:

/srv/sim/.rvm/gems/ruby-2.3.0@env-manager/gems/mongo-2.2.4/lib/mongo/server/description.rb:508: [BUG] 0x007f4f400ab310 can't remove str from str_id (`..dO.)

The only constant thing in it is the "can't remove str from str_id" substring. Other things like address, source code location or symbol string value in brackets differ between crash reports (see attachments).

In a C level backtrace information the only common part is top of a trace:

-- C level backtrace information -------------------------------------------
/srv/sim/.rvm/rubies/ruby-2.3.0/lib/ [0x7f4f8b0106ff] vm_dump.c:688
/srv/sim/.rvm/rubies/ruby-2.3.0/lib/ [0x7f4f8ae9a01f] error.c:420
/srv/sim/.rvm/rubies/ruby-2.3.0/lib/ [0x7f4f8ae4aada] symbol.c:399
/srv/sim/.rvm/rubies/ruby-2.3.0/lib/ [0x7f4f8afa56a2] symbol.c:637
/srv/sim/.rvm/rubies/ruby-2.3.0/lib/ [0x7f4f8aec0d01] gc.c:2211
/srv/sim/.rvm/rubies/ruby-2.3.0/lib/ [0x7f4f8ae498c3] gc.c:3624
/srv/sim/.rvm/rubies/ruby-2.3.0/lib/ [0x7f4f8aec43d4] gc.c:1679

We hit this bug at least once per day, so should you need any other information, let me know.

Attached are three full [BUG] reports for three different occurrences.


report-01.log (247 KB) report-01.log ks (Konstantin Starodubtsev), 04/20/2016 08:18 PM
report-03.log (251 KB) report-03.log ks (Konstantin Starodubtsev), 04/20/2016 08:18 PM
report-02.log (266 KB) report-02.log ks (Konstantin Starodubtsev), 04/20/2016 08:18 PM


Updated by ks (Konstantin Starodubtsev) almost 4 years ago

  • Assignee set to ruby-core

Updated by nobu (Nobuyoshi Nakada) almost 4 years ago

  • Description updated (diff)
  • Status changed from Open to Feedback

How to reproduce it?
Couldn't you show simplified/reduced script?

Updated by ks (Konstantin Starodubtsev) almost 4 years ago

Nobuyoshi Nakada wrote:

How to reproduce it?
Couldn't you show simplified/reduced script?

This is a web application running on top of padrino framework and it's using various gems to consume and process data from external systems.
Unfortunately, this bug happens only once or twice per day, and I couldn't find any pattern in bug occurrence. It may happen during virtually any user request. I couldn't reproduce bug on a test dataset, but it happens on a different hosts when running in production.

If you could point me to some information about how to pull more debug information from runtime, or increase probability of this bug to happen, or whatever else, I could try it and then attempt to make a script to reproduce the problem.


Updated by shevegen (Robert A. Heiler) almost 4 years ago

I think it is difficult to track it down if it only appears sometimes.

Perhaps you find some way to trigger it more often - if you don't see a pattern in the bug occurrence,
perhaps you can find a pattern in the ruby code that triggers it ultimately.

The C code for the bug should be here in the function unregister_sym():

I am not sure who or what tries to unregister a symbol but I think you will
find some patterns in the coming days/weeks. Heisenbugs sometimes require
detective work.


Updated by naruse (Yui NARUSE) over 3 years ago

  • Assignee deleted (ruby-core)

Updated by eramsey (Eric Ramsey) over 1 year ago

Was there any resolution to this issue? We are encountering the same issue now that we have upgraded our Ruby from 2.1.6 to 2.3.3. This happens randomly throughout our framework when we are trying to run regression.

Any and all information as to where to look and or how to fix would be greatly appreciated.


Updated by jeremyevans0 (Jeremy Evans) 6 months ago

  • Status changed from Feedback to Closed

Also available in: Atom PDF