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 David --- <da...@yahoo.fr> on 2005/01/21 14:45:59 UTC

Problem with xercesc_2_6::XMemory::operator

Well it seems that a problem never comes alone.

There seems to be a problem in my program hat is
causing me some trouble. I'm using a sax parser but i
get a seg fault when i run the program.
Here is the output of gdb

Starting program:
/home/david/Actigenics/libs/C++/base/XmlXercesFactory/SaxParsing_classtest
-e ISO8859-1 config.pubmed snorna_cancer
[Thread debugging using libthread_db enabled]
[New Thread 1079665312 (LWP 13936)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1079665312 (LWP 13936)]
0x40227d32 in xercesc_2_6::XMemory::operator new ()
from /usr/lib/libxerces-c.so.26
Current language:  auto; currently c

(gdb) bt
#0  0x40227d32 in xercesc_2_6::XMemory::operator new
() from /usr/lib/libxerces-c.so.26
#1  0x080504a3 in XmlFactory::setParser
(this=0xbffff040, type=
        {static npos = 4294967295, _M_dataplus =
{<std::allocator<char>> =
{<__gnu_cxx::new_allocator<char>> = {<No data
fields>}, <No data fields>}, _M_p = 0x805d23c "sax"}})
at XmlFactory.cpp:32
#2  0x0804d8dc in main (argc=5, argv=0xbffff1f4) at
SaxParsing_classtest.cpp:194


##############################
My Xml.h class is as follows
###############################

This implementation gives a segfault
class Xml : public DefaultHandler, public
XMLFormatTarget {

If i use this one below it works
//class Xml : public DefaultHandler {
 public:

    Xml();
    virtual ~Xml();



########classtest

line 194 
XmlFactory xmlf(c_v ,c_d ,c_n ,c_s ,c_fs ,c_e); 
Xml *parser = xmlf.setParser(type);

...
As you can see one declaration is working and the
other not. That is the only difference. 
Any idea ???

david










	

	
		
Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails ! 
Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com/

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


Re: Problem with xercesc_2_6::XMemory::operator

Posted by David --- <da...@yahoo.fr>.
Yep,
I have implemented an internal function to do that.
the program runs properly if I use the 
class Xml : public DefaultHandler
instead of the 
class Xml : public DefaultHandler , public
XMLFormatTarget

All the abstracts function are set and i can parse the
xml file as i want. It is just when i implement the
XMLFormatTarget that it crashes...

void Xml::_init()
{
    try {
	XMLPlatformUtils::Initialize();
    }
    catch (const XMLException& e) {
	std::cout << "Error during initialization! :\n"
		  <<  Error(e.getMessage()) << "\n";
	exit(-1);
  }  
    //std::cout << "Xml platform initiated" <<
std::endl;
}

void Xml::_destruct()
{
    XMLPlatformUtils::Terminate();
    //std::cout << "Xml platform terminated" <<
std::endl;
}


 --- Alberto Massari <am...@datadirect.com> a écrit
: 
> Hi David,
> have you called XMLPlatforUtils::Initialize()?
> 
> Alberto
> 
> At 14.45 21/01/2005 +0100, David --- wrote:
> >Well it seems that a problem never comes alone.
> >
> >There seems to be a problem in my program hat is
> >causing me some trouble. I'm using a sax parser but
> i
> >get a seg fault when i run the program.
> >Here is the output of gdb
> >
> >Starting program:
>
>/home/david/Actigenics/libs/C++/base/XmlXercesFactory/SaxParsing_classtest
> >-e ISO8859-1 config.pubmed snorna_cancer
> >[Thread debugging using libthread_db enabled]
> >[New Thread 1079665312 (LWP 13936)]
> >
> >Program received signal SIGSEGV, Segmentation
> fault.
> >[Switching to Thread 1079665312 (LWP 13936)]
> >0x40227d32 in xercesc_2_6::XMemory::operator new ()
> >from /usr/lib/libxerces-c.so.26
> >Current language:  auto; currently c
> >
> >(gdb) bt
> >#0  0x40227d32 in xercesc_2_6::XMemory::operator
> new
> >() from /usr/lib/libxerces-c.so.26
> >#1  0x080504a3 in XmlFactory::setParser
> >(this=0xbffff040, type=
> >         {static npos = 4294967295, _M_dataplus =
> >{<std::allocator<char>> =
> >{<__gnu_cxx::new_allocator<char>> = {<No data
> >fields>}, <No data fields>}, _M_p = 0x805d23c
> "sax"}})
> >at XmlFactory.cpp:32
> >#2  0x0804d8dc in main (argc=5, argv=0xbffff1f4) at
> >SaxParsing_classtest.cpp:194
> >
> >
> >##############################
> >My Xml.h class is as follows
> >###############################
> >
> >This implementation gives a segfault
> >class Xml : public DefaultHandler, public
> >XMLFormatTarget {
> >
> >If i use this one below it works
> >//class Xml : public DefaultHandler {
> >  public:
> >
> >     Xml();
> >     virtual ~Xml();
> >
> >
> >
> >########classtest
> >
> >line 194
> >XmlFactory xmlf(c_v ,c_d ,c_n ,c_s ,c_fs ,c_e);
> >Xml *parser = xmlf.setParser(type);
> >
> >...
> >As you can see one declaration is working and the
> >other not. That is the only difference.
> >Any idea ???
> >
> >david
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace
> de stockage pour vos 
> >mails !
> >Créez votre Yahoo! Mail sur
> http://fr.mail.yahoo.com/
> >
>
>---------------------------------------------------------------------
> >To unsubscribe, e-mail:
> xerces-c-dev-unsubscribe@xml.apache.org
> >For additional commands, e-mail:
> xerces-c-dev-help@xml.apache.org
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail:
> xerces-c-dev-help@xml.apache.org
> 
>  


	

	
		
Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails ! 
Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com/

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


Re: Problem with xercesc_2_6::XMemory::operator

Posted by Alberto Massari <am...@datadirect.com>.
Hi David,
have you called XMLPlatforUtils::Initialize()?

Alberto

At 14.45 21/01/2005 +0100, David --- wrote:
>Well it seems that a problem never comes alone.
>
>There seems to be a problem in my program hat is
>causing me some trouble. I'm using a sax parser but i
>get a seg fault when i run the program.
>Here is the output of gdb
>
>Starting program:
>/home/david/Actigenics/libs/C++/base/XmlXercesFactory/SaxParsing_classtest
>-e ISO8859-1 config.pubmed snorna_cancer
>[Thread debugging using libthread_db enabled]
>[New Thread 1079665312 (LWP 13936)]
>
>Program received signal SIGSEGV, Segmentation fault.
>[Switching to Thread 1079665312 (LWP 13936)]
>0x40227d32 in xercesc_2_6::XMemory::operator new ()
>from /usr/lib/libxerces-c.so.26
>Current language:  auto; currently c
>
>(gdb) bt
>#0  0x40227d32 in xercesc_2_6::XMemory::operator new
>() from /usr/lib/libxerces-c.so.26
>#1  0x080504a3 in XmlFactory::setParser
>(this=0xbffff040, type=
>         {static npos = 4294967295, _M_dataplus =
>{<std::allocator<char>> =
>{<__gnu_cxx::new_allocator<char>> = {<No data
>fields>}, <No data fields>}, _M_p = 0x805d23c "sax"}})
>at XmlFactory.cpp:32
>#2  0x0804d8dc in main (argc=5, argv=0xbffff1f4) at
>SaxParsing_classtest.cpp:194
>
>
>##############################
>My Xml.h class is as follows
>###############################
>
>This implementation gives a segfault
>class Xml : public DefaultHandler, public
>XMLFormatTarget {
>
>If i use this one below it works
>//class Xml : public DefaultHandler {
>  public:
>
>     Xml();
>     virtual ~Xml();
>
>
>
>########classtest
>
>line 194
>XmlFactory xmlf(c_v ,c_d ,c_n ,c_s ,c_fs ,c_e);
>Xml *parser = xmlf.setParser(type);
>
>...
>As you can see one declaration is working and the
>other not. That is the only difference.
>Any idea ???
>
>david
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos 
>mails !
>Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com/
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
>For additional commands, e-mail: xerces-c-dev-help@xml.apache.org



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