Project

General

Profile

Actions

Bug #19524

closed

Garbage Collector is not working as expected.

Added by hjimenez89rb (Hugo Alberto Jiménez Santos) over 2 years ago. Updated over 2 years ago.

Status:
Third Party's Issue
Assignee:
-
Target version:
-
[ruby-core:112794]

Description

We are currently developing a Ruby based web application which connects to a DB2 Database . WE have been using ibm_db-5.4.0 to establish a connection. We are currently following the IBM and Ruby documentation but the application crashes by garbage collector Ruby error.

We have checked the issue with IBM_team to make sure that It was not a IBM_GEM problem but as a result of their tests, IBM_GEM is working in different cases but for us we face up with those errors even with those versions (2.7.6, 3.1.2, 3.2.1):

*/usr/local/rvm/gems/ruby-3.2.1/gems/ibm_db-5.4.0/lib/active_record/connection_adapters/ibm_db_adapter.rb:3104: warning: undefining the allocator of T_DATA class IBM_DB::Statement
/usr/local/rvm/rubies/ruby-3.2.1/lib/ruby/3.2.0/rubygems/specification.rb:1048: [BUG] object allocation during garbage collection phase

*0x0/usr/local/rvm/gems/ruby-3.1.2/gems/ibm_db-5.4.0/lib/active_record/connection_adapters/ibm_db_adapter.rb:760: [BUG] object allocation during garbage collection phase
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]

*Exception occurred on Step thread ID #SID:34117;RSEQ:911723; wrong instance allocation; backtrace: /usr/local/rvm/gems/ruby-3.1.2/gems/ibm_db-5.4.0/lib/active_record/connection_adapters/ibm_db_adapter.rb:760:in server_info' (RuntimeError) /usr/local/rvm/gems/ruby-3.1.2/gems/ibm_db-5.4.0/lib/active_record/connection_adapters/ibm_db_adapter.rb:760:in initialize'.

(all trace is attached in this ticket)

OS
name: "CentOS"
version: "8"
architecture: "x86_64"

rvm:
version: "1.29.12 (latest)"

As an extra error, we're not sure if
Warning! PATH is not properly set up, /usr/local/rvm/gems/ruby-3.2.1/bin is not at first place.
Usually this is caused by shell initialization files. Search for PATH=... entries.
You can also re-add RVM to your profile by running: rvm get stable --auto-dotfiles
To fix it temporarily in this shell session run: rvm use ruby-3.2.1
To ignore this error add rvm_silence_path_mismatch_check_flag=1 to your ~/.rvmrc file.

Garbage collector leack test this code we have been running manually garbage collector, if you can see in this example:T_STRING. is not deceasing the stings in live memory, Even executig GC manualy. (log is attached)

GC.disable # Only run GC when manually called

an_array = []

loop do
1000.times { an_array << "A" + "B" + "C" }
puts "Array is #{an_array.size} items long"

GC.start # Run a major GC - use full_mark: false for minor GC
pp ObjectSpace.count_objects

sleep 1
end


Files

LOGS3.txt (12.5 KB) LOGS3.txt hjimenez89rb (Hugo Alberto Jiménez Santos), 03/09/2023 05:03 PM
LOGS4.txt (127 KB) LOGS4.txt hjimenez89rb (Hugo Alberto Jiménez Santos), 03/09/2023 05:03 PM
LOGS2.txt (9.62 KB) LOGS2.txt hjimenez89rb (Hugo Alberto Jiménez Santos), 03/09/2023 05:03 PM
LOGS1.txt (123 KB) LOGS1.txt hjimenez89rb (Hugo Alberto Jiménez Santos), 03/09/2023 05:03 PM
leacky.txt (3.64 KB) leacky.txt Garbage collector leack test hjimenez89rb (Hugo Alberto Jiménez Santos), 03/09/2023 05:38 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0