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 "xiangzhu K (JIRA)" <xe...@xml.apache.org> on 2007/03/15 09:11:09 UTC
[jira] Created: (XERCESC-1688) Segmentation fault when the length
of parsing filename > 130 characters
Segmentation fault when the length of parsing filename > 130 characters
-----------------------------------------------------------------------
Key: XERCESC-1688
URL: https://issues.apache.org/jira/browse/XERCESC-1688
Project: Xerces-C++
Issue Type: Bug
Components: DOM
Affects Versions: 2.5.0
Environment: linux kernel 2.4
Reporter: xiangzhu K
Priority: Critical
#include <xercesc/util/PlatformUtils.hpp>
#include <xercesc/dom/DOMNode.hpp>
Some source code as
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#include <xercesc/dom/DOMDocument.hpp>
#include <xercesc/parsers/XercesDOMParser.hpp>
#include <xercesc/util/XMLUni.hpp>
#include <xercesc/util/XMLString.hpp>
#include <xercesc/framework/StdOutFormatTarget.hpp>
#include <xercesc/util/XercesDefs.hpp>
#include <xercesc/sax/ErrorHandler.hpp>
...
parser = new XercesDOMParser;
...
SetDOMParser::internal_parse(filename)
{
...
parser->parse(filename);
...
}
...
int main(int argc, const char *argv[])
...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*filename* is transfer by parameter argv[].
Built and run the program. Inputing command format like:
setParse [filename]
When input the filename whose length is longer than 130 chars, like
---------------------------------------
setParse a01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567891
---------------------------------------
program will cast "Segmentation faul" error and break.
Why???? Who can help me?
I used gdb to debug. Followed is some backtrace info:
-----------------------------------------------------------------------------
#0 0x005e901e in free () from /lib/tls/libc.so.6
#1 0x004a7dd3 in __dynamic_cast () from /usr/lib/libstdc++.so.5
#2 0x009f655d in xercesc_2_5::MemoryManagerImpl::deallocate () from /usr/lib/libxerces-c.so.25
#3 0x009618a9 in xercesc_2_5::ArrayJanitor<unsigned short>::reset ()
from /usr/lib/libxerces-c.so.25
#4 0x00961871 in xercesc_2_5::ArrayJanitor<unsigned short>::~ArrayJanitor ()
from /usr/lib/libxerces-c.so.25
#5 0x00a83780 in xercesc_2_5::XMLScanner::scanDocument () from /usr/lib/libxerces-c.so.25
#6 0x0095819e in xercesc_2_5::AbstractDOMParser::parse () from /usr/lib/libxerces-c.so.25
#7 0x08050c37 in SetDOMParser::internal_parse (this=0x7fff8350, filename=0x9a86bb0 "a012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567891") at SetDOMParser.cpp:125
#8 0x08051088 in SetDOMParser::parse (this=0x7fff8350, filename=0x9a86bb0 "a012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567891") at SetDOMParser.cpp:250
#9 0x0804e84d in setParse() at setParse.cpp:186
#10 0x0804f0d1 in main (argc=3, argv=0x7fff8500) at setParse.cpp:330
-----------------------------------------------------------------------------
Why appears Segmentation fault when the length of parsing filename > 130 characters??
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org
[jira] Commented: (XERCESC-1688) Segmentation fault when the length
of parsing filename > 130 characters
Posted by "Alberto Massari (JIRA)" <xe...@xml.apache.org>.
[ https://issues.apache.org/jira/browse/XERCESC-1688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12481074 ]
Alberto Massari commented on XERCESC-1688:
------------------------------------------
Can you try compiling your test program against Xerces 2.7?
Thanks,
Alberto
> Segmentation fault when the length of parsing filename > 130 characters
> -----------------------------------------------------------------------
>
> Key: XERCESC-1688
> URL: https://issues.apache.org/jira/browse/XERCESC-1688
> Project: Xerces-C++
> Issue Type: Bug
> Components: DOM
> Affects Versions: 2.5.0
> Environment: linux kernel 2.4
> Reporter: xiangzhu K
> Priority: Critical
>
> #include <xercesc/util/PlatformUtils.hpp>
> #include <xercesc/dom/DOMNode.hpp>
> Some source code as
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> #include <xercesc/dom/DOMDocument.hpp>
> #include <xercesc/parsers/XercesDOMParser.hpp>
> #include <xercesc/util/XMLUni.hpp>
> #include <xercesc/util/XMLString.hpp>
> #include <xercesc/framework/StdOutFormatTarget.hpp>
> #include <xercesc/util/XercesDefs.hpp>
> #include <xercesc/sax/ErrorHandler.hpp>
> ...
> parser = new XercesDOMParser;
> ...
> SetDOMParser::internal_parse(filename)
> {
> ...
> parser->parse(filename);
> ...
> }
> ...
> int main(int argc, const char *argv[])
> ...
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> *filename* is transfer by parameter argv[].
> Built and run the program. Inputing command format like:
> setParse [filename]
> When input the filename whose length is longer than 130 chars, like
> ---------------------------------------
> setParse a01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567891
> ---------------------------------------
> program will cast "Segmentation faul" error and break.
> Why???? Who can help me?
> I used gdb to debug. Followed is some backtrace info:
> -----------------------------------------------------------------------------
> #0 0x005e901e in free () from /lib/tls/libc.so.6
> #1 0x004a7dd3 in __dynamic_cast () from /usr/lib/libstdc++.so.5
> #2 0x009f655d in xercesc_2_5::MemoryManagerImpl::deallocate () from /usr/lib/libxerces-c.so.25
> #3 0x009618a9 in xercesc_2_5::ArrayJanitor<unsigned short>::reset ()
> from /usr/lib/libxerces-c.so.25
> #4 0x00961871 in xercesc_2_5::ArrayJanitor<unsigned short>::~ArrayJanitor ()
> from /usr/lib/libxerces-c.so.25
> #5 0x00a83780 in xercesc_2_5::XMLScanner::scanDocument () from /usr/lib/libxerces-c.so.25
> #6 0x0095819e in xercesc_2_5::AbstractDOMParser::parse () from /usr/lib/libxerces-c.so.25
> #7 0x08050c37 in SetDOMParser::internal_parse (this=0x7fff8350, filename=0x9a86bb0 "a012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567891") at SetDOMParser.cpp:125
> #8 0x08051088 in SetDOMParser::parse (this=0x7fff8350, filename=0x9a86bb0 "a012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567891") at SetDOMParser.cpp:250
> #9 0x0804e84d in setParse() at setParse.cpp:186
> #10 0x0804f0d1 in main (argc=3, argv=0x7fff8500) at setParse.cpp:330
> -----------------------------------------------------------------------------
> Why appears Segmentation fault when the length of parsing filename > 130 characters??
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org
[jira] Updated: (XERCESC-1688) Segmentation fault when the length
of parsing filename > 130 characters
Posted by "xiangzhu K (JIRA)" <xe...@xml.apache.org>.
[ https://issues.apache.org/jira/browse/XERCESC-1688?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
xiangzhu K updated XERCESC-1688:
--------------------------------
Description:
Some source code as
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SetDOMParser.h
#include <xercesc/util/PlatformUtils.hpp>
#include <xercesc/dom/DOMNode.hpp>
#include <xercesc/dom/DOMDocument.hpp>
#include <xercesc/parsers/XercesDOMParser.hpp>
#include <xercesc/util/XMLUni.hpp>
#include <xercesc/util/XMLString.hpp>
#include <xercesc/framework/StdOutFormatTarget.hpp>
#include <xercesc/util/XercesDefs.hpp>
#include <xercesc/sax/ErrorHandler.hpp>
SetDOMParser.cpp
...
setDOMParser::set::DOMParser()
{
...
parser = new XercesDOMParser;
...
}
SetDOMParser::internal_parse(filename)
{
...
parser->parse(filename);
...
}
...
setParse.cpp
int main(int argc, const char *argv[])
...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*filename* is transfer by parameter argv[].
Built and run the program. Inputing command format like:
setParse [filename]
When input the filename whose length is longer than 130 chars, like
---------------------------------------
setParse a01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567891
---------------------------------------
program will cast "Segmentation faul" error and break.
Why???? Who can help me?
I used gdb to debug. Followed is some backtrace info:
-----------------------------------------------------------------------------
#0 0x005e901e in free () from /lib/tls/libc.so.6
#1 0x004a7dd3 in __dynamic_cast () from /usr/lib/libstdc++.so.5
#2 0x009f655d in xercesc_2_5::MemoryManagerImpl::deallocate () from /usr/lib/libxerces-c.so.25
#3 0x009618a9 in xercesc_2_5::ArrayJanitor<unsigned short>::reset ()
from /usr/lib/libxerces-c.so.25
#4 0x00961871 in xercesc_2_5::ArrayJanitor<unsigned short>::~ArrayJanitor ()
from /usr/lib/libxerces-c.so.25
#5 0x00a83780 in xercesc_2_5::XMLScanner::scanDocument () from /usr/lib/libxerces-c.so.25
#6 0x0095819e in xercesc_2_5::AbstractDOMParser::parse () from /usr/lib/libxerces-c.so.25
#7 0x08050c37 in SetDOMParser::internal_parse (this=0x7fff8350, filename=0x9a86bb0 "a012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567891") at SetDOMParser.cpp:125
#8 0x08051088 in SetDOMParser::parse (this=0x7fff8350, filename=0x9a86bb0 "a012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567891") at SetDOMParser.cpp:250
#9 0x0804e84d in setParse() at setParse.cpp:186
#10 0x0804f0d1 in main (argc=3, argv=0x7fff8500) at setParse.cpp:330
-----------------------------------------------------------------------------
Why appears Segmentation fault when the length of parsing filename > 130 characters??
Thanks.
--- MIDI
was:
#include <xercesc/util/PlatformUtils.hpp>
#include <xercesc/dom/DOMNode.hpp>
Some source code as
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#include <xercesc/dom/DOMDocument.hpp>
#include <xercesc/parsers/XercesDOMParser.hpp>
#include <xercesc/util/XMLUni.hpp>
#include <xercesc/util/XMLString.hpp>
#include <xercesc/framework/StdOutFormatTarget.hpp>
#include <xercesc/util/XercesDefs.hpp>
#include <xercesc/sax/ErrorHandler.hpp>
...
parser = new XercesDOMParser;
...
SetDOMParser::internal_parse(filename)
{
...
parser->parse(filename);
...
}
...
int main(int argc, const char *argv[])
...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*filename* is transfer by parameter argv[].
Built and run the program. Inputing command format like:
setParse [filename]
When input the filename whose length is longer than 130 chars, like
---------------------------------------
setParse a01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567891
---------------------------------------
program will cast "Segmentation faul" error and break.
Why???? Who can help me?
I used gdb to debug. Followed is some backtrace info:
-----------------------------------------------------------------------------
#0 0x005e901e in free () from /lib/tls/libc.so.6
#1 0x004a7dd3 in __dynamic_cast () from /usr/lib/libstdc++.so.5
#2 0x009f655d in xercesc_2_5::MemoryManagerImpl::deallocate () from /usr/lib/libxerces-c.so.25
#3 0x009618a9 in xercesc_2_5::ArrayJanitor<unsigned short>::reset ()
from /usr/lib/libxerces-c.so.25
#4 0x00961871 in xercesc_2_5::ArrayJanitor<unsigned short>::~ArrayJanitor ()
from /usr/lib/libxerces-c.so.25
#5 0x00a83780 in xercesc_2_5::XMLScanner::scanDocument () from /usr/lib/libxerces-c.so.25
#6 0x0095819e in xercesc_2_5::AbstractDOMParser::parse () from /usr/lib/libxerces-c.so.25
#7 0x08050c37 in SetDOMParser::internal_parse (this=0x7fff8350, filename=0x9a86bb0 "a012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567891") at SetDOMParser.cpp:125
#8 0x08051088 in SetDOMParser::parse (this=0x7fff8350, filename=0x9a86bb0 "a012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567891") at SetDOMParser.cpp:250
#9 0x0804e84d in setParse() at setParse.cpp:186
#10 0x0804f0d1 in main (argc=3, argv=0x7fff8500) at setParse.cpp:330
-----------------------------------------------------------------------------
Why appears Segmentation fault when the length of parsing filename > 130 characters??
Thanks.
--- MIDI
> Segmentation fault when the length of parsing filename > 130 characters
> -----------------------------------------------------------------------
>
> Key: XERCESC-1688
> URL: https://issues.apache.org/jira/browse/XERCESC-1688
> Project: Xerces-C++
> Issue Type: Bug
> Components: DOM
> Affects Versions: 2.5.0
> Environment: linux kernel 2.4
> Reporter: xiangzhu K
> Priority: Critical
>
> Some source code as
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> SetDOMParser.h
> #include <xercesc/util/PlatformUtils.hpp>
> #include <xercesc/dom/DOMNode.hpp>
> #include <xercesc/dom/DOMDocument.hpp>
> #include <xercesc/parsers/XercesDOMParser.hpp>
> #include <xercesc/util/XMLUni.hpp>
> #include <xercesc/util/XMLString.hpp>
> #include <xercesc/framework/StdOutFormatTarget.hpp>
> #include <xercesc/util/XercesDefs.hpp>
> #include <xercesc/sax/ErrorHandler.hpp>
> SetDOMParser.cpp
> ...
> setDOMParser::set::DOMParser()
> {
> ...
> parser = new XercesDOMParser;
> ...
> }
> SetDOMParser::internal_parse(filename)
> {
> ...
> parser->parse(filename);
> ...
> }
> ...
> setParse.cpp
> int main(int argc, const char *argv[])
> ...
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> *filename* is transfer by parameter argv[].
> Built and run the program. Inputing command format like:
> setParse [filename]
> When input the filename whose length is longer than 130 chars, like
> ---------------------------------------
> setParse a01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567891
> ---------------------------------------
> program will cast "Segmentation faul" error and break.
> Why???? Who can help me?
> I used gdb to debug. Followed is some backtrace info:
> -----------------------------------------------------------------------------
> #0 0x005e901e in free () from /lib/tls/libc.so.6
> #1 0x004a7dd3 in __dynamic_cast () from /usr/lib/libstdc++.so.5
> #2 0x009f655d in xercesc_2_5::MemoryManagerImpl::deallocate () from /usr/lib/libxerces-c.so.25
> #3 0x009618a9 in xercesc_2_5::ArrayJanitor<unsigned short>::reset ()
> from /usr/lib/libxerces-c.so.25
> #4 0x00961871 in xercesc_2_5::ArrayJanitor<unsigned short>::~ArrayJanitor ()
> from /usr/lib/libxerces-c.so.25
> #5 0x00a83780 in xercesc_2_5::XMLScanner::scanDocument () from /usr/lib/libxerces-c.so.25
> #6 0x0095819e in xercesc_2_5::AbstractDOMParser::parse () from /usr/lib/libxerces-c.so.25
> #7 0x08050c37 in SetDOMParser::internal_parse (this=0x7fff8350, filename=0x9a86bb0 "a012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567891") at SetDOMParser.cpp:125
> #8 0x08051088 in SetDOMParser::parse (this=0x7fff8350, filename=0x9a86bb0 "a012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567891") at SetDOMParser.cpp:250
> #9 0x0804e84d in setParse() at setParse.cpp:186
> #10 0x0804f0d1 in main (argc=3, argv=0x7fff8500) at setParse.cpp:330
> -----------------------------------------------------------------------------
> Why appears Segmentation fault when the length of parsing filename > 130 characters??
> Thanks.
> --- MIDI
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org
[jira] Closed: (XERCESC-1688) Segmentation fault when the length of
parsing filename > 130 characters
Posted by "Boris Kolpackov (JIRA)" <xe...@xml.apache.org>.
[ https://issues.apache.org/jira/browse/XERCESC-1688?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Boris Kolpackov closed XERCESC-1688.
------------------------------------
Resolution: Fixed
Fix Version/s: 3.0.1
Presumably fixed in 3.0.1. Please verify and reopen if not the case.
> Segmentation fault when the length of parsing filename > 130 characters
> -----------------------------------------------------------------------
>
> Key: XERCESC-1688
> URL: https://issues.apache.org/jira/browse/XERCESC-1688
> Project: Xerces-C++
> Issue Type: Bug
> Components: DOM
> Affects Versions: 2.5.0
> Environment: linux kernel 2.4
> Reporter: xiangzhu K
> Priority: Critical
> Fix For: 3.0.1
>
>
> Some source code as
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> SetDOMParser.h
> #include <xercesc/util/PlatformUtils.hpp>
> #include <xercesc/dom/DOMNode.hpp>
> #include <xercesc/dom/DOMDocument.hpp>
> #include <xercesc/parsers/XercesDOMParser.hpp>
> #include <xercesc/util/XMLUni.hpp>
> #include <xercesc/util/XMLString.hpp>
> #include <xercesc/framework/StdOutFormatTarget.hpp>
> #include <xercesc/util/XercesDefs.hpp>
> #include <xercesc/sax/ErrorHandler.hpp>
> SetDOMParser.cpp
> ...
> setDOMParser::set::DOMParser()
> {
> ...
> parser = new XercesDOMParser;
> ...
> }
> SetDOMParser::internal_parse(filename)
> {
> ...
> parser->parse(filename);
> ...
> }
> ...
> setParse.cpp
> int main(int argc, const char *argv[])
> ...
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> *filename* is transfer by parameter argv[].
> Built and run the program. Inputing command format like:
> setParse [filename]
> When input the filename whose length is longer than 130 chars, like
> ---------------------------------------
> setParse a01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567891
> ---------------------------------------
> program will cast "Segmentation faul" error and break.
> Why???? Who can help me?
> I used gdb to debug. Followed is some backtrace info:
> -----------------------------------------------------------------------------
> #0 0x005e901e in free () from /lib/tls/libc.so.6
> #1 0x004a7dd3 in __dynamic_cast () from /usr/lib/libstdc++.so.5
> #2 0x009f655d in xercesc_2_5::MemoryManagerImpl::deallocate () from /usr/lib/libxerces-c.so.25
> #3 0x009618a9 in xercesc_2_5::ArrayJanitor<unsigned short>::reset ()
> from /usr/lib/libxerces-c.so.25
> #4 0x00961871 in xercesc_2_5::ArrayJanitor<unsigned short>::~ArrayJanitor ()
> from /usr/lib/libxerces-c.so.25
> #5 0x00a83780 in xercesc_2_5::XMLScanner::scanDocument () from /usr/lib/libxerces-c.so.25
> #6 0x0095819e in xercesc_2_5::AbstractDOMParser::parse () from /usr/lib/libxerces-c.so.25
> #7 0x08050c37 in SetDOMParser::internal_parse (this=0x7fff8350, filename=0x9a86bb0 "a012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567891") at SetDOMParser.cpp:125
> #8 0x08051088 in SetDOMParser::parse (this=0x7fff8350, filename=0x9a86bb0 "a012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567891") at SetDOMParser.cpp:250
> #9 0x0804e84d in setParse() at setParse.cpp:186
> #10 0x0804f0d1 in main (argc=3, argv=0x7fff8500) at setParse.cpp:330
> -----------------------------------------------------------------------------
> Why appears Segmentation fault when the length of parsing filename > 130 characters??
> Thanks.
> --- MIDI
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org
[jira] Updated: (XERCESC-1688) Segmentation fault when the length
of parsing filename > 130 characters
Posted by "xiangzhu K (JIRA)" <xe...@xml.apache.org>.
[ https://issues.apache.org/jira/browse/XERCESC-1688?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
xiangzhu K updated XERCESC-1688:
--------------------------------
Description:
#include <xercesc/util/PlatformUtils.hpp>
#include <xercesc/dom/DOMNode.hpp>
Some source code as
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#include <xercesc/dom/DOMDocument.hpp>
#include <xercesc/parsers/XercesDOMParser.hpp>
#include <xercesc/util/XMLUni.hpp>
#include <xercesc/util/XMLString.hpp>
#include <xercesc/framework/StdOutFormatTarget.hpp>
#include <xercesc/util/XercesDefs.hpp>
#include <xercesc/sax/ErrorHandler.hpp>
...
parser = new XercesDOMParser;
...
SetDOMParser::internal_parse(filename)
{
...
parser->parse(filename);
...
}
...
int main(int argc, const char *argv[])
...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*filename* is transfer by parameter argv[].
Built and run the program. Inputing command format like:
setParse [filename]
When input the filename whose length is longer than 130 chars, like
---------------------------------------
setParse a01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567891
---------------------------------------
program will cast "Segmentation faul" error and break.
Why???? Who can help me?
I used gdb to debug. Followed is some backtrace info:
-----------------------------------------------------------------------------
#0 0x005e901e in free () from /lib/tls/libc.so.6
#1 0x004a7dd3 in __dynamic_cast () from /usr/lib/libstdc++.so.5
#2 0x009f655d in xercesc_2_5::MemoryManagerImpl::deallocate () from /usr/lib/libxerces-c.so.25
#3 0x009618a9 in xercesc_2_5::ArrayJanitor<unsigned short>::reset ()
from /usr/lib/libxerces-c.so.25
#4 0x00961871 in xercesc_2_5::ArrayJanitor<unsigned short>::~ArrayJanitor ()
from /usr/lib/libxerces-c.so.25
#5 0x00a83780 in xercesc_2_5::XMLScanner::scanDocument () from /usr/lib/libxerces-c.so.25
#6 0x0095819e in xercesc_2_5::AbstractDOMParser::parse () from /usr/lib/libxerces-c.so.25
#7 0x08050c37 in SetDOMParser::internal_parse (this=0x7fff8350, filename=0x9a86bb0 "a012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567891") at SetDOMParser.cpp:125
#8 0x08051088 in SetDOMParser::parse (this=0x7fff8350, filename=0x9a86bb0 "a012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567891") at SetDOMParser.cpp:250
#9 0x0804e84d in setParse() at setParse.cpp:186
#10 0x0804f0d1 in main (argc=3, argv=0x7fff8500) at setParse.cpp:330
-----------------------------------------------------------------------------
Why appears Segmentation fault when the length of parsing filename > 130 characters??
Thanks.
--- MIDI
was:
#include <xercesc/util/PlatformUtils.hpp>
#include <xercesc/dom/DOMNode.hpp>
Some source code as
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#include <xercesc/dom/DOMDocument.hpp>
#include <xercesc/parsers/XercesDOMParser.hpp>
#include <xercesc/util/XMLUni.hpp>
#include <xercesc/util/XMLString.hpp>
#include <xercesc/framework/StdOutFormatTarget.hpp>
#include <xercesc/util/XercesDefs.hpp>
#include <xercesc/sax/ErrorHandler.hpp>
...
parser = new XercesDOMParser;
...
SetDOMParser::internal_parse(filename)
{
...
parser->parse(filename);
...
}
...
int main(int argc, const char *argv[])
...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*filename* is transfer by parameter argv[].
Built and run the program. Inputing command format like:
setParse [filename]
When input the filename whose length is longer than 130 chars, like
---------------------------------------
setParse a01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567891
---------------------------------------
program will cast "Segmentation faul" error and break.
Why???? Who can help me?
I used gdb to debug. Followed is some backtrace info:
-----------------------------------------------------------------------------
#0 0x005e901e in free () from /lib/tls/libc.so.6
#1 0x004a7dd3 in __dynamic_cast () from /usr/lib/libstdc++.so.5
#2 0x009f655d in xercesc_2_5::MemoryManagerImpl::deallocate () from /usr/lib/libxerces-c.so.25
#3 0x009618a9 in xercesc_2_5::ArrayJanitor<unsigned short>::reset ()
from /usr/lib/libxerces-c.so.25
#4 0x00961871 in xercesc_2_5::ArrayJanitor<unsigned short>::~ArrayJanitor ()
from /usr/lib/libxerces-c.so.25
#5 0x00a83780 in xercesc_2_5::XMLScanner::scanDocument () from /usr/lib/libxerces-c.so.25
#6 0x0095819e in xercesc_2_5::AbstractDOMParser::parse () from /usr/lib/libxerces-c.so.25
#7 0x08050c37 in SetDOMParser::internal_parse (this=0x7fff8350, filename=0x9a86bb0 "a012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567891") at SetDOMParser.cpp:125
#8 0x08051088 in SetDOMParser::parse (this=0x7fff8350, filename=0x9a86bb0 "a012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567891") at SetDOMParser.cpp:250
#9 0x0804e84d in setParse() at setParse.cpp:186
#10 0x0804f0d1 in main (argc=3, argv=0x7fff8500) at setParse.cpp:330
-----------------------------------------------------------------------------
Why appears Segmentation fault when the length of parsing filename > 130 characters??
> Segmentation fault when the length of parsing filename > 130 characters
> -----------------------------------------------------------------------
>
> Key: XERCESC-1688
> URL: https://issues.apache.org/jira/browse/XERCESC-1688
> Project: Xerces-C++
> Issue Type: Bug
> Components: DOM
> Affects Versions: 2.5.0
> Environment: linux kernel 2.4
> Reporter: xiangzhu K
> Priority: Critical
>
> #include <xercesc/util/PlatformUtils.hpp>
> #include <xercesc/dom/DOMNode.hpp>
> Some source code as
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> #include <xercesc/dom/DOMDocument.hpp>
> #include <xercesc/parsers/XercesDOMParser.hpp>
> #include <xercesc/util/XMLUni.hpp>
> #include <xercesc/util/XMLString.hpp>
> #include <xercesc/framework/StdOutFormatTarget.hpp>
> #include <xercesc/util/XercesDefs.hpp>
> #include <xercesc/sax/ErrorHandler.hpp>
> ...
> parser = new XercesDOMParser;
> ...
> SetDOMParser::internal_parse(filename)
> {
> ...
> parser->parse(filename);
> ...
> }
> ...
> int main(int argc, const char *argv[])
> ...
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> *filename* is transfer by parameter argv[].
> Built and run the program. Inputing command format like:
> setParse [filename]
> When input the filename whose length is longer than 130 chars, like
> ---------------------------------------
> setParse a01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567891
> ---------------------------------------
> program will cast "Segmentation faul" error and break.
> Why???? Who can help me?
> I used gdb to debug. Followed is some backtrace info:
> -----------------------------------------------------------------------------
> #0 0x005e901e in free () from /lib/tls/libc.so.6
> #1 0x004a7dd3 in __dynamic_cast () from /usr/lib/libstdc++.so.5
> #2 0x009f655d in xercesc_2_5::MemoryManagerImpl::deallocate () from /usr/lib/libxerces-c.so.25
> #3 0x009618a9 in xercesc_2_5::ArrayJanitor<unsigned short>::reset ()
> from /usr/lib/libxerces-c.so.25
> #4 0x00961871 in xercesc_2_5::ArrayJanitor<unsigned short>::~ArrayJanitor ()
> from /usr/lib/libxerces-c.so.25
> #5 0x00a83780 in xercesc_2_5::XMLScanner::scanDocument () from /usr/lib/libxerces-c.so.25
> #6 0x0095819e in xercesc_2_5::AbstractDOMParser::parse () from /usr/lib/libxerces-c.so.25
> #7 0x08050c37 in SetDOMParser::internal_parse (this=0x7fff8350, filename=0x9a86bb0 "a012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567891") at SetDOMParser.cpp:125
> #8 0x08051088 in SetDOMParser::parse (this=0x7fff8350, filename=0x9a86bb0 "a012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567891") at SetDOMParser.cpp:250
> #9 0x0804e84d in setParse() at setParse.cpp:186
> #10 0x0804f0d1 in main (argc=3, argv=0x7fff8500) at setParse.cpp:330
> -----------------------------------------------------------------------------
> Why appears Segmentation fault when the length of parsing filename > 130 characters??
> Thanks.
> --- MIDI
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org