Bug 1118460 - Serialization of long sqlexception/warning next chains can lead to oom
Summary: Serialization of long sqlexception/warning next chains can lead to oom
Keywords:
Status: RELEASE_PENDING
Alias: None
Product: JBoss Data Virtualization 6
Classification: JBoss
Component: Teiid
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Van Halbert
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-10 18:40 UTC by Rick Wagner
Modified: 2018-12-06 17:17 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
PATCH NAME: BZ-1118460 PRODUCT NAME: JBoss Data Virtualization VERSION: (DV) 6.0 SHORT DESCRIPTION: Serialization of long sqlexception/warning next chains can lead to oom LONG DESCRIPTION: SQLExceptions can cause Out of Memory Exceptions in serialization. MANUAL INSTALL INSTRUCTIONS: Backup and remove the following files: $DATA_VIRTUALIZATION_HOME/dataVirtualization/jdbc/teiid-8.4.1-redhat-7-jdbc.jar $DATA_VIRTUALIZATION_HOME/dataVirtualization/teiid-adminshell/lib/teiid-8.4.1-redhat-7-jdbc.jar Extract files from the .zip, place them in the following locations: teiid-8.4.2-redhat-1-jdbc.jar to $DATA_VIRTUALIZATION_HOME/dataVirtualization/jdbc teiid-8.4.2-redhat-1-jdbc.jar to $DATA_VIRTUALIZATION_HOME/dataVirtualization/teiid-adminshell/lib teiid-client-8.4.2-redhat-1.jar to $DATA_VIRTUALIZATION_HOME/modules/system/layers/dv/org/jboss/teiid/client/main Finally, edit $DATA_VIRTUALIZATION_HOME/modules/system/layers/dv/org/jboss/teiid/client/main/module.xml so the 'resource-root' tag for teiid-client contains the new jar name (teiid-client-8.4.2-redhat-1.jar). Instructions to uninstall: Remove the jdbc .jar at $DATA_VIRTUALIZATION_HOME/dataVirtualization/jdbc, replace with the backup from above. Remove the jdbc .jar at $DATA_VIRTUALIZATION_HOME/dataVirtualization/teiid-adminshell/lib, replace with the backup from above. Edit $DATA_VIRTUALIZATION_HOME/modules/system/layers/dv/org/jboss/teiid/client/main/module.xml so the 'resource-root' tag for teiid-client contains the original jar name (teiid-client-8.4.1-redhat-7.jar). DEPENDENCIES: JBoss Data Virtualization 6.0 GA SUPERSEDED BY: N/A CREATOR: Rick Wagner DATE: 11 July 2014
Clone Of:
Environment:
Last Closed:
Type: Support Patch


Attachments (Terms of Use)
Fixed .jar (530.17 KB, application/x-java-archive)
2014-07-10 18:43 UTC, Rick Wagner
no flags Details
Fixed client jar (320.85 KB, application/x-java-archive)
2014-07-10 18:43 UTC, Rick Wagner
no flags Details
Single Zip of patch. (780.80 KB, application/zip)
2014-07-11 13:49 UTC, Rick Wagner
no flags Details


Links
System ID Priority Status Summary Last Updated
JBoss Issue Tracker TEIID-3021 Major Closed Serialization of long sqlexception/warning next chains can lead to oom 2019-07-29 08:54:33 UTC

Description Rick Wagner 2014-07-10 18:40:15 UTC
Description of problem:
The serialization logic for exception chains is not correct and will output exponentially too many instances of chained exceptions, which can lead to out of memory conditions.

Comment 2 Rick Wagner 2014-07-10 18:43:05 UTC
Created attachment 917161 [details]
Fixed .jar

Comment 3 Rick Wagner 2014-07-10 18:43:43 UTC
Created attachment 917162 [details]
Fixed client jar

Comment 4 Rick Wagner 2014-07-10 18:44:40 UTC
Delta from source change used for this fix:

[rwagner@dev113 DV1]$ diff Orig/ExceptionHolder.java Changed/ExceptionHolder.java 
129,140c129,144
<                       SQLException se = (SQLException)exception;
<                       SQLException next = se.getNextException();
<                       int count = 0;
<                       while (next != null) {
<                               count++;
<                               next = next.getNextException();
<                       }
<                       out.writeInt(count);
<                       next = se.getNextException();
<                       while (next != null) {
<                               out.writeObject(new ExceptionHolder(next, true));
<                               next = next.getNextException();
---
>                         if (nested) {
>                               out.writeInt(0);
>                       } else {
>                               SQLException se = (SQLException)exception;
>                               SQLException next = se.getNextException();
>                               int count = 0;
>                               while (next != null) {
>                                       count++;
>                                       next = next.getNextException();
>                               }
>                               out.writeInt(count);
>                               next = se.getNextException();
>                               while (next != null) {
>                                       out.writeObject(new ExceptionHolder(next, true));
>                                       next = next.getNextException();
>                               }

Comment 6 Rick Wagner 2014-07-11 13:49:03 UTC
Created attachment 917314 [details]
Single Zip of patch.

Comment 7 JBoss JIRA Server 2014-07-11 16:01:45 UTC
Johnathon Lee <jolee@redhat.com> updated the status of jira TEIID-3021 to Reopened

Comment 8 JBoss JIRA Server 2014-07-17 12:34:59 UTC
Steven Hawkins <shawkins@redhat.com> updated the status of jira TEIID-3021 to Resolved

Comment 9 Filip Elias 2014-07-31 12:11:06 UTC
All tests passed.
Verified on DV 6.0. 
The patch is in the attachment.

Comment 10 JBoss JIRA Server 2015-03-05 23:34:59 UTC
Steven Hawkins <shawkins@redhat.com> updated the status of jira TEIID-3021 to Closed

Comment 11 PnT Account Manager 2017-12-07 23:54:31 UTC
Employee 'felias@redhat.com' has left the company.


Note You need to log in before you can comment on or make changes to this bug.