Skip to Content.
Sympa Menu

mace-opensaml-users - Re: Problem creating SAMLAttributeStatement in C++

Subject: OpenSAML user discussion

List archive

Re: Problem creating SAMLAttributeStatement in C++


Chronological Thread 
  • From: Manuel Sánchez Cuenca <>
  • To: Scott Cantor <>,
  • Subject: Re: Problem creating SAMLAttributeStatement in C++
  • Date: Tue, 23 Nov 2004 10:12:04 +0100

Scott Cantor wrote:

Hello all, I'm using C++ OpenSAML 1.0, and I'm trying to create a SAMLAttributeStatement. This is the code:

auto_ptr<XMLCh> nombre(XMLString::transcode("nombre"));
auto_ptr<XMLCh> dominio(XMLString::transcode("dominio"));


FWIW, I added some classes that should be used in place of this approach
that make the code a bit shorter, and also insure that the Xerces "release"
method is used to free the results. Technically, relying on delete[] in the
auto_ptr destructor is improper.

It looks like this:

auto_ptr_XMLCh nombre("nombre");


But in the last line, when I try to print the AttributeStatement, an Abort message is generated.


Your code looked ok to me...could you provide a stack trace of the crash? On
Windows this is pretty easy, but assuming you're on Unix, configure with
--enable-debug and then use gdb and it should stop in your sample program
and indicate something.

-- Scott




GDB shows this when the program stops:

Program received signal SIGABRT, Aborted.
[Switching to Thread 1135147952 (LWP 1358)]
0x4081cee9 in raise () from /lib/tls/libc.so.6

And the stack trace is the following:

(gdb) bt
#0 0x4081cee9 in raise () from /lib/tls/libc.so.6
#1 0x4092aedc in ?? () from /lib/tls/libc.so.6
#2 0x081204c0 in ?? ()
#3 0x4081e781 in abort () from /lib/tls/libc.so.6
#4 0x00000000 in ?? ()
#5 0x00000020 in ?? ()
#6 0x4079df84 in std::terminate () from /usr/lib/libstdc++.so.5
#7 0x4079e0f6 in __cxa_throw () from /usr/lib/libstdc++.so.5
#8 0x401840e0 in xercesc_2_5::DOMParentNode::insertBefore () from /usr/local/xerces-c-src_2_5_0/lib/libxerces-c.so.25
#9 0x40183d22 in xercesc_2_5::DOMParentNode::appendChild () from /usr/local/xerces-c-src_2_5_0/lib/libxerces-c.so.25
#10 0x40173fa9 in xercesc_2_5::DOMElementImpl::appendChild () from /usr/local/xerces-c-src_2_5_0/lib/libxerces-c.so.25
#11 0x406bde0d in saml::SAMLAttributeStatement::toDOM () from /opt/shibboleth/lib/libsaml.so.4
#12 0x406d77a3 in saml::operator<< () from /opt/shibboleth/lib/libsaml.so.4
#13 0x08057576 in AAASampleClient::consultarDecision (this=0x81c9f30) at test/sample_client.cxx:408
#14 0x08055a6c in AAASampleSAMLMessage::HandleMessage (this=0x81c9f50, msg=@0x811c1f8) at test/sample_client.cxx:135
#15 0x0808b6dc in AAA_SessionDeliver::Serve (this=0x8180a50) at src/aaa_session_transport.cxx:225
#16 0x0805a74a in AAA_GroupedJob::Serve (this=0x81c9000) at framework.h:716
#17 0x0805a74a in AAA_GroupedJob::Serve (this=0x80fc208) at framework.h:716
#18 0x0805bf6a in AAA_Task::svc (this=0xbffffa10) at framework.h:903
#19 0x4062cb62 in ACE_Task_Base::svc_run (args=0xbffffa10) at Task.cpp:203
#20 0x405ccb7b in ACE_Thread_Adapter::invoke_i (this=0x6) at Thread_Adapter.cpp:150
#21 0x405ccad6 in ACE_Thread_Adapter::invoke (this=0x80ffaf8) at Thread_Adapter.cpp:93
#22 0x405909e0 in ace_thread_adapter (args=0x0) at Base_Thread_Adapter.cpp:131
#23 0x409329b4 in start_thread () from /lib/tls/libpthread.so.0
#24 0x00000000 in ?? ()



--
======================================================
Manuel Sanchez Cuenca
Dept. Ingenieria de la Informacion y las Comunicaciones
Universidad de Murcia - Espana
Tlf: +34 968364644 - Fax: 968364151
email:

www: http://livia.dif.um.es/~lolo
www: http://livia.dif.um.es/~irisgrid





Archive powered by MHonArc 2.6.16.

Top of Page