This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: McKoi db error


Hi Tom,

thanks for the info.

I don't know what the McKoi db is, but cool.

McKoi db is a similar db to Hsql except that it strives for SQL92 completeness and usage in a server invironment as well as for embedded. It's supposed to perform quite well in both areas.


The error message in question comes from java.io.ObjectInputStream.
Unfortunately for you, our serialization support isn't as well-tested
as other parts of libgcj.  So you've probably run into a serialization
bug of some kind.

The only real option is to debug the library and find out what has
gone wrong.

I also contacted the McKoi developers and they gave me some pointers where the start looking. I thus spent the entire day tracing this problem and I found a solution and an additional problem. First of all I think both McKoi and gcj are at fault. The Serializable interface documents that when the serialization requires special handling both the readObject and writeObject methods should be implemented. Apparently most jdk implementation provide the default implementation if either one isn't implemented, but gcj apparently takes the other route. When adding the following method to the Expression and TObject classes of McKoi db, the initial problem disappears.


private void writeObject(java.io.ObjectOutputStream out)
throws IOException
{
    out.defaultWriteObject();
}

These errors occur during the creation of the initial structure of the database and more specifically during the creation of the views. This procedure continues now quite a bit further than before, but I encountered a similar error. At first I thought it was the same issue but now I'm doubting. Again I get the following error :

read view plan
> com.mckoi.database.Database ( lvl: 40 )
java.lang.Error: IO Error: Unknown marker on stream: 0
at com.mckoi.database.ViewDef.deserializeFromBlob(com.mckoi.database.global.ByteLongObject) (/home/gbevin/mckoi-sql/src/lib-com-mckoi.so)
at com.mckoi.database.DatabaseConnection.getViewDef(int) (/home/gbevin/mckoi-sql/src/lib-com-mckoi.so)
at com.mckoi.database.DatabaseConnection$ViewInternalTableInfo.getDataTableDef(int) (/home/gbevin/mckoi-sql/src/lib-com-mckoi.so)
...


But, after hours of searching I couldn't replicate the problem in memory. Then I decided to check what the bytes are that are available after serialization and what the ones are that are available for deserialization. I came to the constatation that they are very different. In fact after 109 bytes, the rest of the byte array that is provided to the deserialization method is filled with bytes that are equal to 0! Therefore it's of course impossible to deserialize correctly.
Is there something known about the IO of the current 3.3 branch? I find this a very strange problem and am a bit lost when thinking about how to find a solution. I also asked the McKoi developers for additional help.


Any pointers are very appreciated !

Thanks for the help,

Geert

--
Geert Bevin             Uwyn
"Use what you need"     Lambermontlaan 148
http://www.uwyn.com     1030 Brussels
gbevin at uwyn dot com         Tel & Fax +32 2 245 41 06

PGP Fingerprint : 4E21 6399 CD9E A384 6619  719A C8F4 D40D 309F D6A9
Public PGP key  : available at servers pgp.mit.edu, wwwkeys.pgp.net


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]