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: CLOSED UPSTREAM
Alias: None
Product: JBoss Data Virtualization 6
Classification: JBoss
Component: Teiid
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Jorge Perez Bolano
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-10 18:40 UTC by Rick Wagner
Modified: 2025-02-10 03:42 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2025-02-10 03:42:30 UTC
Type: Support Patch
Embargoed:


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 Private Priority Status Summary Last Updated
Red Hat Issue Tracker TEIID-3021 0 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> updated the status of jira TEIID-3021 to Reopened

Comment 8 JBoss JIRA Server 2014-07-17 12:34:59 UTC
Steven Hawkins <shawkins> 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> updated the status of jira TEIID-3021 to Closed

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

Comment 14 Red Hat Bugzilla 2025-02-10 03:42:30 UTC
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.


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