Subject: [clisp-list] does the oracle module work in Solaris?

From: Carlos Ungil <[email-masked]>
Date: Wed Jul 7 03:40:19 2004

Hello,

I cannot get the oracle module to work in Solaris using clisp 2.33.2 
(in past releases I didn't manage to make it work neither).

The error message is not very helpful, and I cannot find in the 
documentation if I should expect it to work or not.

Any idea?

Regards,

Carlos

[1]> (oracle:connect *user* *pwd* *db*)
NIL
[2]> (oracle:run-sql "select count(*) from user_tables")
zsh: 21997 bus error (core dumped)  bin/clisp -K full

---

From: "John K. Hinsdale" <[email-masked]>
Date: Wed Jul 7 05:04:01 2004

> (in past releases I didn't manage to make it work neither).

Hi carlos ... well it has never been tested on Solaris.  But there's
not reason it should not work, but at the same also some possibility
that the Oracle module has a bug that triggers on Solaris but not
Linux (where I develped it).

 > zsh: 21997 bus error (core dumped)  bin/clisp -K full

As it happens I have access to a Solaris box w/ Oracle now, so I can
try to compile CLISP w/ Oracle on it and see what happens.  If I can
reproduce the bug I'll fix, else I may get back to you for a test
case.

BTW this would also be helpful:
	- Does it crash when you connect and do this query:
		"SELECT 'x' FROM dual"
	- output of "uname -a"
	- output of "sqlplus -v"
	- Oracle version of your server (what appears after
          "Connected to:" banner when you connect w/ SQL*Plus
	- what compiler (gcc or Sun's) you are using

---
John Hinsdale, Alma Mater Software, Inc., Tarrytown, NY 10591-3710 USA
[email-masked] | http://www.alma.com/staff/hin | +1 914 631 4690

---

From: Carlos Ungil <[email-masked]>
Date: Wed Jul 7 06:38:05 2004

Hello John,

I'm using the 8.1.7 libraries, and the database is
"Oracle8i Enterprise Edition Release 8.1.7.4.0" 

The machine where clisp is compiled (the database is elsewhere) is  
"SunOS 5.8 Generic_108528-22 sun4u sparc SUNW,Ultra-4"

I've compiled it with gcc, trying to do so with cc gives this error:

./lisp.run -B . -N locale -Efile UTF-8 -Eterminal UTF-8 -norc -m 750KW 
-x "(and (load \"init.lisp\") (sys::%saveinitmem) (ext::exit))"
(....clisp banner....)
*** - SVREF: index 29360132 for #(COMPILEDP NIL MY-OPEN NIL BAD NIL 
CHECK-COMPILED-FILE NIL NIL) is not of type `(INTEGER 0 (,ARRAY-DIMENSION-LIMIT))
Bye.

Thanks for your interest. I've already used your module in Linux, to 
create some reports, and now I would like to use it in cgi script in 
the Solaris box.

Regards,

Carlos

---

From: "John K. Hinsdale" <[email-masked]>
Date: Wed Jul 7 06:57:02 2004

> I've compiled it with gcc, trying to do so with cc gives this error:

i'm not surprised.  you should use gcc anyway; ;)
one more thing: what is output of gcc -v

My Solaris box has 2.95.2 and I'm not sure that will copmile CLISP
anymore (sam?) ... so if I'm going to get a new one I may as well
get the same one your'e using to debug this ..

---

---

From: Carlos Ungil <[email-masked]>
Date: Wed Jul 7 07:03:12 2004

Hello

> one more thing: what is output of gcc -v

gcc 3.3.2, but I have some other versions available if this helps.

Cheers,

Carlos

---

From: "John K. Hinsdale" <[email-masked]>
Date: Tue Jul 13 13:51:02 2004

> "SunOS 5.8 Generic_108528-22 sun4u sparc SUNW,Ultra-4"

Carlos, I've done some bug fixes for Oracle module that may or may not
help you get the error message that will tell you what it wrong w/
your CLISP oracle client under Solaris.  They'r checked into CVS so if
you are using a CVS working copy, just "cvs update" it, else you can
retrieve a snapshot of just the oracle module at

    http://clisp.alma.com/clisp-oracle-2004-07-13.tar.gz

and unpack it into your source directory (it will expand as
modules/oracle/*) and recompile CLISP.

The bug fixes concern errors that occur while setting up the Oracle
runtime environment, but as I recall your crash came after that, so
there may be some other problem.  I'm still trying to get to that
point w/ my copy CLISP under Solaris.  Will keep you posted.

---

---

From: Carlos Ungil <[email-masked]>
Date: Wed Jul 14 05:12:03 2004

Hello John,

On Tue, 13 Jul 2004, John K. Hinsdale wrote:
> your CLISP oracle client under Solaris.

Unfortunately my clisp crashes the same. I append at the end the stack 
trace in the core.

It's the first time I analyse a core, so it's not very meaningful to 
me, but I hope it's useful.

Carlos

=>[1] strcat(0x1eb100, 0xffd3e208, 0x0, 0x0, 0xffd3e208, 0x217e7c), at 
0xfe8cf21c
  [2] exec_sql(0x1e4288, 0xffbee208, 0xffbee22c, 0x0, 0xffbee2d0, 0xfe911a90), at 0x22478
  [3] __builtin_avcall(0xffbee270, 0x19efb1, 0x4, 0xffbee1f8, 0x4, 0xffbee2a8), at 0xf67cc
  [4] C_foreign_call_out(0x19efb1, 0x1a426c, 0x1a427c, 0x1, 0x4, 0x7), at 0xf2bec
  [5] funcall_subr(0x194062, 0x1a0800, 0x19cb1889, 0x1a2400, 0x19cb1820, 0x19cb1820), at 0x39340
  [6] interpret_bytecode_(0x19cb1889, 0x19cb1820, 0x19cb1832, 0x1a2400, 0x1a2400, 0xffbee8d8), at 0x3fb50
  [7] eval_closure(0x19cb1889, 0x666b6beb, 0x1a1d08, 0x1a1c00, 0x1940e9, 0x1a4254), at 0x36060
  [8] eval(0x666b6beb, 0x195000, 0x19c722a0, 0x19d378, 0x199c58, 0x199c74), at 0x346f0
  [9] C_read_eval_print(0x19c72359, 0x19c722a0, 0x19c722b2, 0x0, 0x390f0, 0xffbeea70), at 0xb6ca8
  [10] funcall_subr(0x18e382, 0x1a0800, 0x19cbb9f1, 0x1a2400, 0xc0, 0x19c77200), at 0x3904c
  [11] interpret_bytecode_(0x19cbb9f1, 0x19c77200, 0x21, 0x1a1d04, 0x39948, 0xffbeec78), at 0x3f9bc
  [12] funcall_closure(0x19cbb9f1, 0x0, 0x0, 0x19cbba30, 0x1a422c, 0xac000000), at 0x397f0
  [13] C_driver(0x3f8d4, 0x1a2400, 0x0, 0x19c771a8, 0x18e180, 0xffffffff), at 0x466c0
  [14] interpret_bytecode_(0x19c77281, 0x19c771a8, 0x19c771ba, 0x0, 0x39948, 0xffbeef18), at 0x3f924
  [15] funcall_closure(0x19c77281, 0x0, 0x19cb7009, 0x19bf88c8, 0xd8, 0x1a4210), at 0x397f0
  [16] interpret_bytecode_(0x19cb7009, 0x19bf88c8, 0x19bf88da, 0x0, 0x39948, 0xffbef0d8), at 0x3f5bc
  [17] funcall_closure(0x19cb7009, 0x0, 0x0, 0x0, 0x1a0800, 0x1a2400), at 0x397f0
  [18] driver(0x0, 0x2, 0x19bc0d89, 0x9, 0x18cc00, 0x0), at 0xb6f1c
  [19] main(0x1a4200, 0x40000, 0xffbef404, 0x1a1d04, 0x0, 0x0), at 0x2d514

---

From: "John K. Hinsdale" <[email-masked]>
Date: Wed Jul 14 05:55:33 2004

> Unfortunately my clisp crashes the same.

hi Carlos,
Yes, not surprised; I hadn't yet fixed the source of the problem, just
the bugs in the error messaging which were not the cause.

Today I've just checked in some fixes that, at least on my
installation and database, at last give me the first known working
Oracle-enabled CLISP under Solaris; most of my apps seems to work
fine.  There were bugs, present only on Solaris that had to do with
very obscure calling requirements of Oracle's OCI layer.

You can take these latest fixes and try them:
	http://clisp.alma.com/clisp-oracle-2004-07-14.tar.gz
and see what happens.  However ...

 > I append at the end the stack  trace in the core.

From your stack trace, I see you're probably experiencing yet a
different issue that what I just fixed; it would probably occur when
doing SELECTs with Oracle bind parameters of large size: my error
message buffer overflows (how emabarrasing).

What would be really helpful to me is for you to take my latest fix
above try just to do the simplest possible query, e.g.:

	SELECT 'x' AS mycol FROM dual

and see if you can at least get Oracle to execute and retrieve
something very trivial.

If it turns out that the trivial query works, but your "real" query is
triggering the error buffer issue I'm thinking it is, I can have a fix
for that soon, as I understand exactly what that problem is.

bug if you could try trival query that would be great as it would
eliminate most of the other theories.

Thanks for all your help!  All these bugs are in fact bugs under Linux
as well; they don't trigger due to diffs in Intel vs. Sparc I suspect.

---

---

From: "John K. Hinsdale" <[email-masked]>
Date: Wed Jul 14 06:50:58 2004

> message buffer overflows (how emabarrasing).

Assuming my theory is correct (& I was able to trigger bugs w/ big
bind parameter values on my own site) this should be fixed now in CVS,
too.  Huge param values will now get truncated for display (but it
will still tell you the overall length to deal with Oracle "too large
for column" errors.

Carlos, you can take it from
  http://clisp.alma.com/clisp-oracle-2004-07-14a.tar.gz
(note the "a").  This time I hope you will be happy.

I think at this point I can now say there is a reasonably tested
CLISP+Oracle running under Solaris, at least for Oracle 8.  That's
great, since Solaris is a major platform for Oracle, esp. with very
the large installations; I'll probably end up using it myself.

---

---

From: Carlos Ungil <[email-masked]>
Date: Wed Jul 14 07:13:01 2004

Hi John,

I've just completed the compilation of clisp [*] with the previous 
version, and it seems to work fine (I've just done a couple of 
queries, though).

I will now install and use the new version, and I'll let you know if 
something goes wrong (but I plan to use it only for light-weight 
reporting, so I don't expect to discover new bugs).

Thanks a lot for the patches.

Cheers,

Carlos

[*] I guess I could compile only the oracle module, but starting from 
scratch each time I'm sure I'm doing it right

---

From: "John K. Hinsdale" <[email-masked]>
Date: Wed Jul 14 07:18:17 2004

> version, and it seems to work fine (I've just done a couple of

Most excellent ...

 > reporting, so I don't expect to discover new bugs).

I'm still a touch curious if you were executing some SQL while using
Oracle bind parameters with very long values, but if not don't worry
about it.

---

From: Sam Steingold <[email-masked]>
Date: Wed Jul 14 07:32:16 2004

> * Carlos Ungil <[email-masked]> [2004-07-14 16:06:35 +0200]:
>
> I guess I could compile only the oracle module, but starting from 

All you need to do is type "make" in your build directory.
base CLISP will _not_ be recompiled,
but the full linking set _will_ be re-linked.

Unfortunately, untarring the new module will break the hard links, so,
to restore them, you will need to do:

$ cd build
$ rm -rf oracle
$ make

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.honestreporting.com>
The plural of "anecdote" is not "data".