You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by xe...@xml.apache.org on 2004/10/18 13:26:51 UTC

[jira] Created: (XERCESC-1290) XMLString::release gives strange error when string contains Japanese characters

Message:

  A new issue has been created in JIRA.

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/XERCESC-1290

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: XERCESC-1290
    Summary: XMLString::release gives strange error when string contains Japanese characters
       Type: Bug

     Status: Unassigned
   Priority: Critical

    Project: Xerces-C++

   Assignee: 
   Reporter: Aditya Kulkarni

    Created: Mon, 18 Oct 2004 4:25 AM
    Updated: Mon, 18 Oct 2004 4:25 AM
Environment: Windows 2000, MSVC7.1, Not multi-threaded.

Description:
My XML file contains a mixture of Japanese and English characters. For example, <Vendor>&#28450;&#23383;ABCD&#28450;&#23383;</Vendor>.

I use XMLString::transcode function to convert the above string (a mix of Japanese and English) from utf-16 format to utf-8 format. The char buffer allocated by XMLString::transcode is then released using the XMLString::release(&char_buffer).

The XMLString::release function gives the following error.

Debug Error!
Damage After Normal Block (#block number) at memory address (some hex address).

It gives you option of Abort, Retry, Ignore. On selecting ignore, the program functions as desired.

Thanks
Aditya Kulkarni


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


[jira] Closed: (XERCESC-1290) XMLString::release gives strange error when string contains Japanese characters

Posted by xe...@xml.apache.org.
Message:

   The following issue has been closed.

   Resolver: Alberto Massari
       Date: Fri, 22 Oct 2004 11:40 AM

I have tried modifying the DOMPrint sample so that it takes the text node, invokes XMLString::transcode on it, prints it to cout and then calls XMLString::release. I ran it on a Japanese Windows Server 2003, and it works (also using Xerces 2.4). Which version of Xerces are you using?

Alberto
---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/XERCESC-1290

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: XERCESC-1290
    Summary: XMLString::release gives strange error when string contains Japanese characters
       Type: Bug

     Status: Closed
   Priority: Critical
 Resolution: CANNOT REPRODUCE

    Project: Xerces-C++

   Assignee: 
   Reporter: Aditya Kulkarni

    Created: Mon, 18 Oct 2004 4:25 AM
    Updated: Fri, 22 Oct 2004 11:40 AM
Environment: Windows 2000, MSVC7.1, Not multi-threaded.

Description:
My XML file contains a mixture of Japanese and English characters. For example, <Vendor>&#28450;&#23383;ABCD&#28450;&#23383;</Vendor>.

I use XMLString::transcode function to convert the above string (a mix of Japanese and English) from utf-16 format to utf-8 format. The char buffer allocated by XMLString::transcode is then released using the XMLString::release(&char_buffer).

The XMLString::release function gives the following error.

Debug Error!
Damage After Normal Block (#block number) at memory address (some hex address).

It gives you option of Abort, Retry, Ignore. On selecting ignore, the program functions as desired.

Thanks
Aditya Kulkarni


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


[jira] Commented: (XERCESC-1290) XMLString::release gives strange error when string contains Japanese characters

Posted by xe...@xml.apache.org.
The following comment has been added to this issue:

     Author: Alberto Massari
    Created: Fri, 22 Oct 2004 12:00 AM
       Body:
Adding e-mail answer,
Alberto

From: Aditya Kulkarni <ad...@veritas.com>
To: xerces-c-dev@xml.apache.org
Subject: RE: [jira] Commented: (XERCESC-1290) XMLString::release gives str
	ange error when string contains Japanese characters

Hi Alberto,

Thanks for the prompt reply. This is the relevant piece of code.

NULLCHECK(a, b, c, d) is a macro which checks if a is NULL. If yes, prints a
message using args b and c, and returns the code d.

int XMLParser :: XMLCh2string(XMLCh *xmlch, string &str) {
    char    *c = NULL;
    char    whoami[] = "XMLParser::XMLCh2string";

    NULLCHECK(xmlch, whoami, "xmlch == NULL", XML_PARSER_INVALID_ARG);
    c = XMLString::transcode(xmlch);
    NULLCHECK(c, whoami, "XMLString::transcode failed", XML_PARSER_NOMEM);
    str = string(c);
    XMLString::release(&c);
    return XML_PARSER_SUCCESS;
}

int XMLParser :: getStringTypeData(DOMNode *node, string &str) {
    DOMNode         *child = NULL;
    XMLCh           *xmlstring = NULL;
    string          str1("");
    char            whoami[] = "XMLParser::getWstringTypeData";

    NULLCHECK(node, whoami, "node == NULL", XML_PARSER_INVALID_ARG);

    child = node->getFirstChild();
    NULLCHECK(child, whoami, "child == NULL", XML_PARSER_FAILED);

    xmlstring = (XMLCh *)child->getNodeValue();
    NULLCHECK(xmlstring, whoami, "xmlstring = NULL", XML_PARSER_NOMEM);

    if (XMLCh2string(xmlstring, str1) != XML_PARSER_SUCCESS) {
        return XML_PARSER_FAILED;
    }
    str = str1;
    return XML_PARSER_SUCCESS;
}

This function XMLCh2string is used to convert from XMLCh string (which is in
utf16) to a char based string (which is in utf8). There are two problems
that I am facing, and I have one observation.

[1] Debug Error! Damage After Normal Block (#block number) at memory address
(some hex address). This is encountered during XMLString::release()
function.

[2] the constructor of string class, used in "str = string(c)", internally
makes use of strlen. When I use purify to find if there is some memory
related issue, it reports "Array Bounds Read" in function strlen().

[3] If I comment out XMLString::release(&c) line in XMLCh2string() function,
I don't get the Debug Error mentioned in [1].

Thanks
Aditya Kulkarni

---------------------------------------------------------------------
View this comment:
  http://issues.apache.org/jira/browse/XERCESC-1290?page=comments#action_54474

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/XERCESC-1290

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: XERCESC-1290
    Summary: XMLString::release gives strange error when string contains Japanese characters
       Type: Bug

     Status: Unassigned
   Priority: Critical

    Project: Xerces-C++

   Assignee: 
   Reporter: Aditya Kulkarni

    Created: Mon, 18 Oct 2004 4:25 AM
    Updated: Fri, 22 Oct 2004 12:00 AM
Environment: Windows 2000, MSVC7.1, Not multi-threaded.

Description:
My XML file contains a mixture of Japanese and English characters. For example, <Vendor>&#28450;&#23383;ABCD&#28450;&#23383;</Vendor>.

I use XMLString::transcode function to convert the above string (a mix of Japanese and English) from utf-16 format to utf-8 format. The char buffer allocated by XMLString::transcode is then released using the XMLString::release(&char_buffer).

The XMLString::release function gives the following error.

Debug Error!
Damage After Normal Block (#block number) at memory address (some hex address).

It gives you option of Abort, Retry, Ignore. On selecting ignore, the program functions as desired.

Thanks
Aditya Kulkarni


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


[jira] Commented: (XERCESC-1290) XMLString::release gives strange error when string contains Japanese characters

Posted by xe...@xml.apache.org.
The following comment has been added to this issue:

     Author: Alberto Massari
    Created: Mon, 18 Oct 2004 9:17 AM
       Body:
The error you are seeing is signaling that a buffer overrun has happened (in debug mode every allocated buffer is terminated with a specific byte sequence that is checked upon deallocation, and in your case this sequence has been altered).

Could you post the code you are using? 

Thanks,
Alberto
---------------------------------------------------------------------
View this comment:
  http://issues.apache.org/jira/browse/XERCESC-1290?page=comments#action_54312

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/XERCESC-1290

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: XERCESC-1290
    Summary: XMLString::release gives strange error when string contains Japanese characters
       Type: Bug

     Status: Unassigned
   Priority: Critical

    Project: Xerces-C++

   Assignee: 
   Reporter: Aditya Kulkarni

    Created: Mon, 18 Oct 2004 4:25 AM
    Updated: Mon, 18 Oct 2004 9:17 AM
Environment: Windows 2000, MSVC7.1, Not multi-threaded.

Description:
My XML file contains a mixture of Japanese and English characters. For example, <Vendor>&#28450;&#23383;ABCD&#28450;&#23383;</Vendor>.

I use XMLString::transcode function to convert the above string (a mix of Japanese and English) from utf-16 format to utf-8 format. The char buffer allocated by XMLString::transcode is then released using the XMLString::release(&char_buffer).

The XMLString::release function gives the following error.

Debug Error!
Damage After Normal Block (#block number) at memory address (some hex address).

It gives you option of Abort, Retry, Ignore. On selecting ignore, the program functions as desired.

Thanks
Aditya Kulkarni


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org