Ruby C extension returns report_on_exception is true

I was trying to import server_info api in the ibm_db extension. It worked well in windows but in Linux, it returns tread sleep error.

#<Thread:0x000055c9febc5ca0 sleep> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
stack level too deep (SystemStackError)
^C*** stack smashing detected ***: <unknown> terminated

code:-

require 'ibm_db'
conn = IBM_DB.connect('DATABASE=;HOSTNAME=localhost;PORT=50000;PROTOCOL=TCPIP;UID=;PWD=','','')
puts 'this is ibm_db'
#Thread.report_on_exception = false
puts 'this is begin'
puts IBM_DB
serverinfo = IBM_DB::server_info( conn )
puts serverinfo.DBMS_NAME[0,100]
puts IBM_DB.close(conn)

why the same code returns the error in Linux but woe=rks well in windows.

When I run the code in debug mode it does not produce any error only in normal mode it produces an error.

Thanks, Akhil

when I add a sleep of 3 sec after connect it does not throw this error. But how to solve this from code instead of sleep.

Looks like ibm_db isn’t maintained for a long time (2 years!)… And also they require you to have the old interpreter Ruby 2.2.6 which is way different than what we have today (Ruby 2.7).

There is an opened issue regarding the crash while using Ruby 2.4.4+

I have no idea about IBM_DB so I can suggest you to do one of the 3 things (they might not work for sure):

  • Installing Ruby 2.2.6 and Rails 5.0.7 using RVM.
  • Using any other alternatives to IBM_DB.
  • Report a bug on Github and wait until they fix the issue.

I am trying to fix it. I have fixed many things and now it works for ruby 2.6.5 and rails 6.01 but the only thing is when I use server info api it crashes.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs