DBD::Informix & $SIG{ALRM} & /etc/services

Weird. My alarm(2) takes 14 seconds? Is DBD::Informix or something else
overriding my $SIG{ALRM}?

If I substitute the connect() call with a sleep 10, then my alarm(2)
takes 2 seconds, as I expected. :)

Thanks,

j



$ cat j.t
use strict;
use DBI;
my $dbh;
eval {
local $SIG{ALRM} =3D sub { die "timeout\n" };
alarm(2); # seconds before time out
$dbh =3D DBI->connect('dbi:Informix:omni [at] drprod_tcp');
alarm(0); # cancel alarm (if connect worked fast)
};
alarm(0); # cancel alarm (if eval failed)
chomp $ [at] ;
print "[$ [at] ][$DBI::err][$DBI::errstr]\n";

$ time perl j.t
[timeout][-931][SQL: -931: Cannot locate drprod_tcp service/tcp service
in /etc/services.]

real 0m14.320s
user 0m0.319s
sys 0m0.044s



$ perl -MDBI -e 'DBI->installed_versions'
Perl : 5.008004 (i686-linux)
OS : linux (2.6.4-52-smp)
DBI : 1.46
DBD::Sybase : 1.04
DBD::Sponge : 11.10
DBD::Proxy : install_driver(Proxy) failed: Can't locate
RPC/PlClient.pm in [at] INC
DBD::Informix : 2003.04
DBD::File : 0.31
DBD::ExampleP : 11.12
DBD::DBM : 0.02
jhannah [ Fr, 03 November 2006 21:37 ] [ ID #1523851 ]

RE: DBD::Informix & $SIG{ALRM} & /etc/services

Oops. I noticed my versions were behind. I upgraded DBI and
DBD::Informix.

I'm still getting the same behavior (14.3 seconds to time out), so I'm
still curious about what might be going on.

Thanks,

j



$ perl -MDBI -e'DBI->installed_versions'
Perl : 5.008004 (i686-linux)
OS : linux (2.6.4-52-smp)
DBI : 1.53
DBD::Sybase : 1.04
DBD::Sponge : 11.10
DBD::Proxy : install_driver(Proxy) failed: Can't locate
RPC/PlClient.pm in [at] INC
DBD::Informix : 2005.02
DBD::File : 0.35
DBD::ExampleP : 11.12
DBD::DBM : 0.03
jhannah [ Fr, 03 November 2006 21:51 ] [ ID #1523852 ]

Re: DBD::Informix & $SIG{ALRM} & /etc/services

------=_Part_53632_13899581.1162592997686
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On 11/3/06, Jay Hannah <jhannah [at] omnihotels.com> wrote:

> Oops. I noticed my versions were behind. I upgraded DBI and DBD::Informix.
>
> I'm still getting the same behavior (14.3 seconds to time out), so I'm
> still curious about what might be going on.


CSDK probably uses alarm itself - for connection timeouts, no less - so
your attempt to use alarm at the same time is likely to cause confusion
somewhere.

You could probably track this with the equivalent of truss (strace on
Linux?), looking for alarm system calls in the output. You'd probably be
able to identify your own alarm(2) call; you might have to work harder to
identify which other alarm() calls are made before you see SIGALRM fire.

Interestingly, the manual page for the system call is usually designated
alarm(2) as well as you using an alarm function call with the argument value
2.

$ perl -MDBI -e'DBI->installed_versions'
> Perl : 5.008004 (i686-linux)
> OS : linux (2.6.4-52-smp)
> DBI : 1.53
> DBD::Sybase : 1.04
> DBD::Sponge : 11.10
> DBD::Proxy : install_driver(Proxy) failed: Can't locate
> RPC/PlClient.pm in [at] INC
> DBD::Informix : 2005.02
> DBD::File : 0.35
> DBD::ExampleP : 11.12
> DBD::DBM : 0.03
>
>


--
Jonathan Leffler <jonathan.leffler [at] gmail.com> #include <disclaimer.h>
Guardian of DBD::Informix - v2005.02 - http://dbi.perl.org
"I don't suffer from insanity - I enjoy every minute of it."

------=_Part_53632_13899581.1162592997686--
jonathan.leffler [ Fr, 03 November 2006 23:29 ] [ ID #1523853 ]

Re: DBD::Informix

On 24 Aug 2007 16:04:06 +0200, Piotr Poloczek <poloczekp [at] interia.pl> wrote:
> Hello!
>
> I have problem with compiling DBD::Informix.
> Could anybody help me ?

Note the part of the diagnostic output that says:

===QUOTE===
Using INFORMIXDIR=/u/informix and ESQL/C compiler esql
Using INFORMIX-ESQL Version 7.24.UC7 from /u/informix

Your version of ESQL/C is crippled and will not link with shared
libraries even if you tell the script to use them (PTS Bug
102265). We are going to make a hacked copy of the script and
use that.

If the hacked ESQL/C script does not work, then you will probably
have to make a static version of Perl with DBD::Informix and the
ESQL/C. Read the Notes/static.build file for more information.

Or (a much better idea) upgrade to Client SDK 2.40 or later!
===EOQ===

Really and truly, with IDS 7.31, you should be using a CSDK from the
21st century, rather than ESQL/C 7.24 which dates back a decade or so.

The following message in the build information indicates a bug in esqlcc:

Testing whether your Informix test environment will work...
Argument "yes" isn't numeric in numeric gt (>) at esqlcc line 102.
esqlcc: Num args = 27

I'll get that fixed - but it won't be doing much harm either. (A
workaround is to set DBD_INFORMIX_DEBUG_ESQLCC=1 instead of 'yes'.)

The real immediate problem is:
esqlc: "dbdimp.ec", line 1328: Error -33200: Invalid statement on
symbol 'ifx_int8_t'.
esqlc: "dbdimp.ec", line 2202: Error -33200: Invalid statement on
symbol 'ifx_int8_t'.
2 error(s) found
make: *** [dbdimp.o] Error 1

That's another bug - the ESQL/C 7.2x compiler should not be seeing
ifx_int8_t because that is only supported by CSDK versions of ESQL/C.

OK - it will take time to get a fixed release of DBD::Informix out -
I've been working on and off on it for several months, and I'm having
some problems.

So, you need a workaround. The simplest from my perspective would be
if you upgrade to CSDK 2.90 or thereabouts (which would give you
ESQL/C 2.90, which really is newer than ESQL/C 7.24 and 9.52 -- I
didn't get a say in the version numbering!).

Failing that:
Line 1324 of dbdimp.ec says "#ifdef SQLINT8"
change it to read "$ifdef POLLYWOGS_ARE_WONDERFUL;",
and the matching "#else" to "$else;" and the matching "#endif" to
"$endif;", noting carefully the new semi-colons that are mandatory.

Line 2202 is in the middle of a #if 0 / #endif section - but it is the
ESQL/C compiler that is complaining, not the C compiler. The best
thing to do, then, is delete the whole block of code - lines 2192 to
2211. If you prefer to leave it there, then you'll have to embed it
in comments, but there are already comments in that section, so it
ain't trivial. Alternatively, wrap the #if 0 / #endif section in
"$ifdef POLLYWOGS_ARE_STUPENDOUS;" and "$endif;" as above.

With luck, those two changes will get you on to the next hurdle.

--
Jonathan Leffler <jonathan.leffler [at] gmail.com> #include <disclaimer.h>
Guardian of DBD::Informix - v2007.0226 - http://dbi.perl.org
"Blessed are we who can laugh at ourselves, for we shall never cease
to be amused."
jonathan.leffler [ Fr, 24 August 2007 18:55 ] [ ID #1804517 ]

Re: DBD::Informix

Piotr

Download the source
http://www.perl.com/download.csp#sourcecode

perl Makefile.PL
make clean
make make install

dziekuje!
Martin
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed. If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy. Thank you.

----- Original Message -----
From: "Piotr Poloczek" <poloczekp [at] interia.pl>
To: <dbi-users [at] perl.org>
Cc: <dbd.informix [at] gmail.com>
Sent: Friday, August 24, 2007 10:04 AM
Subject: DBD::Informix


> Hello!
>
> I have problem with compiling DBD::Informix.
> Could anybody help me ?
>
> Piotr Poloczek
>
> ------------------------------------------------------------ ----------
> Mobilne wiadomości w Twojej komórce
>
>>>> http://link.interia.pl/f1b71
>
mgainty [ Sa, 25 August 2007 03:44 ] [ ID #1805326 ]
Perl » perl.dbi.users » DBD::Informix & $SIG{ALRM} & /etc/services

Vorheriges Thema: 11i is out...
Nächstes Thema: Kumar Sundaram is out of the office.