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

From: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
To: Peter T Mount <peter(at)retep(dot)org(dot)uk>
Cc: Brian P Millett <bpm(at)ec-group(dot)com>, postgres <hackers(at)postgreSQL(dot)org>
Subject: Re: [HACKERS] Re: SIGBUS in AllocSetAlloc & jdbc
Date: 1999-05-02 14:52:54
Message-ID: 199905021452.XAA00509@ext16.sra.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> 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.Connection
> at postgresql.Driver.connect(Compiled Code)
> at java.sql.DriverManager.getConnection(Compiled Code)
> at java.sql.DriverManager.getConnection(Compiled Code)
> at example.ImageViewer.<init>(Compiled Code)
> 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?

So far I couldn't find nothing special with the backend by now. Going
back to the ImageViewer, I think I found possible problem with it. In
my understanding, every lo call should be in single transaction block.
But ImageViwer seems does not give any "begin" or "end" SQL commands.
I made a small modifications(see below patches) to the ImageViewer and
now it starts to work again with 6.5 backend! I suspect that
difference of palloc() code between 6.4.2 and 6.5 made the problem
opened up.
---
Tatsuo Ishii

*** ImageViewer.java~ Mon Oct 12 11:45:45 1998
--- ImageViewer.java Sun May 2 23:16:27 1999
***************
*** 390,395 ****
--- 390,396 ----
{
try {
System.out.println("Selecting oid for "+name);
+ stat.executeUpdate("begin");
ResultSet rs = stat.executeQuery("select imgoid from images where imgname='"+name+"'");
if(rs!=null) {
// Even though there should only be one image, we still have to
***************
*** 402,407 ****
--- 403,409 ----
}
}
rs.close();
+ stat.executeUpdate("end");
} catch(SQLException ex) {
label.setText(ex.toString());
}

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 1999-05-02 17:12:10 Re: [HACKERS] Re: SIGBUS in AllocSetAlloc & jdbc
Previous Message Chris Bitmead 1999-05-02 13:35:08 Re: [HACKERS] It would be nice if this could be fixed...