I don't understand the reasoning here so could somebody please help me out? chan_h323 is causing a segmentation fault when trying to connect a call. I tracked the problem back to chan_h323.c in the oh323_new() function. the code is: tmp = ast_channel_alloc( 1 ); After this point, tmp->pvt is not allocated (null pointer). HOWEVER, in the ast_channel_alloc() function right before the statement: return tmp; tmp->pvt IS allocated. Now between the statements: return tmp; and tmp = ... the pvt structure is getting lost and the tmp->pvt point is set to 0. Has anyone got a clue here? It doesn't make any sense to me at all. John. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20030814/32e635aa/attachment.htm
Jeremy McNamara
2003-Aug-14 19:09 UTC
[Asterisk-Users] ast_channel_alloc() losing pvt struct
Well the code that actually blows up is the rawwriteformat assignment, but yes the channel pvt struct somehow is getting destroyed or corrupted somehow Jeremy McNamara John Fortman wrote:> I don't understand the reasoning here so could somebody please help me > out? > > chan_h323 is causing a segmentation fault when trying to connect a call. > I tracked the problem back to chan_h323.c in the oh323_new() function. > > the code is: tmp = ast_channel_alloc( 1 ); > > After this point, tmp->pvt is not allocated (null pointer). > HOWEVER, in the ast_channel_alloc() function right before the > statement: return tmp; tmp->pvt IS allocated. > > Now between the statements: return tmp; and tmp = ... the pvt > structure is getting lost and the tmp->pvt point is set to 0. > Has anyone got a clue here? It doesn't make any sense to me at all. > > John.