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 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

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)

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

Thanks,
Akhil

SketchUp does not run under Linux, and only Win and MacOS editions of the SDK are distributed.

Does this have anything to do with the SketchUp embedded Ruby API or the SketchUp C API ?

sorry it is not related to sketchup. I couldn’t find any active members in any other forms for ruby so I posted it here.

1 Like

I’d give stack overflow a try :wink:

I have already tried stack overflow.

Well the newer Ruby forum is here …

… it imported all the topic threads from the old defunct forum.


The main problem with posting here is that Ruby threads do no work well inside the embedded Ruby that SketchUp uses. So there may not be many who could answer your questions here.

Maybe @Aerilius ?

When you post in a Windows-only software forum about running on Linux, the general assumption is that you run the software through Wine. Are you running the Ruby code using the Windows Ruby interpreter through Wine, or using the Linux Ruby interpreter?

Threading on Windows works very differently from Unix-like systems (where Ruby originates from). There have been reoccuring threading problems with Ruby when you emulate Windows threads with Unix threads. If you are using Wine, I’d test on the latest development version (e.g. 5.21) and then go to the Wine forum or mailing list and post the Wine debug/error (not only the Ruby exception above).

If it is natively on Linux, then – as others said – the SketchUp forum is not an appropriate place, rather stackoverflow or the official Ruby mailing list or IBM support. After all it’s their problem and one of their most widely used platforms.
Maybe you could reformulate your problem to get more attention and to make it easier to help. The error is not “report_on_exception is true” (that just means that the child thread should not just silently die but raise the same exception in the main thread). The title should rather be something like “IBM_DB.server_info causes SystemStackError”.

1 Like