You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by Senaka Fernando <se...@wso2.com> on 2007/12/16 15:51:43 UTC

[Urgent] There is a critical bug that needs to be fixed.

As I went through looking for what could have caused the bug as in
AXIS2C-554, I discovered that we do have constructs as this all over the
code.

set_some_option(struct_type_t * struct_type, type_t * option)
{
    if(struct_type->option)
    {
        option_free(struct_type->option);
    }
    struct_type->option = option;
}

However, most of these implementations have been there since the beginning
of the project, and we have made an assumption that (struct_type->option
!= option) is always true. Making the problem so worse, we don't do the
necessary check which would rather prevent freeing the very same resource
that we are trying to assign.

Therefore, it is critical that we modify each such block of code to have
an additional check that avoids unnecessary freeing of resources. The code
should read,

set_some_option(struct_type_t * struct_type, type_t * option)
{
    if (struct_type->option != option)
    {
        if(struct_type->option)
        {
            option_free(struct_type->option);
        }
        struct_type->option = option;
    }
}

I've started looking for such blocks of code and adding these extra lines,
but, it seems that the issue is so widespread that it requires certain
amount of thorough investigation, where we'll have to look through almost
each and every code file.

We might be able to live with this issue for this release, but, we need to
get this fixed ASAP.

Regards,
Senaka

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


Re: [Urgent] There is a critical bug that needs to be fixed.

Posted by Samisa Abeysinghe <sa...@wso2.com>.
While I agree that this is a problem, the chances that it could cause a 
system crash is minimal as we have fixed the places that this would 
cause trouble along execution paths.
However, that does not take away the need for fixing whatever remaining.
So I am +1 for this fix.

Thanks,
Samisa...

Senaka Fernando wrote:
> As I went through looking for what could have caused the bug as in
> AXIS2C-554, I discovered that we do have constructs as this all over the
> code.
>
> set_some_option(struct_type_t * struct_type, type_t * option)
> {
>     if(struct_type->option)
>     {
>         option_free(struct_type->option);
>     }
>     struct_type->option = option;
> }
>
> However, most of these implementations have been there since the beginning
> of the project, and we have made an assumption that (struct_type->option
> != option) is always true. Making the problem so worse, we don't do the
> necessary check which would rather prevent freeing the very same resource
> that we are trying to assign.
>
> Therefore, it is critical that we modify each such block of code to have
> an additional check that avoids unnecessary freeing of resources. The code
> should read,
>
> set_some_option(struct_type_t * struct_type, type_t * option)
> {
>     if (struct_type->option != option)
>     {
>         if(struct_type->option)
>         {
>             option_free(struct_type->option);
>         }
>         struct_type->option = option;
>     }
> }
>
> I've started looking for such blocks of code and adding these extra lines,
> but, it seems that the issue is so widespread that it requires certain
> amount of thorough investigation, where we'll have to look through almost
> each and every code file.
>
> We might be able to live with this issue for this release, but, we need to
> get this fixed ASAP.
>
> Regards,
> Senaka
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-dev-help@ws.apache.org
>
>
>
>   


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