Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0003268 [Hessian] minor always 01-15-09 13:39 02-24-09 18:44
Reporter emil View Status public  
Assigned To
Priority normal Resolution fixed  
Status closed   Product Version 3.2.1
Summary 0003268: Circular references in Hessian Flex
Description (rep by bryan)

In the current implementation ( hessian-flex-3.2.0-src.jar ):

If an Object which is Serialized contains a circular reference to itself
i.e. Project -> Project, then HessianOutput will crash with a stack
overflow.

The reason for this, is it doesn't do anything to handle circular
references, I suspect a more complete handling would require a rewrite of
the handleObject and handleObject10 methods passing recursively a Map of
reference objects down the call stack to properly solve this the reference
way.

This code just fixes it one level deep, but it's better than nothing and
fixes the most common case.


[-- Attachment 0000002: HessianOutput.patch.txt --]
[-- Type: text/plain, Encoding: 7bit, Size: 0.8K --]

Index: flex/hessian/src/hessian/io/HessianOutput.as
===================================================================
--- flex/hessian/src/hessian/io/HessianOutput.as (revision 190)
+++ flex/hessian/src/hessian/io/HessianOutput.as (working copy)
@@ -376,7 +376,15 @@

             if (key != "hessianTypeName") {
               writeObject(key);
- writeObject(obj[key]);
+ //Very crude, yet it works, prevent crashing on recursive
+relationships by not sending them
+ if(obj[key] != obj){
+ writeObject(obj[key]);
+ }
+ else{
+ trace("should be writing a reference here but writing null is
+the " +
+ "next best thing when encountering a circular
+references");
+ writeNull();
+ }
             }

             break;
Additional Information
Attached Files

- Relationships

- Notes
(0003837)
emil
02-24-09 18:44

Fixed in version 4.0
 

- Issue History
Date Modified Username Field Change
01-15-09 13:39 emil New Issue
02-24-09 18:44 emil Status new => closed
02-24-09 18:44 emil Note Added: 0003837
02-24-09 18:44 emil Resolution open => fixed


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
29 total queries executed.
26 unique queries executed.
Powered by Mantis Bugtracker