Re: [HACKERS] Re: SIGBUS in AllocSetAlloc & jdbc

Поиск
Список
Период
Сортировка
От Tatsuo Ishii
Тема Re: [HACKERS] Re: SIGBUS in AllocSetAlloc & jdbc
Дата
Msg-id 199905021251.VAA00445@ext16.sra.co.jp
обсуждение исходный текст
Ответ на Re: SIGBUS in AllocSetAlloc & jdbc  (Peter T Mount <peter@retep.org.uk>)
Ответы Re: [HACKERS] Re: SIGBUS in AllocSetAlloc & jdbc  (Tatsuo Ishii <t-ishii@sra.co.jp>)
Re: [HACKERS] Re: SIGBUS in AllocSetAlloc & jdbc  (Peter T Mount <peter@retep.org.uk>)
Список pgsql-hackers
> On Thu, 29 Apr 1999, Brian P Millett wrote:
> 
> > Peter, I hope this long and boring message can shed some light on my
> > difficulties getting jdbc & postgres6.5b1(current snapshot) to work
> > with blobs.  I have NO problem with text, numeric, etc.  Just blobs &
> > the LO interface.
> > 
> > I feel that it is a 64 vs 32 bit memory management problem.
> 
> At first glance, the JDBC code looks ok. In fact it is similar to the
> ImageViewer example that's included with the source.
> 
> Do you get the same problem when using ImageViewer?
> 
> >      // Getting the value of the item_picture column and
> >      // displaying it
> >      System.err.println("Got oid "+queryResults.getInt(2));
> >      byte itemPictureArray [] = queryResults.getBytes(2);
> >      if (itemPictureArray != null) {
> >       Image img =
> > Toolkit.getDefaultToolkit().createImage(itemPictureArray);
> >       itemPictureCanvas.setImage(img);
> >       itemPictureCanvas.repaint();
> >      }
> 
> Using an array is perfectly valid, and the driver does support this method
> of getting an Image from a BLOB.

This morning I started to look into this. First, JDBC driver coming
with 6.5b did not compile. The reason was my JDK (JDK 1.1.7 v1 on
LinuxPPC) returns version string as "root:10/14/98-13:50" and
makeVersion expected it started with "1.1". This was easy to fix. So I
went on and tried the ImageViewer sample. It gave me SQL an exception:

java example.ImageViewer jdbc:postgresql:test t-ishii ""
Connecting to Database URL = jdbc:postgresql:test
Exception caught.
java.sql.SQLException: The postgresql.jar file does not contain the correct JDBC classes for this JVM. Try rebuilding.
Exception thrown was java.lang.ClassNotFoundException: postgresql.jdbc2.Connection
java.sql.SQLException: The postgresql.jar file does not contain the correct JDBC classes for this JVM. Try rebuilding.
Exception thrown was java.lang.ClassNotFoundException: postgresql.jdbc2.Connectionat postgresql.Driver.connect(Compiled
Code)atjava.sql.DriverManager.getConnection(Compiled Code)at java.sql.DriverManager.getConnection(Compiled Code)at
example.ImageViewer.<init>(CompiledCode)at example.ImageViewer.main(Compiled Code)
 

I had no idea how to fix this. I gave up to use the 6.5 JDBC driver. I
had to get back to the 6.4 JDBC driver.  This time ImageViewer seemed
to work. I imported 3 images. Worked fine. Then I tried to take a
glance at the first image. I got SIGSEGV on the backend! It happened in
AllocSetAlloc () and seems in the same place as Brian P Millett
mentioned. Next I switched the backend to 6.4.2(+ large object fixes
basically same as 6.5). Worked great!

In summary:

(1) 6.5 ImageViewer + 6.4.2 JDBC driver + 6.5 backend failed
(2) 6.5 ImageViewer + 6.4.2 JDBC driver + 6.4.2 backend worked

So I suspect there is something wrong with the 6.5 backend. I'll look
into this more.

P.S.  Peter, do you have any suggestion to make JDBC driver under JDK
1.1.7?
---
Tatsuo Ishii


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] query dumping core
Следующее
От: Chris Bitmead
Дата:
Сообщение: Re: [HACKERS] It would be nice if this could be fixed...