Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic PdfExporter StackOverflowException (Read 4586 times)
tom_w
Junior Member
**
Offline


Swimlanes made our dreams
come true :-)

Posts: 79
Joined: Oct 20th, 2008
PdfExporter StackOverflowException
Sep 25th, 2012 at 1:09pm
Print Post  
Hi

We are getting a StackOverflowException when using the PdfExporter.Export method.  It's only happening on some diagrams and I'm guessing it's the size of the diagram that's causing the issue?  Is that something that you have seen before?

The diagram itself has 164 nodes and 163 links, but is a very flat pyramid, so its very wide and only 3 rows of nodes high.  The export runs for around 17 minutes and then crashes with this error:  "An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll".  I'm not quite sure why it would be taking 17 minutes either?

We are currently running version 5.7.0.25317 and ideally I wouldn't do a version change right now but I can do if there is a chance that will fix the issue?

Thanks, Tom
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: PdfExporter StackOverflowException
Reply #1 - Sep 25th, 2012 at 5:23pm
Print Post  
Hi,

Could you save one of these diagrams as XML file and attach it here, or email it to support@mindfusion.eu?

Stoyan
  
Back to top
 
IP Logged
 
tom_w
Junior Member
**
Offline


Swimlanes made our dreams
come true :-)

Posts: 79
Joined: Oct 20th, 2008
Re: PdfExporter StackOverflowException
Reply #2 - Sep 26th, 2012 at 5:26pm
Print Post  
Hi Stoyan,

Sorry for the delay, file attached.

  

Process_Hierarchy_-_Sub_diagram_10005.zip (Attachment deleted)
Back to top
 
IP Logged
 
tom_w
Junior Member
**
Offline


Swimlanes made our dreams
come true :-)

Posts: 79
Joined: Oct 20th, 2008
Re: PdfExporter StackOverflowException
Reply #3 - Sep 26th, 2012 at 6:01pm
Print Post  
The file above is actually a sub-section of the full diagram that we has also experienced issues exporting.  Full diagram attached below.  That one is considerably larger.
  

Process_Hierarchy_Full_Diagram.zip (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: PdfExporter StackOverflowException
Reply #4 - Sep 27th, 2012 at 7:29am
Print Post  
Apparently this happens because of some strange symbol in node 10285. It causes a stack-overflow in the auto-detected Encoding when PdfExporter calls Encoding.GetBytes(). The symbol appears at the apostrophe position on the second text line - in the "organization?s" string. If you take a look with a hex editor, the Unicode sequence there is EF BF BD.

If you set PdfExporter.DefaultEncoding to Unicode, the exception won't happen, but Adobe's PDF Reader still won't render the node's text, so you better replace the symbol with the normal apostrophe.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
tom_w
Junior Member
**
Offline


Swimlanes made our dreams
come true :-)

Posts: 79
Joined: Oct 20th, 2008
Re: PdfExporter StackOverflowException
Reply #5 - Sep 27th, 2012 at 8:51am
Print Post  
Hi Stoyan

Many thanks, that sorted it  Smiley 

No idea how that character got in there... users...!
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: PdfExporter StackOverflowException
Reply #6 - Sep 27th, 2012 at 10:00am
Print Post  
I've found some further information; EF BF BD is the Unicode replacement character, representing characters "whose value is unknown or unrepresentable" in Unicode:
http://www.fileformat.info/info/unicode/char/fffd/index.htm

I'm not sure how it could show up in the diagram texts though... I suppose it might appear after copy/paste betweeen documents in different languages, and then perhaps the replacement symbol itself was copied to the diagram. Otherwise the nodes' texts should always be in Unicode as they are .NET strings, so copying/pasting ordinary text from any language to the diagram shouldn't cause problems.
  
Back to top
 
IP Logged
 
tom_w
Junior Member
**
Offline


Swimlanes made our dreams
come true :-)

Posts: 79
Joined: Oct 20th, 2008
Re: PdfExporter StackOverflowException
Reply #7 - Sep 27th, 2012 at 10:22am
Print Post  
Hmmm.. that's interesting.

I've had issues like that in the past with carriage return line feeds in Excel, and as that data came from Excel originally I wonder if this is some weirdness there.  It's odd though as in this case it is clearly supposed to be an apostrophe, which isn't normally a character that causes issues.  Strange.  I guess it could just be a file corruption too.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: PdfExporter StackOverflowException
Reply #8 - Sep 27th, 2012 at 10:41am
Print Post  
Was that data imported from Excel automatically using some tool? I suppose that symbol might appear if text bytes were type-cast directly to (char), instead of using conversion methods of the Encoding class corresponding to whatever encoding is used in the Excel document.
  
Back to top
 
IP Logged
 
tom_w
Junior Member
**
Offline


Swimlanes made our dreams
come true :-)

Posts: 79
Joined: Oct 20th, 2008
Re: PdfExporter StackOverflowException
Reply #9 - Sep 27th, 2012 at 10:46am
Print Post  
The importer in our software works on csv files.  I think the user collated the data in Excel, saved it as a csv and then imported that file.  I will see if they still have the csv and have a look at the offending process in that.  I can see the dodgy character in our software too (it is displayed as the question mark in a diamond symbol by the Infragistics grids we use too).
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint