bugDotGNU Portable.NET - Bugs: bug #7404, StringBuilder related segfault.

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #7404: StringBuilder related segfault.

Submitter:  Richard Baumann <Rich333>
Submitted:  Sat 24 Jan 2004 05:36:15 AM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Fixed Privacy:  Public
Assigned to:  None Open/Closed:  Closed

Discussion

Sat 24 Jan 2004 10:19:09 AM UTC, comment #1: 

Fix committed to CVS (pnetlib).  There were times when the
engine rounded "capacity" up to a value greater than
"maxCapacity".  This confused the "Append(char)" inline
method in CVM, which thought it could add more characters than it should have.  The StringBuilder will now clamp "capacity"
so that it won't exceed "maxCapacity".

Rhys Weatherley <rweather>
Group administrator
Sat 24 Jan 2004 05:36:15 AM UTC, original submission:  

I can't seem to get a simple test case to exhibit this behavior, so I've attached a patch which reverts my xml code to an earlier version which exhibits this behavior, and a simple xml test case which should segfault because of it. Although I'm not exactly sure where in the engine the problem is occurring, I do know what's going wrong.

The "garbage" StringBuilder, with a capacity and maxCapacity of 1, in the XmlParserInputBase class, is somehow winding up with a buildString of length 2. The AppendSpace code in StringBuilder assumes the length would never be greater than the maxCapacity, so it ends up returning -1 to Append. I traced the managed code sets of the String's length variable (by renaming length to length__ and adding a length property with traces) and by the time it's first set, the length is already at 2. Because of this, I think it's probably somewhere in pnet/engine/lib_string.c but the NewBuilder icall looks ok. That's as far as I was able to get before giving up.

Richard Baumann <Rich333>
Group Member

 

Attached Files

Attached Files
file #1016:  ilrun-segfault.tar.gz added by Rich333 (4.0KiB - application/gzip - xml patch and test case, which, when combined, should reproduce the problem)

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

 

Votes

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

History

Follow 3 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2004-01-24 rweather StatusNone Fixed
    Open/ClosedOpen Closed
2004-01-24 Rich333 Attached File- Added ilrun-segfault.tar.gz, #996

Back to the top

Powered by Savane 3.16.
Corresponding source code