History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: AMQ-1858
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Rob Davies
Reporter: Simone Bordet
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
ActiveMQ

Integer overflow in default settings

Created: 17/Jul/08 08:09 AM   Updated: 14/Aug/08 02:33 AM
Component/s: Broker
Affects Version/s: 5.1.0
Fix Version/s: 5.2.0

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works amq_1858.patch 2008-07-24 12:13 PM Earl Woodman 2 kb


 Description  « Hide
From BrokerService, line 711-2:

systemUsage.getTempUsage().setLimit(1024 * 1024 * 1024 * 100); // 10 Gb
systemUsage.getStoreUsage().setLimit(1024 * 1024 * 1024 * 100); // 100 GB

The expression 1024 * 1024 * 1024 * 100 overflows int, so the above lines actually correspond to setLimit(0).
Easy fix is to make one of the multipliers a long, for example:

1024L * 1024 * 1024 * 100

Other places may have the same problem, but I did not look for all places.



 All   Comments   Work Log   Change History   Subversion Commits   FishEye   Crucible      Sort Order: Ascending order - Click to sort in descending order
Earl Woodman - 24/Jul/08 12:13 PM
Attaching a patch which fixes this issue and adds a unit test to ensure its correctness in the future.

Rob Davies - 14/Aug/08 02:33 AM
Fixed applied in SVN revision 685832