WSDL2C: 
--------

                 Key: AXIS2-3462
                 URL: https://issues.apache.org/jira/browse/AXIS2-3462
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: codegen
    Affects Versions: 1.3
         Environment: Windows XP
            Reporter: Dave Meier
            Priority: Blocker


Using:

org.apache.axis2.wsdl.WSDL2C -f -uri aewebservices70.wsdl -o 
aewebservicesaxis70 -d adb -ss -sd

Problem:

In the serialize methods, the namespaces hashtable is being freed for many of 
my adb objects, but one object that is nested frees this hashtable, then 
returns and the calling serialize method then tries to use the freed table and 
crashes.

Here's a code fragment showing the calling serialize method 
(adb_NameValue_serialize(...)):

  if (!_NameValue->is_valid_setValueBy)
  {
    /* no need to complain for minoccurs=0 element */
  }
  else
  {
    start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, 
sizeof(axis2_char_t) *
      (4 + axutil_strlen(p_prefix) + 
      axutil_strlen("setValueBy") + 
      ADB_DEFAULT_DIGIT_LIMIT* 2)); 

    end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, 
sizeof(axis2_char_t) *
      (5 + ADB_DEFAULT_DIGIT_LIMIT + axutil_strlen("setValueBy")));

    /*
    * parsing setValueBy element
    */

    sprintf(start_input_str, "<%s%ssetValueBy",
      p_prefix?p_prefix:"",
      (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); 

    start_input_str_len = axutil_strlen(start_input_str);
    sprintf(end_input_str, "</%s%ssetValueBy>",
      p_prefix?p_prefix:"",
      (p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
    end_input_str_len = axutil_strlen(end_input_str);

    if(!adb_Set_Value_By_is_particle())
    {
      axutil_stream_write(stream, env, start_input_str, start_input_str_len);
    }

    adb_Set_Value_By_serialize(_NameValue->property_setValueBy, 
      env, current_node, parent_element,
      adb_Set_Value_By_is_particle() || AXIS2_FALSE, namespaces, 
next_ns_index);  // THIS IS WHERE namespaces gets freed

    if(!adb_Set_Value_By_is_particle())
    {
      axutil_stream_write(stream, env, end_input_str, end_input_str_len);
    }

  } 

  if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, 
"urn:aewebservicesaxis70", AXIS2_HASH_KEY_STRING)))  // THIS IS WHERE it gets 
used again and crashes
...

I will attach my wsdl file and the two adb files involved in the code above ( 
adb_NameValue.c which contains the above code and adb_Set_Value_By.c which 
contains the adb_Set_Value_By_serialize(...) method that frees the namespaces 
hashtable.


-- 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to