[asterisk-dev] chan_iax problem (was Re: Thoughts on Asterisk release management
Russell Bryant
russell at digium.com
Fri Sep 21 09:06:19 CDT 2007
Luigi Rizzo wrote:
<snip>
Thank you very much for debugging the problem!
> HOWEVER, the problem lies elsewhere, in this initialization in
> chan_iax2.c::build_user() near line 9679:
>
> struct iax2_user tmp_user = {
> .name = name,
> };
>
> (there are several other instances like this).
>
> The field "name" is an AST_STRING_FIELD, and for some
> reason, at least with my compiler (gcc 2.95 on FreeBSD 4.11)
> the initialization leaves it to NULL instead of setting the
> correct value.
>
> Why that happens, i have no idea; however it
> is really something that we should figure out because it is critical.
> Patching ast_str_hash() to handle the NULL argument will prevent
> the crash but not fix the problem.
Well, this is certainly bizarre. We rely on initializer lists like this all
over the place in Asterisk. I have never seen one not work. Perhaps it doesn't
like that tmp_user.name is of type ast_string_field and name is const char *?
(ast_string_field is just a typedef to const char * ...)
To Stephen Davies, or anyone else that has seen the problem, what kind of system
and what version of gcc are you using?
--
Russell Bryant
Software Engineer
Digium, Inc.
More information about the asterisk-dev
mailing list