[
https://issues.apache.org/jira/browse/DERBY-6504?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Myrna van Lunteren updated DERBY-6504:
--------------------------------------
Attachment: DERBY-6504.diff
Attaching a patch which catches an ArrayIndexOutOfBoundsException when an
arraycopy is attempted in AllocPage.readContainerInfo, and generates an error
message.
I used XSDG4 - which seemed to be missing in the list of XSDG error messages.
So perhaps this message was used for something else in an older version of
Derby, I have not checked this.
If the message is triggered, it looks like this:
ERROR XSDG4: Could not create page header info. Arraycopy failed of embryonic
page bytearray with length 204 to container information byte array of length
80. The values of the variables and constants were: maximum borrowable space:
204, borrowedspace offset: 108; borrowed space length: 1; source position in
arraycopy: 109; length in arraycopy: 80; embryonic page Hex dump:
00000000: 0076 0000 0001 0000 0000 0000 0002 0000 .v..............
00000010: 0000 0006 0000 0000 0000 0000 0000 0000 ................
00000020: 0000 0000 0001 0000 0000 0000 0000 0000 ................
....(more dump text)
Review will be welcomed.
> change AllocPage.ReadContainerInfo to catch ArrayIndexOutOfBoundsException
> and turn it into Derby error.
> --------------------------------------------------------------------------------------------------------
>
> Key: DERBY-6504
> URL: https://issues.apache.org/jira/browse/DERBY-6504
> Project: Derby
> Issue Type: Bug
> Components: Store
> Affects Versions: 10.6.1.0, 10.8.2.2
> Reporter: Mike Matrigali
> Attachments: DERBY-6504.diff
>
>
> Users have reported databases that will not boot with stack traces showing:
> Caused by: java.lang.ArrayIndexOutOfBoundsException
> at java.lang.System.arraycopy(Native Method)
> at org.apache.derby.impl.store.raw.data.AllocPage.ReadContainerInfo(Unknown
> Source)
> at org.apache.derby.impl.store.raw.data.FileContainer.readHeader(Unknown
> Source)
> I suggest the code be changed to catch the out of bounds and turn it
> into a StandardException and include as much runtime information as
> possible so that the underlying problem can be diagnosed. Information
> should include sizes of both arrays, the amount of data being copied ("N"),
> and possibly a hex dump of the source array.
--
This message was sent by Atlassian JIRA
(v6.2#6252)