[asterisk-bugs] [JIRA] (ASTERISK-21847) Segfault due to dahdi_restart and round robin

Ivo Andonov (JIRA) noreply at issues.asterisk.org
Fri May 31 01:13:03 CDT 2013


    [ https://issues.asterisk.org/jira/browse/ASTERISK-21847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=206934#comment-206934 ] 

Ivo Andonov commented on ASTERISK-21847:
----------------------------------------

Please trust me, the problem is there. Read again my 2 points in this report.

The first point in the report cannot be proved by compiling any version - the problem there is just a matter of inconsistency between code and docs / comments in chan_dahdi.c. It would take some 10 minutes max too have a look at it. 

As I stated it is a production environment and I cannot migrate easily from 1.6.2.20 to 1.8. Yes, I can use a different machine but I do not have a bunch of 2k USD priced PRI cards and a spare PRI trunk for testing. The problem is there and I fixed it for myself by memsetting round_robin array in the setup_dahdi function. Might not be the best place, but it solved my problem. I am just pointing this out to Devs in order to make a better Asterisk. I am not complaining and expecting any help, so if you want to close the issue due to not enough data (cores, stack traces etc) without having a minimal look into the pointed places in the code - I cannot argue.


                
> Segfault due to dahdi_restart and round robin
> ---------------------------------------------
>
>                 Key: ASTERISK-21847
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-21847
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Channels/chan_dahdi
>    Affects Versions: 1.8.22.0, 11.4.0
>         Environment: Not relevant
>            Reporter: Ivo Andonov
>            Assignee: Ivo Andonov
>            Severity: Minor
>
> Hello everyone,
> I did not specify a version as I think this one matches any version.
> I'm using Asterisk 1.6.2.20 in a production environment. Every morning I restart the PRI interface using the "dahdi restart" application. The first call that the system gets after that using the PRI generates a segfault. The dial string uses the round robin channel search. 
> After generating a core dump and a bt full I traced the problem down to dahdi_request function in which the struct dahdi_pvt *p gets set to an invalid pointer (0x38 in my case). Looking into the code I think I spoted the possible problem. Leaving it to the developers' opinion, but here are my findings:
> 1. (minor) round_robin array is defined as being of size 32, while the comments / description says "Dial(DAHDI/(g|G|r|R)<group#(0-63)>"... This might be confusing as the array is 32 and not 64. While there is an array length check against the group parameter in recent versions, it is not in 1.6.2.20.
> 2. dahdi_restart destroys all channels and thus invalidates any pointers in the round_robin array, however the latter is not reset to null, and I think this is the cause of the segfault I'm getting. round_robin is memset to 0 at load_module only.
> Best,
> Ivo

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.asterisk.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the asterisk-bugs mailing list