Return-Path: Delivered-To: apmail-ws-axis-c-user-archive@www.apache.org Received: (qmail 46550 invoked from network); 19 Mar 2008 19:35:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Mar 2008 19:35:37 -0000 Received: (qmail 89953 invoked by uid 500); 19 Mar 2008 19:35:33 -0000 Delivered-To: apmail-ws-axis-c-user-archive@ws.apache.org Received: (qmail 89947 invoked by uid 500); 19 Mar 2008 19:35:33 -0000 Mailing-List: contact axis-c-user-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: "Apache AXIS C User List" Reply-To: "Apache AXIS C User List" Delivered-To: mailing list axis-c-user@ws.apache.org Received: (qmail 89936 invoked by uid 99); 19 Mar 2008 19:35:33 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Mar 2008 12:35:33 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [66.39.3.85] (HELO wbm5.pair.net) (66.39.3.85) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Mar 2008 19:34:43 +0000 Received: by wbm5.pair.net (Postfix, from userid 65534) id B7F0234D47; Wed, 19 Mar 2008 15:34:59 -0400 (EDT) Received: from 124.43.227.134 ([124.43.227.134]) (SquirrelMail authenticated user senaka@wso2.com) by webmail5.pair.com with HTTP; Thu, 20 Mar 2008 01:04:58 +0530 (IST) Message-ID: <39015.124.43.227.134.1205955298.squirrel@webmail5.pair.com> In-Reply-To: <6463f4210803191036i4c2aad2dyf492503c71c2c0bc@mail.gmail.com> References: <6463f4210803181417p7e40c622m7e91dbad45414f97@mail.gmail.com> <1205894179.6127.7.camel@manjula> <6463f4210803190710q75bcad69t6c74c976a4a288d2@mail.gmail.com> <51495.124.43.227.134.1205937841.squirrel@webmail5.pair.com> <6463f4210803191036i4c2aad2dyf492503c71c2c0bc@mail.gmail.com> Date: Thu, 20 Mar 2008 01:04:58 +0530 (IST) Subject: Re: Axis2/C, C++ and 'undefined symbol: __gxx_personality_v0' From: "Senaka Fernando" To: axis-c-user@ws.apache.org Reply-To: senaka@wso2.com User-Agent: SquirrelMail/1.4.5 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Checked: Checked by ClamAV on apache.org Hi Alex, Well I think that the extern "C" caused the seg_fault as it couldn't locate the function name. :D... I missed that out I believe. The extern "C" requirement is on the Axis2/C FAQ. Also, the LD_PRELOAD is a satisfactory solution. Also, have you tried setting the LIBS environment variable before building the source? I'd rather prefer the LIBS option, because setting LD_PRELOAD can sometimes be cumbersome. However, if you are using a binary release you have to resort to LD_PRELOAD. Therefore, I think that we can add this to our FAQ too. Regards, Senaka N.B.: CCs sent to user and dev lists. > OK, I used LD_PRELAOD env. variable to preload the libstdc++.so when > starting the axis2_http_server, like this: > > LD_PRELOAD=/usr/lib/libstdc++.so.6 ./axis2_http_server -r ${AXIS2C_HOME} > -l 6 & > > and now my test runs successfully: the client sends a request, I see > in the axis log tracing of function calls that I added to every > function in my service, and then the client receives a response. > > I'm not sure that a solution with LD_PRELOAD is a good one, does any > one have an opinion? > > Anyway, in production all this is going to run as a Apache httpd > module, and we already know how to load libstdc++.so into the httpd, > so I'm going now to build the mod_axis and try to run the test again, > now with httpd :) > > >> But, amazingly I never got, undefined symbol: __gxx_personality_v0. >> >> Instead my server seg_faulted and crashed. > > Senaka, after I did something (I don't remember exactly what, I have > done a lot of experimenting this morning) I also stopped getting > undefined __gxx_personality_v0 and the server just started crashing > (SIGSEGV); and when I run gdb on the core file, I also saw the that > the crash was occurring in the AXIS2_SVC_SKELETON_INIT(). > > But then, after some more experimenting, I added 'extern "C"' to the > functions axis2_get_instance() and axis2_remove_instance() in my test > service, and the test run successfully. Well, at least this is what I > think fixed this crash :). > > So, two things so far: a) preload the libstdc++.so, and b) use 'extern > "C"' on the functions that the Axis calls directly (that is, loads by > name?) > > > Thank you, > > alex. > > > On Wed, Mar 19, 2008 at 10:44 AM, Senaka Fernando wrote: >> Hi Alex, >> >> I tried Axis2/C with a C++ client and it works fine. However, when it >> comes to server side, the message receiver can't invoke the >> AXIS2_SVC_SKELETON_INIT(), probably because it was built in C instead >> of >> C++. Thus, I guess that you will have to rebuild axis2/C using g++ in >> the >> first place. >> >> But, amazingly I never got, undefined symbol: __gxx_personality_v0. >> >> Instead my server seg_faulted and crashed. >> >> Will work on this and let you know if I get through. >> >> Regards, >> Senaka >> >> >> >> > I've tried with two versions: first, I downloaded and compiled latest >> > released Axisc/2 v. 1.3.0 from the http://ws.apache.org/axis2/c; >> after >> > seeing this error, I downloaded a "WSO2 Web Services Framework for >> > C++" from the http://wso2.org/projects/wsf/cpp, where, I hoped, given >> > that the name includes "for C++", the C++ problems would be solved. >> > This release, as I understand, includes Acis2/C version 1.2. The same >> > error (with the same text returned by dlerror(), after I added >> > logging of this) happens in both cases. >> >> > >> > >> > Thank you, >> > >> > alex. >> > >> > >> > On Tue, Mar 18, 2008 at 10:36 PM, Manjula Peiris >> wrote: >> >> Hi Bolgarov, >> >> >> >> What is the Axis2/C version you are using? >> >> >> >> >> >> >> >> >> >> On Tue, 2008-03-18 at 17:17 -0400, Alex Bolgarov wrote: >> >> > Hi, >> >> > >> >> > I'm trying to write a SOAP service using Axis2/C framework. I >> need >> >> the >> >> > service to be written in a C++ language, so as a first step I >> took an >> >> > 'echo service' example from the Axis distribution, renamed it to >> .cpp >> >> > file and compiled/linked it with 'g++' compiler. No compile >> errors >> >> > reported, the resulting .so library I copied to the services >> >> > directory, together with the corresponding services.xml file. >> >> > >> >> > I compiled a sample client that tries to send something to my new >> >> service. >> >> > >> >> > Than I strarted an 'axis2_http_server' application and run the >> >> client, >> >> > which failed with a SOAP error message about failure to load a >> dll. >> >> > >> >> > I found in the Axis2/C source code the place where it loads the >> .so >> >> > file (axutil_class_loader_load_lib() in file 'class_loader.c'), >> and >> >> > added debug log message that reports into the log the exact text >> of >> >> an >> >> > error as it is returned by dlerror() function, not just a message >> >> that >> >> > if failed to load a library, like this (after line 156 of the >> file >> >> > 'class_loader.c'): >> >> > >> >> > if (!dl_handler) >> >> > { >> >> > AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, >> >> > "AXIS2_PLATFORM_LOADLIB error: [%s]", >> >> > AXIS2_PLATFORM_LOADLIB_ERROR); >> >> > >> >> > ... >> >> > ... >> >> > ... >> >> > >> >> > after recompiling the Axis and running the test again, I see in >> the >> >> > log following message: >> >> > >> >> > class_loader.c(159) AXIS2_PLATFORM_LOADLIB error: >> >> > [/home/alexb/wsfcpp-repo/services/my_service/libmy_service.so: >> >> > undefined symbol: __gxx_personality_v0] >> >> > >> >> > I understand that the real problem is that the axis2_http_server >> >> > application is not compiled/linked with the g++ support >> libraries. >> >> > Several years ago I had similar problem when writing a C++ module >> for >> >> > Apache's httpd server, but there the solution was to use an >> httpd's >> >> > directive 'LoadFile' to load the g++ runtime library into the >> httpd >> >> > environment before loading my C++ module with the LoadModule >> >> > directive. >> >> > >> >> > So the question is, does anyone knows how to make the >> >> > axis2_http_server to load the g++ runtime library before it loads >> a >> >> > C++ .so service library? >> >> > >> >> > For the record, I'm doing all this on the Ubuntu 7.10, and here >> is a >> >> > result of running 'g++ --version: >> >> > >> >> > $ g++ --version >> >> > g++ (GCC) 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2) >> >> > >> >> > --------------------------------------------------------------------- >> >> > To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org >> >> > For additional commands, e-mail: axis-c-user-help@ws.apache.org >> >> > >> >> >> >> >> >> --------------------------------------------------------------------- >> >> To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org >> >> For additional commands, e-mail: axis-c-user-help@ws.apache.org >> >> >> >> >> > >> > --------------------------------------------------------------------- >> > To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org >> > For additional commands, e-mail: axis-c-user-help@ws.apache.org >> > >> > >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org >> For additional commands, e-mail: axis-c-user-help@ws.apache.org >> >> > --------------------------------------------------------------------- To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org For additional commands, e-mail: axis-c-user-help@ws.apache.org