I was trying to import server_info api in the ibm_db extension. It worked well in windows but in Linux, it returns thread 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
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)
It works fine in windows but not on linux.
In linux if I add sleep after connect it will work fine.
why was wrong in that ruby gem?
code where it connects to c extension is in this link… https://github.com/ibmdb/ruby-ibmdb/blob/master/IBM_DB_Adapter/ibm_db/ext/ibm_db.c#L688