Re: RE : RE : problem modifying axutil_stream_t in AXIOM_DATA_SOURCE node
Hi Carl, I tried generating code from the axis2 java latest nightly build for Calculator.wsdl in the AXIS2C_SVN_HEAD\test\resources\wsdl folder. I got the service and client working fine. I used RC2 Windows Binary. If you can provide a sample wsdl to regenerate your problem, We can test it and see whether the problem exists. And also please attach your .c file which implements your business logic. regards Dushshantha On Thu, Apr 17, 2008 at 1:58 AM, Lefrancois, Carl [EMAIL PROTECTED] wrote: What is the debugger trace? I am restricted to win32 :* so if you mean some nix thing then I can't. I will try to get the trace to you tomorrow. Thanks for your help Carl -Message d'origine- De : Samisa Abeysinghe [mailto:[EMAIL PROTECTED] Envoyé : mercredi, avril 16, 2008 14:32 À : Apache AXIS C User List Objet : Re: RE : problem modifying axutil_stream_t in AXIOM_DATA_SOURCE node Is it possible to get the debugger trace? Samisa... Lefrancois, Carl wrote: Here is my latest trace. The crash location has changed. Now it is crashing on the memcpy inside the axutil_stream_write function, which seems like the same error as last time, only trapped earlier. To recap, these are the calls causing the crash: readSize = axutil_stream_read (stream, env, buffer, streamSize); readSize = axutil_stream_write (stream, env, buffer, streamSize); Carl [Wed Apr 16 14:06:04 2008] [debug] c:\ws\axis_svn\src\core\engine\phase.c(121) axis2_handler_t *request_uri_based_dispatcher added to the index 0 of the phase Transport [Wed Apr 16 14:06:04 2008] [debug] c:\ws\axis_svn\src\core\engine\phase.c(121) axis2_handler_t *addressing_based_dispatcher added to the index 1 of the phase Transport [Wed Apr 16 14:06:04 2008] [debug] c:\ws\axis_svn\src\core\engine\phase.c(121) axis2_handler_t *rest_dispatcher added to the index 0 of the phase Dispatch [Wed Apr 16 14:06:04 2008] [debug] c:\ws\axis_svn\src\core\engine\phase.c(121) axis2_handler_t *soap_message_body_based_dispatcher added to the index 1 of the phase Dispatch [Wed Apr 16 14:06:04 2008] [debug] c:\ws\axis_svn\src\core\engine\phase.c(121) axis2_handler_t *soap_action_based_dispatcher added to the index 2 of the phase Dispatch [Wed Apr 16 14:06:04 2008] [debug] c:\ws\axis_svn\src\core\engine\phase.c(121) axis2_handler_t *dispatch_post_conditions_evaluator added to the index 0 of the phase PostDispatch [Wed Apr 16 14:06:04 2008] [debug] c:\ws\axis_svn\src\core\engine\phase.c(121) axis2_handler_t *context_handler added to the index 1 of the phase PostDispatch [Wed Apr 16 14:06:04 2008] [debug] c:\ws\axis_svn\src\core\deployment\conf_builder.c(233) no custom dispatching order found continue with default dispatching order [Wed Apr 16 14:06:04 2008] [debug] c:\ws\axis_svn\util\src\class_loader.c(141) Object loaded successfully [Wed Apr 16 14:06:04 2008] [debug] c:\ws\axis_svn\util\src\class_loader.c(141) Object loaded successfully [Wed Apr 16 14:06:04 2008] [error] c:\ws\axis_svn\util\src\dir_handler.c(220) No files in the path H:\Projets\SOA\Axis2c\axis_svn\build\deploy/modules. [Wed Apr 16 14:06:04 2008] [error] c:\ws\axis_svn\util\src\dir_handler.c(220) No files in the path H:\Projets\SOA\Axis2c\axis_svn\build\deploy/services. [Wed Apr 16 14:06:04 2008] [debug] c:\ws\axis_svn\src\core\phaseresolver\phase_resolver.c(117) Service name is : __ANONYMOUS_SERVICE__ -Message d'origine- De : Samisa Abeysinghe [mailto:[EMAIL PROTECTED] Envoyé : mercredi, avril 16, 2008 12:08 À : Apache AXIS C User List Objet : Re: problem modifying axutil_stream_t in AXIOM_DATA_SOURCE node Lefrancois, Carl wrote: Hi list, Please help with some unexpected behaviour. This morning I started using the functions axutil_stream_read and axutil_stream_write to modify the contents of an AXIOM_DATA_SOURCE node in my payload, and I am getting program crashes. Can you send in the traces of the crashes? Samisa... I am using WSDL2C generated code stubs, and modifying the axis2_stub_xx.c file to make changes to the payload. I inserted a function at the top of the file and call this function just after the payload is generated on the line: payload = adb_type_serialize(_type, env, NULL, NULL, AXIS2_TRUE, NULL, NULL); modify_stream_contents(payload, env); My function navigates the payload node to find the AXIOM_DATA_SOURCE node. It then reads the contents into a buffer and does some modification, then writes the modified data back into the stream. I'm including a minimal version of the function below that only reads the stream and writes it back again without modification. The behaviour is strange: if the axutil_stream_write function specifies a small count, the program doesn't crash. In my case, I can specify up to 1665 bytes without a crash. (the full message size is 16860) Am I doing
RE : RE : problem modifying axutil_stream_t in AXIOM_DATA_SOURCE node
What is the debugger trace? I am restricted to win32 :* so if you mean some nix thing then I can't. I will try to get the trace to you tomorrow. Thanks for your help Carl -Message d'origine- De : Samisa Abeysinghe [mailto:[EMAIL PROTECTED] Envoyé : mercredi, avril 16, 2008 14:32 À : Apache AXIS C User List Objet : Re: RE : problem modifying axutil_stream_t in AXIOM_DATA_SOURCE node Is it possible to get the debugger trace? Samisa... Lefrancois, Carl wrote: Here is my latest trace. The crash location has changed. Now it is crashing on the memcpy inside the axutil_stream_write function, which seems like the same error as last time, only trapped earlier. To recap, these are the calls causing the crash: readSize = axutil_stream_read (stream, env, buffer, streamSize); readSize = axutil_stream_write (stream, env, buffer, streamSize); Carl [Wed Apr 16 14:06:04 2008] [debug] c:\ws\axis_svn\src\core\engine\phase.c(121) axis2_handler_t *request_uri_based_dispatcher added to the index 0 of the phase Transport [Wed Apr 16 14:06:04 2008] [debug] c:\ws\axis_svn\src\core\engine\phase.c(121) axis2_handler_t *addressing_based_dispatcher added to the index 1 of the phase Transport [Wed Apr 16 14:06:04 2008] [debug] c:\ws\axis_svn\src\core\engine\phase.c(121) axis2_handler_t *rest_dispatcher added to the index 0 of the phase Dispatch [Wed Apr 16 14:06:04 2008] [debug] c:\ws\axis_svn\src\core\engine\phase.c(121) axis2_handler_t *soap_message_body_based_dispatcher added to the index 1 of the phase Dispatch [Wed Apr 16 14:06:04 2008] [debug] c:\ws\axis_svn\src\core\engine\phase.c(121) axis2_handler_t *soap_action_based_dispatcher added to the index 2 of the phase Dispatch [Wed Apr 16 14:06:04 2008] [debug] c:\ws\axis_svn\src\core\engine\phase.c(121) axis2_handler_t *dispatch_post_conditions_evaluator added to the index 0 of the phase PostDispatch [Wed Apr 16 14:06:04 2008] [debug] c:\ws\axis_svn\src\core\engine\phase.c(121) axis2_handler_t *context_handler added to the index 1 of the phase PostDispatch [Wed Apr 16 14:06:04 2008] [debug] c:\ws\axis_svn\src\core\deployment\conf_builder.c(233) no custom dispatching order found continue with default dispatching order [Wed Apr 16 14:06:04 2008] [debug] c:\ws\axis_svn\util\src\class_loader.c(141) Object loaded successfully [Wed Apr 16 14:06:04 2008] [debug] c:\ws\axis_svn\util\src\class_loader.c(141) Object loaded successfully [Wed Apr 16 14:06:04 2008] [error] c:\ws\axis_svn\util\src\dir_handler.c(220) No files in the path H:\Projets\SOA\Axis2c\axis_svn\build\deploy/modules. [Wed Apr 16 14:06:04 2008] [error] c:\ws\axis_svn\util\src\dir_handler.c(220) No files in the path H:\Projets\SOA\Axis2c\axis_svn\build\deploy/services. [Wed Apr 16 14:06:04 2008] [debug] c:\ws\axis_svn\src\core\phaseresolver\phase_resolver.c(117) Service name is : __ANONYMOUS_SERVICE__ -Message d'origine- De : Samisa Abeysinghe [mailto:[EMAIL PROTECTED] Envoyé : mercredi, avril 16, 2008 12:08 À : Apache AXIS C User List Objet : Re: problem modifying axutil_stream_t in AXIOM_DATA_SOURCE node Lefrancois, Carl wrote: Hi list, Please help with some unexpected behaviour. This morning I started using the functions axutil_stream_read and axutil_stream_write to modify the contents of an AXIOM_DATA_SOURCE node in my payload, and I am getting program crashes. Can you send in the traces of the crashes? Samisa... I am using WSDL2C generated code stubs, and modifying the axis2_stub_xx.c file to make changes to the payload. I inserted a function at the top of the file and call this function just after the payload is generated on the line: payload = adb_type_serialize(_type, env, NULL, NULL, AXIS2_TRUE, NULL, NULL); modify_stream_contents(payload, env); My function navigates the payload node to find the AXIOM_DATA_SOURCE node. It then reads the contents into a buffer and does some modification, then writes the modified data back into the stream. I'm including a minimal version of the function below that only reads the stream and writes it back again without modification. The behaviour is strange: if the axutil_stream_write function specifies a small count, the program doesn't crash. In my case, I can specify up to 1665 bytes without a crash. (the full message size is 16860) Am I doing something bad here? Are these stream functions meant to be used in another way? The crash appears to be because of a buffer overflow that mangles the state of other variables in the system. (Axis2/C is version 1.3.0) Any help is appreciated. Carl void modify_stream_contents(axiom_node_t *_node, const axutil_env_t *env) { axiom_data_source_t *dataSource = NULL; axutil_stream_t * stream = NULL; axiom_node_t *currentNode = NULL; axis2_char_t *buffer = NULL; size_t streamSize = 0; size_t readSize = 0; // navigate