Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0020097
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 09. Financial managementmajorsometimes2012-03-23 12:502012-04-02 13:57
Reportereduardo_ArgalView Statuspublic 
Assigned Tomirurita 
PriorityurgentResolutionfixedFixed in Version
StatusclosedFix in branchpiFixed in SCM revisioneac99d3aee34
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0020097: java.lang.StackOverflowError as infinite loop occurs while calling OrganizationStructureProvider

DescriptionAn infinite loop results into java.lang.StackOverflowError.
Steps To Reproduce1) Install remittance module
2) create a new remittance header for organization F&B US, Inc.
3) click on Select orders or invoices (Now it will work fine)
4) open Payment in and create a new header using organization F&B US, Inc.
5) Click on Add Details (It will work fine as well)
6) move back to remittance and click again in Select orders or invoices

Realize that now java.lang.StackOverflowError occurs doing the same call than in step 3
TagsRegression
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 00192603.0MP8 closedjecharri You can use credit generated from other organization with a common Business Partner 

-  Notes
(0046791)
hgbot (developer)
2012-03-27 22:24

Repository: erp/devel/pi
Changeset: bd5c72a00d0f6d25f8a77a721548cd9cba740daa
Author: Mikel Irurita <mikel.irurita <at> openbravo.com>
Date: Tue Mar 27 22:23:41 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/bd5c72a00d0f6d25f8a77a721548cd9cba740daa [^]

Fixes issue 20097: java.lang.StackOverflowError while calling OrganizationStructureProvider

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/AdvPaymentMngtDao.java
---
(0046792)
mirurita (developer)
2012-03-27 22:25

OBContext.getOBContext().getOrganizationStructureProvider().getChildOrg(legalEntity.getId())
returned a reference to the private class attribute childByOrganizationID.
So, if you modify returned value you are actually modifying the "global" object, because is a reference to the same instance.
The following line
orgIds.add(legalEntity.getId());
was adding the parent org to the children org list.
So, if after executing the previous code you call to getChildOrg method which does recursive calls to get the full list of child orgs it results in a infinite loop because the parent or is contained in the child org list.
This was causing the stack overflow error.
 
Methods returning references to the class attributes (and not a new instance) should be reviewed. Any external module can use our public API and create corrupted data.
More info: https://issues.openbravo.com/view.php?id=20129 [^]

Testing plan:

Basic:
1) Create a new Payment
2) Click on Add details button. At this point the childByOrganizationID object should containg invalid data.
3) Execute any code that calls to getChildTree method on OrganizationStructureProvider. For example create a new remittance and click in Select orders or invoices

Other affected areas:

The modified method is called from the following flows:
- Processing a payment with used credit different to zero.
- Completing an invoice and the business partner of the invoice has credit to consume. A popup should be displayed where the user can consume the available credit.
- Click 'Add details' button in Payment In/Out window. The header must have a business partner.
- Add payment from invoice. Click on 'Add Payment In/Out' from invoice.
- Add payment from transaction.

Execute previous flows.
(0046808)
vmromanos (manager)
2012-03-28 10:57

code review + testing OK

Tested using proposed testing plans by mirurita
(0047022)
hgbot (developer)
2012-04-01 20:34

Repository: erp/devel/pi
Changeset: eac99d3aee34bbe62abe5e78a1698d663c19b3f6
Author: Mikel Irurita <mikel.irurita <at> openbravo.com>
Date: Tue Mar 27 22:23:41 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/eac99d3aee34bbe62abe5e78a1698d663c19b3f6 [^]

Fixes issue 20097: java.lang.StackOverflowError while calling OrganizationStructureProvider

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/AdvPaymentMngtDao.java
---
(0047249)
hudsonbot (developer)
2012-04-02 06:12

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/7814864461ac [^]

Maturity status: Test
(0047301)
gorka_gil (administrator)
2012-04-02 12:17

Reopened by merge.
(0047312)
mirurita (developer)
2012-04-02 13:57

Regression introduced by 0019260.

- Issue History
Date Modified Username Field Change
2012-03-23 12:50 eduardo_Argal New Issue
2012-03-23 12:50 eduardo_Argal Assigned To => vmromanos
2012-03-23 12:50 eduardo_Argal Modules => Core
2012-03-23 12:52 vmromanos Status new => scheduled
2012-03-23 12:52 vmromanos fix_in_branch => pi
2012-03-23 14:07 vmromanos Reproducibility always => sometimes
2012-03-23 14:07 vmromanos fix_in_branch pi =>
2012-03-27 21:40 mirurita Assigned To vmromanos => mirurita
2012-03-27 22:24 hgbot Checkin
2012-03-27 22:24 hgbot Note Added: 0046791
2012-03-27 22:24 hgbot Status scheduled => resolved
2012-03-27 22:24 hgbot Resolution open => fixed
2012-03-27 22:24 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/bd5c72a00d0f6d25f8a77a721548cd9cba740daa [^]
2012-03-27 22:25 mirurita Note Added: 0046792
2012-03-28 10:57 vmromanos Note Added: 0046808
2012-03-28 10:57 vmromanos Status resolved => closed
2012-03-28 10:57 vmromanos Fixed in Version => 3.0MP9
2012-04-01 20:34 hgbot Checkin
2012-04-01 20:34 hgbot Note Added: 0047022
2012-04-01 20:34 hgbot Status closed => resolved
2012-04-01 20:34 hgbot Fixed in SCM revision http://code.openbravo.com/erp/devel/pi/rev/bd5c72a00d0f6d25f8a77a721548cd9cba740daa [^] => http://code.openbravo.com/erp/devel/pi/rev/eac99d3aee34bbe62abe5e78a1698d663c19b3f6 [^]
2012-04-02 06:12 hudsonbot Checkin
2012-04-02 06:12 hudsonbot Note Added: 0047249
2012-04-02 12:17 gorka_gil Note Added: 0047301
2012-04-02 12:17 gorka_gil Status resolved => closed
2012-04-02 13:43 dmitry_mezentsev Tag Attached: Regression
2012-04-02 13:56 mirurita Status closed => new
2012-04-02 13:56 mirurita Resolution fixed => open
2012-04-02 13:56 mirurita Fixed in Version 3.0MP9 =>
2012-04-02 13:56 mirurita Relationship added related to 0019260
2012-04-02 13:57 mirurita Status new => scheduled
2012-04-02 13:57 mirurita fix_in_branch => pi
2012-04-02 13:57 mirurita Status scheduled => resolved
2012-04-02 13:57 mirurita Resolution open => fixed
2012-04-02 13:57 mirurita Status resolved => closed
2012-04-02 13:57 mirurita Note Added: 0047312


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker