# Ruby C extension returns report\_on\_exception is true

**URL:** <https://www.ruby-forum.com/t/ruby-c-extension-returns-report-on-exception-is-true/253682>\
**Category:** Uncategorized\
**Created:** [January 29, 2020, 7:15am UTC](https://www.ruby-forum.com/t/ruby-c-extension-returns-report-on-exception-is-true/253682 "2020-01-29T07:15:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![akhilravuri1](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@akhilravuri1](https://www.ruby-forum.com/u/akhilravuri1)\
**Post date:** [January 29, 2020, 7:15am UTC](https://www.ruby-forum.com/t/ruby-c-extension-returns-report-on-exception-is-true/253682/1 "2020-01-29T07:15:09Z")

</div>

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.

```auto
#<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:-

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

---

<div class="post-metadata">

**Author:** ![akhilravuri1](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@akhilravuri1](https://www.ruby-forum.com/u/akhilravuri1)\
**Post date:** [February 3, 2020, 11:13am UTC](https://www.ruby-forum.com/t/ruby-c-extension-returns-report-on-exception-is-true/253682/2 "2020-02-03T11:13:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![SouravGoswami](https://www.ruby-forum.com/user_avatar/www.ruby-forum.com/souravgoswami/32/2543_2.png) [@SouravGoswami](https://www.ruby-forum.com/u/SouravGoswami)\
**Post date:** [February 4, 2020, 3:54am UTC](https://www.ruby-forum.com/t/ruby-c-extension-returns-report-on-exception-is-true/253682/3 "2020-02-04T03:54:24Z")

</div>

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

> **[GitHub - ibmdb/ruby-ibmdb: Rails Adapter/Ruby driver for IBM DB2 and IBM...](https://github.com/ibmdb/ruby-ibmdb)**
>
> Rails Adapter/Ruby driver for IBM DB2 and IBM Informix - GitHub - ibmdb/ruby-ibmdb: Rails Adapter/Ruby driver for IBM DB2 and IBM Informix

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

> <https://github.com/ibmdb/ruby-ibmdb/issues/77>
>
> I'm not sure if this is an \`ibm\_db\` or a Ruby issue, but I'm seeing a lot of cra…shes from a Rails 4.2.10 + Ruby 2.4.4 + ibm\_db 3.0.5 app. From #76 I understand that ibm\_db does not yet support Ruby 2.4.x. Here's a stack dump: https://gist.github.com/leonsp/6be58208d76c95b508858d9e0ea1d57c

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.

---

<div class="post-metadata">

**Author:** ![akhilravuri1](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@akhilravuri1](https://www.ruby-forum.com/u/akhilravuri1)\
**Post date:** [February 4, 2020, 5:47am UTC](https://www.ruby-forum.com/t/ruby-c-extension-returns-report-on-exception-is-true/253682/4 "2020-02-04T05:47:39Z")

</div>

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.
