Please ask the gem author about what version of ruby he used to create the 1.9 version of the extension.
Most likely was created incorrectly and is failing against ruby 1.9.3
I have no experience with IBM db2 so can't be much help. Perhaps you can tell the gem author post here if he has further questions.
Sorry for top posting. Sent from mobile.
--
You received this message because you are subscribed to the Google Groups "RubyInstaller" group.
To post to this group, send email to rubyin...@googlegroups.com.
To unsubscribe from this group, send email to rubyinstalle...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyinstaller?hl=en.
OK, where is the source code to clone/checkout and compile locally?
> I have tried building the gem on Ruby-1.9.3 itself and installing the
> same. I am still getting the error. Was not sure what could be going
> wrong, hence made a post.
>
Perhaps the error is due something you're doing in the code. You
mention it works with 1.9.2 but not 1.9.3, so perhaps is something
differently.
If it is segfaulting when doing the require, we need to know what
you're doing in "Init_*" function.
> Am not sure where is it going wrong. Any clues that will guide in the
> right direction will be helpful.
>
Please provide links to the source and any documentation that can help
us compile and help debug the issue.
--
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry
Try accessing the ibm_db driver from irb, as below
irb> require 'ibm_db.so'
dln_load is Dynamic Library loading support of Ruby, which wraps dln
(POSIX) or LoadLibrary.
Re: API, there has been no change in the exposed API between 1.9.2 and
1.9.3, it only added exposed functions.
Re: symbols exposed in 1.9.2 compilation: that was because all the
symbols were exported, in 1.9.3 that got fixed and only Init_* is
exported.
I didn't have time to check this out, will do over the weekend as I'm
still playing catch up game with my work (was out ill for the past few
days)
Sorry Praveen,
RubyInstaller is a project I work on for free and don't get paid for
anything associated with it.
Right now can't spare time on OSS as work load has been a bit higher than usual
I expect have time available next week to look into.
Which one I'm supposed to check out?
IBM_DB_Adapter or IBM_DB_Driver?
IBM DB2 Client driver depends on MSVCR80.dll, not MSVCRT.dll
>
> irb> require 'ibm_db.so'
>
running this trough GDB shows that is failing in dln.c:1221:
https://gist.github.com/2915af2b99fd82934264
And from the source:
1216 PIMAGE_THUNK_DATA piat = (PIMAGE_THUNK_DATA)((char
*)ext + desc->FirstThunk);
1217 while (piat->u1.Function) {
1218 PIMAGE_IMPORT_BY_NAME pii =
(PIMAGE_IMPORT_BY_NAME)((char *)ext + (size_t)pint->u1.AddressOfData);
1219 static const char prefix[] = "rb_";
1220 const char *name = (const char *)pii->Name;
1221 if (strncmp(name, prefix, sizeof(prefix) - 1) == 0) {
1222 FARPROC addr = GetProcAddress(mine, name);
1223 if (addr) return (FARPROC)piat->u1.Function == addr;
1224 }
1225 piat++;
It is clear that is failing in strncmp.
Ruby depends on MSVCRT.dll which defines strncmp, but MSVCR80.dll does
it also and is loaded by ibm_db.so, because it depends on db2cli.dll,
which is build and linked against MSVCR80.dll
AFAIK, that will be the reason.
Please see with IBM if there is an alternate driver for DB2 that is
built against MSVCRT.dll instead.
Sorry for not being more helpful or solve this issue.
Is worth to mention that this do not fail against 1.9.2 (either
building or running) but dln_load mechanism on Ruby 1.9.2 differs from
Ruby 1.9.3 and highly unlikely is going to change.
That is mostly incorrect. MSVCR80/90 and 100 require separate
installation as is not bundled with the OS. The license in which these
DLLs are distributed forbids you to bundle it along certain type of
software and you can't automate the installation of those libraries
(you need to use the exact package from MS, you can't ship the DLLs)
However, please see my thread on ruby-core:
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/44371
After thinking a bit harder on this I think the problem is not the CRT
dependency which is causing this but a failure to retrieve the proper
linking information.
And seems the bug just got fixed in trunk:
https://bugs.ruby-lang.org/issues/6303
Will request backport to ruby_1_9_3 branch
Hello Praveen,
I believe 1.9.3-p194 included the fix for this
Would you mind try it out and let us know?
Thank you!