[Bug 206334] [ath] panic integer divide fault

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Fri Jan 22 17:33:03 UTC 2016


John Baldwin <jhb at FreeBSD.org> changed:

           What    |Removed                     |Added
           Hardware|amd64                       |Any
                 CC|                            |adrian at freebsd.org,
                   |                            |jhb at FreeBSD.org
            Summary|panic integer divide fault  |[ath] panic integer divide
                   |                            |fault

--- Comment #1 from John Baldwin <jhb at FreeBSD.org> ---
>From the core.txt, the crash occurred due to a divide by zero in the ath(4)
driver.  Specifically, this line in ar9300_ani.c:

    ofdm_phy_err_rate =
        ani_state->ofdm_phy_err_count * 1000 / ani_state->listen_time;

This means 'listen_time' must be zero.

Some other places in the debugging code handle the listen_time == 0 case
explicitly, e.g.:

        /* express ofdm_phy_err_count as errors/second */
        log_data.ofdm_phy_err_count = ani_state->listen_time ?
            ani_state->ofdm_phy_err_count * 1000 / ani_state->listen_time : 0;
        /* express cck_phy_err_count as errors/second */
        log_data.cck_phy_err_count =  ani_state->listen_time ?
            ani_state->cck_phy_err_count * 1000 / ani_state->listen_time  : 0;

There is this comment here where listen_time is updated:

    /* XXX beware of overflow? */
    ani_state->listen_time += listen_time;

I suspect you were bitten by the overflow wrapping to zero.  I've added Adrian
who might have a suggestion on how best to handle the overflow to zero.  The
code is the same in HEAD so I suspect this is busted there as well.

You are receiving this mail because:
You are the assignee for the bug.

More information about the freebsd-bugs mailing list