[
https://issues.apache.org/jira/browse/DERBY-6504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14011428#comment-14011428
]
Mike Matrigali commented on DERBY-6504:
---------------------------------------
review comments:
Index: java/engine/org/apache/derby/impl/store/raw/data/AllocPage.java
the 2 +'s look wrong at this line:
BORROWED_SPACE_OFFSET + +BORROWED_SPACE_LEN
You should "nest" the array out of bounds exception. Do this by adding the
caught
exception as the second argument to newException. see calls to markCorrupt in
same
file for example of includeing caught exception in the new "wrapped" exception.
nits:
should use 80 space lines
java/engine/org/apache/derby/loc/messages.xml:
I would start the error with something that users might understand and then
note the rest of the info
is internal data for developers in understanding the problem. Maybe start
with something like:
Unrecoverable internal error encountered while trying to read low level
metadata about the table or index.
It would be good if we could get the container id or filename in the message.
I did not see anything
in AllocPage, will look and see if we can get anything from it's parent class.
After changes could you post what the nested exception looks like in the
derby.log, including all the nests.
I always just allocate a number from the end of the range of errors to avoid
all possibility of problems
with new errors. But seems ok to use the one you picked, i don't think there
is any soft upgrade issue
with this kind of error.
> 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
> Assignee: Myrna van Lunteren
> 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)