# What does this mean: ath0: bb hang detected?



## idude (Jan 27, 2021)

Hello,

I'm on FreeBSD 12.2-RELEASE, I'm getting this message on my screen, it covers everything even when I'm editing a file, it goes right on top, and it only goes away when I press enter:


```
ath0: bb hang detected (0x4), resetting
```

It is very annoying, and I don't seem to be able to get rid of it!  It started when I installed networkmgr and created a /usr/local/etc/doas.conf with the following lines:


```
permit nopass keepenv :wheel cmd netcardmgr
permit nopass keepenv :wheel cmd detect-nics
permit nopass keepenv :wheel cmd detect-wifi
permit nopass keepenv :wheel cmd ifconfig
permit nopass keepenv :wheel cmd service
permit nopass keepenv :wheel cmd wpa_supplicant
```

Networkmgr, put these lines on my /etc/rc.conf file:


```
wlans_ath0="wlan0"
ifconfig_wlan0="WPA DHCP"
```

If I'm running X I also notice that this message comes up when powering down!


----------



## SirDice (Jan 27, 2021)

idude said:


> I'm getting this message on my screen, it covers everything even when I'm editing a file, it goes right on top, and it only goes away when I press enter


Some diagnostic messages are printed to the console:

```
*.err;kern.warning;auth.notice;mail.crit                /dev/console
```
That's what you're seeing printed on the screen. Usually a CTRL-L (screen refresh) clears them. You can also switch to vtty2 and work there. Or disable that line in /etc/syslog.conf. 

The best way however is to try and fix the issue that's causing these messages to be printed in the first place. 


```
ath0: bb hang detected (0x4), resetting
```
This refers to an issue with the if_ath(4) driver. Apparently it has a problem every now and then.


----------



## idude (Jan 28, 2021)

After searching quite a bit I have found that there are quite a few people with the same or very similar problem with ath0, but unfortunately there are no solutions to this problem perhaps your advice to comment out that line might be the best solution.


----------



## mark_j (Jan 28, 2021)

I don't think it's a problem. The code indicates that's it's informing you that a hang was detected because it missed a message (beacon frame) and it is resetting the device. If it's continual then you have a problem. If it's sporadic then do as SirDice says, and suppress the message(s).


----------



## idude (Jan 28, 2021)

I commented that line out and the message still comes up!


```
1 # $FreeBSD: releng/12.2/usr.sbin/syslogd/syslog.conf 338146 2018-08-21 17:01:47Z brd $
  2 #
  3 #       Spaces ARE valid field separators in this file. However,
  4 #       other *nix-like systems still insist on using tabs as field
  5 #       separators. If you are sharing this file between systems, you
  6 #       may want to use only tabs as field separators here.
  7 #       Consult the syslog.conf(5) manpage.
  8 #*.err;kern.warning;auth.notice;mail.crit               /dev/console
  9 *.notice;authpriv.none;kern.debug;lpr.info;mail.crit;news.err   /var/log/messages
10 security.*                                      /var/log/security
11 auth.info;authpriv.info                         /var/log/auth.log
12 mail.info                                       /var/log/maillog
13 cron.*                                          /var/log/cron
14 !-devd
15 *.=debug                                        /var/log/debug.log
16 *.emerg                                         *
```


----------



## SirDice (Jan 28, 2021)

idude said:


> I commented that line out and the message still comes up!


Did you restart syslogd(8)?


----------



## Snurg (Jan 28, 2021)

Just a tip...
I never use the console for sessions, just for watching the output in case something happens.
For my needs the seven terminals from ALT-F2 to -F8 are way enough.


----------



## idude (Jan 28, 2021)

SirDice said:


> Did you restart syslogd(8)?


I restarted the computer.


----------



## mark_j (Jan 29, 2021)

The message is output via device_printf(9), which calls printf(9). The latter says:


> writes to the console as well as to    the logging facility


It doesn't mention what level, but assuming you've commented out the offending option for syslog, it must mean it's bleeding through stdout/stderr. That would suggest a bug.


----------



## idude (Jan 29, 2021)

It's weird, it's as if there were two screens, one for everything you do in FreeBSD and another for this message.  If I'm using vim, for example, this message pops up right in front of what I'm editing in vim covering it, if I keep typing without seeing vim, it still prints in vim, I will see vim if I press enter, but 1 or 2 minutes later that same message comes up again.


----------

