dotgnu-pnet
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pnet-developers] [bugs #7404] StringBuilder related segfault.


From: Rhys Weatherley
Subject: [Pnet-developers] [bugs #7404] StringBuilder related segfault.
Date: Sat, 24 Jan 2004 05:19:10 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826

This mail is an automated notification from the bugs tracker
 of the project: DotGNU Portable.NET.

/**************************************************************************/
[bugs #7404] Latest Modifications:

Changes by: 
                Rhys Weatherley <address@hidden>
'Date: 
                Sat 01/24/04 at 10:19 (GMT)

            What     | Removed                   | Added
---------------------------------------------------------------------------
          Resolution | None                      | Fixed
              Status | Open                      | Closed


------------------ Additional Follow-up Comments ----------------------------
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".






/**************************************************************************/
[bugs #7404] Full Item Snapshot:

URL: <http://savannah.gnu.org/bugs/?func=detailitem&item_id=7404>
Project: DotGNU Portable.NET
Submitted by: Richard Baumann
On: Sat 01/24/04 at 05:36

Category:  None
Severity:  5 - Average
Item Group:  None
Resolution:  Fixed
Assigned to:  None
Status:  Closed


Summary:  StringBuilder related segfault.

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.

Follow-up Comments
------------------


-------------------------------------------------------
Date: Sat 01/24/04 at 10:19         By: rweather
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".






File Attachments
-------------------

-------------------------------------------------------
Date: Sat 01/24/04 at 05:36  Name: ilrun-segfault.tar.gz  Size: 4KB   By: 
Rich333
xml patch and test case, which, when combined, should reproduce the problem
http://savannah.gnu.org/bugs/download.php?item_id=7404&amp;item_file_id=996






For detailed info, follow this link:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=7404>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]