Menu

#127 BufferOverflowException

2.1.3
closed
None
5
2015-10-31
2015-10-30
Phil
No

Hi,

Jackcess crash with a BufferOverflowException when inserting/updating a row with more than 4060 bytes of data :

Exception in thread "main" java.nio.BufferOverflowException
    at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:206)
    at com.healthmarketscience.jackcess.impl.TableImpl.createRow(TableImpl.java:2151)
    at com.healthmarketscience.jackcess.impl.TableImpl.createRow(TableImpl.java:2035)
    at com.healthmarketscience.jackcess.impl.TableImpl.addRows(TableImpl.java:1568)
    at com.healthmarketscience.jackcess.impl.TableImpl.addRow(TableImpl.java:1461)
    at com.healthmarketscience.jackcess.impl.TableImpl.addRowFromMap(TableImpl.java:1469)
    at BufferOverflowException.main(BufferOverflowException.java:47)

I isolated the problem in the java class attached to this bug.

To reproduce it's simple : create a table with 20 TEXT columns each filled with more than 101 chars (2 bytes / char).

The problem is because the variable maxRowSize become negative (Class TableImpl, ligne 2145) so the buffer has no more space available (overflow).

1 Attachments

Discussion

  • James Ahlborn

    James Ahlborn - 2015-10-30

    Just FYI, i can make the exception prettier, but it's going to fail regardless. An access database has a maximum row size, and you are exceeding it.

     
  • James Ahlborn

    James Ahlborn - 2015-10-31
    • labels: BufferOverflowException -->
    • status: open --> closed
    • assigned_to: James Ahlborn
    • Group: 2.1.2 --> 2.1.3
     
  • James Ahlborn

    James Ahlborn - 2015-10-31

    The exception will now be an IOException with an appropriate message. Fixed in trunk, will be in the 2.1.3 release.

     

Log in to post a comment.

MongoDB Logo MongoDB