You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Caroline Maynard (JIRA)" <tu...@ws.apache.org> on 2006/07/10 13:39:29 UTC
[jira] Created: (TUSCANY-529) Access violation in
XMLHelperImpl::save
Access violation in XMLHelperImpl::save
---------------------------------------
Key: TUSCANY-529
URL: http://issues.apache.org/jira/browse/TUSCANY-529
Project: Tuscany
Type: Bug
Components: C++ SDO
Versions: Cpp-M1
Environment: WinXP
Reporter: Caroline Maynard
Occurs in the case where the root element URI and name are both null.
MSVCRTD! 00379060()
std::basic_string<char,std::char_traits<char>,std::allocator<char> >::assign(const char * 0x00000000) line 138 + 16 bytes
std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> >(const char * 0x00000000, const std::allocator<char> & {...}) line 51 + 39 bytes
commonj::sdo::SDOString::SDOString(const char * 0x00000000) line 53 + 51 bytes
commonj::sdo::SDOXMLWriter::write(commonj::sdo::RefCountingPointer<commonj::sdo::XMLDocument> {...}, int 0xffffffff) line 124 + 52 bytes
commonj::sdo::XMLHelperImpl::save(commonj::sdo::RefCountingPointer<commonj::sdo::XMLDocument> {...}, int 0xffffffff) line 256
commonj::sdo::XMLHelperImpl::save(commonj::sdo::RefCountingPointer<commonj::sdo::DataObject> {...}, const char * 0x00000000, const char * 0x00000000, int 0xffffffff) line 268 + 68 bytes
Here's a patch which worked for me. YMMV:
--- SDOXMLWriter.cpp 2006-07-06 19:45:10.000000000 +0100
+++ /cygdrive/c/phpbuild/pecl/sdo/commonj/sdo/SDOXMLWriter.cpp 2006-07-10 11:56:57.664945600 +0100
@@ -121,15 +121,15 @@
{
elementURI = root->getType().getURI();
}
- SDOString elementName = doc->getRootElementName();
- if (elementName.empty())
+ SDOXMLString elementName = doc->getRootElementName();
+ if (elementName.isNull() || elementName.equals(""))
{
elementName = root->getType().getName();
elementName = elementName.toLower(0,1);
writeXSIType = true;
}
- writeDO(root, elementURI, elementName.c_str(), true, true);
+ writeDO(root, elementURI, elementName, true, true);
}
rc = xmlTextWriterEndDocument(writer);
if (rc < 0) {
--
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
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
Re: [jira] Created: (TUSCANY-529) Access violation in XMLHelperImpl::save
Posted by Geoffrey Winn <ge...@googlemail.com>.
I'll look at this tomorrow, since it is obviously in my code.
Regards,
Geoff.
On 10/07/06, Caroline Maynard (JIRA) <tu...@ws.apache.org> wrote:
>
> Access violation in XMLHelperImpl::save
> ---------------------------------------
>
> Key: TUSCANY-529
> URL: http://issues.apache.org/jira/browse/TUSCANY-529
> Project: Tuscany
> Type: Bug
>
> Components: C++ SDO
> Versions: Cpp-M1
> Environment: WinXP
> Reporter: Caroline Maynard
>
>
> Occurs in the case where the root element URI and name are both null.
>
> MSVCRTD! 00379060()
> std::basic_string<char,std::char_traits<char>,std::allocator<char>
> >::assign(const char * 0x00000000) line 138 + 16 bytes
> std::basic_string<char,std::char_traits<char>,std::allocator<char>
> >::basic_string<char,std::char_traits<char>,std::allocator<char> >(const
> char * 0x00000000, const std::allocator<char> & {...}) line 51 + 39 bytes
> commonj::sdo::SDOString::SDOString(const char * 0x00000000) line 53 + 51
> bytes
> commonj::sdo::SDOXMLWriter::write(commonj::sdo::RefCountingPointer<commonj::sdo::XMLDocument>
> {...}, int 0xffffffff) line 124 + 52 bytes
> commonj::sdo::XMLHelperImpl::save(commonj::sdo::RefCountingPointer<commonj::sdo::XMLDocument>
> {...}, int 0xffffffff) line 256
> commonj::sdo::XMLHelperImpl::save(commonj::sdo::RefCountingPointer<commonj::sdo::DataObject>
> {...}, const char * 0x00000000, const char * 0x00000000, int 0xffffffff)
> line 268 + 68 bytes
>
> Here's a patch which worked for me. YMMV:
> --- SDOXMLWriter.cpp 2006-07-06 19:45:10.000000000 +0100
> +++ /cygdrive/c/phpbuild/pecl/sdo/commonj/sdo/SDOXMLWriter.cpp 2006-07-10
> 11:56:57.664945600 +0100
> @@ -121,15 +121,15 @@
> {
> elementURI = root->getType().getURI();
> }
> - SDOString elementName = doc->getRootElementName();
> - if (elementName.empty())
> + SDOXMLString elementName = doc->getRootElementName();
> + if (elementName.isNull() || elementName.equals(""))
> {
> elementName = root->getType().getName();
> elementName = elementName.toLower(0,1);
> writeXSIType = true;
> }
>
> - writeDO(root, elementURI, elementName.c_str(), true,
> true);
> + writeDO(root, elementURI, elementName, true, true);
> }
> rc = xmlTextWriterEndDocument(writer);
> if (rc < 0) {
>
> --
> 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
> -
> For more information on JIRA, see:
> http://www.atlassian.com/software/jira
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>
[jira] Commented: (TUSCANY-529) Access violation in
XMLHelperImpl::save
Posted by "Geoff Winn (JIRA)" <tu...@ws.apache.org>.
[ http://issues.apache.org/jira/browse/TUSCANY-529?page=comments#action_12420126 ]
Geoff Winn commented on TUSCANY-529:
------------------------------------
This problem arises because doc->getRootElementName is passing a null pointer to the SDOString constructor, which it cannot handle. This is a more general problem than this one case however the attached patch fixes this particular incident. I will review the code to see if there are other cases that need attention.
> Access violation in XMLHelperImpl::save
> ---------------------------------------
>
> Key: TUSCANY-529
> URL: http://issues.apache.org/jira/browse/TUSCANY-529
> Project: Tuscany
> Type: Bug
> Components: C++ SDO
> Versions: Cpp-M1
> Environment: WinXP
> Reporter: Caroline Maynard
>
> Occurs in the case where the root element URI and name are both null.
> MSVCRTD! 00379060()
> std::basic_string<char,std::char_traits<char>,std::allocator<char> >::assign(const char * 0x00000000) line 138 + 16 bytes
> std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> >(const char * 0x00000000, const std::allocator<char> & {...}) line 51 + 39 bytes
> commonj::sdo::SDOString::SDOString(const char * 0x00000000) line 53 + 51 bytes
> commonj::sdo::SDOXMLWriter::write(commonj::sdo::RefCountingPointer<commonj::sdo::XMLDocument> {...}, int 0xffffffff) line 124 + 52 bytes
> commonj::sdo::XMLHelperImpl::save(commonj::sdo::RefCountingPointer<commonj::sdo::XMLDocument> {...}, int 0xffffffff) line 256
> commonj::sdo::XMLHelperImpl::save(commonj::sdo::RefCountingPointer<commonj::sdo::DataObject> {...}, const char * 0x00000000, const char * 0x00000000, int 0xffffffff) line 268 + 68 bytes
> Here's a patch which worked for me. YMMV:
> --- SDOXMLWriter.cpp 2006-07-06 19:45:10.000000000 +0100
> +++ /cygdrive/c/phpbuild/pecl/sdo/commonj/sdo/SDOXMLWriter.cpp 2006-07-10 11:56:57.664945600 +0100
> @@ -121,15 +121,15 @@
> {
> elementURI = root->getType().getURI();
> }
> - SDOString elementName = doc->getRootElementName();
> - if (elementName.empty())
> + SDOXMLString elementName = doc->getRootElementName();
> + if (elementName.isNull() || elementName.equals(""))
> {
> elementName = root->getType().getName();
> elementName = elementName.toLower(0,1);
> writeXSIType = true;
> }
>
> - writeDO(root, elementURI, elementName.c_str(), true, true);
> + writeDO(root, elementURI, elementName, true, true);
> }
> rc = xmlTextWriterEndDocument(writer);
> if (rc < 0) {
--
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
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
[jira] Closed: (TUSCANY-529) Access violation in
XMLHelperImpl::save
Posted by "Pete Robbins (JIRA)" <tu...@ws.apache.org>.
[ http://issues.apache.org/jira/browse/TUSCANY-529?page=all ]
Pete Robbins closed TUSCANY-529.
--------------------------------
Fix Version/s: Cpp-M1
Resolution: Fixed
> Access violation in XMLHelperImpl::save
> ---------------------------------------
>
> Key: TUSCANY-529
> URL: http://issues.apache.org/jira/browse/TUSCANY-529
> Project: Tuscany
> Issue Type: Bug
> Components: C++ SDO
> Affects Versions: Cpp-M1
> Environment: WinXP
> Reporter: Caroline Maynard
> Fix For: Cpp-M1
>
> Attachments: TUSCANY-529.patch
>
>
> Occurs in the case where the root element URI and name are both null.
> MSVCRTD! 00379060()
> std::basic_string<char,std::char_traits<char>,std::allocator<char> >::assign(const char * 0x00000000) line 138 + 16 bytes
> std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> >(const char * 0x00000000, const std::allocator<char> & {...}) line 51 + 39 bytes
> commonj::sdo::SDOString::SDOString(const char * 0x00000000) line 53 + 51 bytes
> commonj::sdo::SDOXMLWriter::write(commonj::sdo::RefCountingPointer<commonj::sdo::XMLDocument> {...}, int 0xffffffff) line 124 + 52 bytes
> commonj::sdo::XMLHelperImpl::save(commonj::sdo::RefCountingPointer<commonj::sdo::XMLDocument> {...}, int 0xffffffff) line 256
> commonj::sdo::XMLHelperImpl::save(commonj::sdo::RefCountingPointer<commonj::sdo::DataObject> {...}, const char * 0x00000000, const char * 0x00000000, int 0xffffffff) line 268 + 68 bytes
> Here's a patch which worked for me. YMMV:
> --- SDOXMLWriter.cpp 2006-07-06 19:45:10.000000000 +0100
> +++ /cygdrive/c/phpbuild/pecl/sdo/commonj/sdo/SDOXMLWriter.cpp 2006-07-10 11:56:57.664945600 +0100
> @@ -121,15 +121,15 @@
> {
> elementURI = root->getType().getURI();
> }
> - SDOString elementName = doc->getRootElementName();
> - if (elementName.empty())
> + SDOXMLString elementName = doc->getRootElementName();
> + if (elementName.isNull() || elementName.equals(""))
> {
> elementName = root->getType().getName();
> elementName = elementName.toLower(0,1);
> writeXSIType = true;
> }
>
> - writeDO(root, elementURI, elementName.c_str(), true, true);
> + writeDO(root, elementURI, elementName, true, true);
> }
> rc = xmlTextWriterEndDocument(writer);
> if (rc < 0) {
--
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
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
[jira] Updated: (TUSCANY-529) Access violation in
XMLHelperImpl::save
Posted by "Geoff Winn (JIRA)" <tu...@ws.apache.org>.
[ http://issues.apache.org/jira/browse/TUSCANY-529?page=all ]
Geoff Winn updated TUSCANY-529:
-------------------------------
Attachment: TUSCANY-529.patch
Built and tested on both Windows XP and Linux
> Access violation in XMLHelperImpl::save
> ---------------------------------------
>
> Key: TUSCANY-529
> URL: http://issues.apache.org/jira/browse/TUSCANY-529
> Project: Tuscany
> Type: Bug
> Components: C++ SDO
> Versions: Cpp-M1
> Environment: WinXP
> Reporter: Caroline Maynard
> Attachments: TUSCANY-529.patch
>
> Occurs in the case where the root element URI and name are both null.
> MSVCRTD! 00379060()
> std::basic_string<char,std::char_traits<char>,std::allocator<char> >::assign(const char * 0x00000000) line 138 + 16 bytes
> std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> >(const char * 0x00000000, const std::allocator<char> & {...}) line 51 + 39 bytes
> commonj::sdo::SDOString::SDOString(const char * 0x00000000) line 53 + 51 bytes
> commonj::sdo::SDOXMLWriter::write(commonj::sdo::RefCountingPointer<commonj::sdo::XMLDocument> {...}, int 0xffffffff) line 124 + 52 bytes
> commonj::sdo::XMLHelperImpl::save(commonj::sdo::RefCountingPointer<commonj::sdo::XMLDocument> {...}, int 0xffffffff) line 256
> commonj::sdo::XMLHelperImpl::save(commonj::sdo::RefCountingPointer<commonj::sdo::DataObject> {...}, const char * 0x00000000, const char * 0x00000000, int 0xffffffff) line 268 + 68 bytes
> Here's a patch which worked for me. YMMV:
> --- SDOXMLWriter.cpp 2006-07-06 19:45:10.000000000 +0100
> +++ /cygdrive/c/phpbuild/pecl/sdo/commonj/sdo/SDOXMLWriter.cpp 2006-07-10 11:56:57.664945600 +0100
> @@ -121,15 +121,15 @@
> {
> elementURI = root->getType().getURI();
> }
> - SDOString elementName = doc->getRootElementName();
> - if (elementName.empty())
> + SDOXMLString elementName = doc->getRootElementName();
> + if (elementName.isNull() || elementName.equals(""))
> {
> elementName = root->getType().getName();
> elementName = elementName.toLower(0,1);
> writeXSIType = true;
> }
>
> - writeDO(root, elementURI, elementName.c_str(), true, true);
> + writeDO(root, elementURI, elementName, true, true);
> }
> rc = xmlTextWriterEndDocument(writer);
> if (rc < 0) {
--
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
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org