Paul Thornton | 8 Feb 10:10 2016

Troubleshooting panic on 10.2-RELEASE


My Kernel debugging isn't up to troubleshooting what's going on here.  
We have two out of 10 identical VMs that regularly (between 5 and 20 
hours) panic.  On one, I have recompiled GENERIC to get a kernel.debug 
and have crash dumps being recorded.  They are running GENERIC kernels 
with ZFS-on-root (dmesg at the bottom of this mail).  All of the other 
machines work fine, although the ones that are crashing have the highest 
use at the moment.

The panic is lock-related, and going by pid 12 ([intr]) is interrupt 
related to network tx/rx.

Unread portion of the kernel message buffer:
Sleeping thread (tid 100024, pid 12) owns a non-sleepable lock
KDB: stack backtrace of thread 100024:
#0 0xffffffff80952061 at mi_switch+0xe1
#1 0xffffffff8099043a at sleepq_wait+0x3a
#2 0xffffffff80951a87 at _sleep+0x287
#3 0xffffffff80a040c4 at filt_bpfread+0x94
#4 0xffffffff809079eb at knote+0xdb
#5 0xffffffff80a00acb at catchpacket+0x67b
#6 0xffffffff80a00d20 at bpf_mtap+0x1e0
#7 0xffffffff80a0f634 at ether_nh_input+0x174
#8 0xffffffff80a177d2 at netisr_dispatch_src+0x62
#9 0xffffffff80df8fcf at vmxnet3_rxq_eof+0x4ff
#10 0xffffffff80df86f1 at vmxnet3_legacy_intr+0xe1
#11 0xffffffff8091482b at intr_event_execute_handlers+0xab
#12 0xffffffff80914c76 at ithread_loop+0x96
#13 0xffffffff8091244a at fork_exit+0x9a
(Continue reading)

Alfred Perlstein | 6 Feb 19:50 2016

Macbook donation (wireless needs fixing)

Hey folks,

So now I have a few macbook laptops, they would be really great to run 
FreeBSD except that the wifi isn't supported.

The macbooks have a broadcom BCM43xx chip inside of it for wifi.

Is anyone interested in a *free* (to keep) laptop(s) in exchange for 
finishing this driver?

Getting FreeBSD running on older mac hardware would open up a pretty 
large niche of laptops that are starting to get on the second use market.

Please let me know, I can drop the laptop off anywhere in the SF bay 
area, or possibly toss it into a USPS/UPS box and send it to you.

My only ask is that after 3 months, if the driver isn't somewhat working 
you return it so that it can be donated to a charity supporting the 

freebsd-hackers <at> mailing list
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe <at>"

Dewayne Geraghty | 2 Feb 14:00 2016

Priority settings for gmirror,cam,geom are at the right priority -8?

While waiting for a bunch of build jails to be cleaned, I glanced at
top -PjSuz -mio -o ivcsw
and noticed that g_mirror, geom,cam and rm were experiencing involuntary
context swaps.  I could understand rm, but not the system daemons.  All of
these had a priority of -8.  I'm wondering if the system daemons should be
set at a higher priority, or should I expect a speedier rm if I niced it?

The system almost idle, load averages being { 0.15,  0.48,  0.87 }
    7       0      0     3594     15      0      0      0      0   0.00%
g_mirror gm0
   13       0      0     3512     12      0      0      0      0   0.00%
37223       0      0     1528      7   1523      3      0   1526  90.67% rm
    4       0      0     1938      5      0      0      0      0   0.00% cam
   12       0      0     2018      1      0      0      0      0   0.00%

This is on a xeon 8 core with SSD's whose sole purpose is to build FreeBSD
stable and packages that we require.  The scheduler is 4BSD and
kern.sched.slice=64.  As such I'm stumped as to why "intr" would run out of
its quantum (and its running at priority -72)?

My apologies for any apparent ignorance, I'm a physicist by training and
security manager via necessity. :)
Kind regards, Dewayne
freebsd-hackers <at> mailing list
(Continue reading)

Mateusz Guzik | 1 Feb 06:13 2016

[PATCH 0/2] plug fork use-after-free

From: Mateusz Guzik <mjg <at>>

Quit some time ago I reported a problem with fork and provided a half-assed
patch, see:

Now I got around to fixing the problem in a less hackish manner.

Note that despite the new process possibly immediatley exiting and being
waited on, returning its (possibly now reused PID) is fine - that's the
pid it possibly saw by other means and in worst case the process is racing
with itself.

To reiterate, as it is, the code has use-after-free in procdesc and racct

The first patch is a small cleanup to reduce the number of arguments to
fork1, which was getting out of hand. I don't feel strongly about the
name of the structure used in there.

Mateusz Guzik (2):
  fork: move procdesc-related parameters into a dedicated struct
  fork: plug a use after free of the returned process pointer

 sys/compat/cloudabi/cloudabi_proc.c |  11 ++--
 sys/compat/linux/linux_fork.c       |   6 +-
 sys/kern/init_main.c                |   2 +-
 sys/kern/kern_fork.c                | 125 ++++++++++++++++++++----------------
 sys/kern/kern_kthread.c             |   2 +-
 sys/sys/proc.h                      |   5 +-
(Continue reading)

Yury Efimochev | 29 Jan 19:40 2016

strange malloc behavior


Recently I faced the following problem.

After update from 9.2-RELEASE-p17 to 9.3-RELEASE-p24 on our production
server our service started crashing with SIGSEG/SIGBUS on regular
basis(roughly once a day).

Investigation revealed that crashes were caused by the fact that under
certain circumstances malloc may return pointer on same memory for
multiple clients from different threads.

We suggested that our problem was caused by thread-specific cache, so we
disabled it(by adding 'MALLOC_OPTIONS=7h' to our service environment).
That fixed crashes, but caused 10-100 'std::bad_alloc' exceptions every
day(no 'std::bad_alloc' exceptions before that for months).

Did anyone face similar issues?

Best regards,
Yury Efimochev
freebsd-hackers <at> mailing list
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe <at>"

Norbert Koch | 28 Jan 09:44 2016

impossible to set pata dma mode?


I have to reduce dma mode from udma to wdma2
for a flash device.

In the past this was easy using atacontrol
but, afaiks it seems to be impossible using camcontrol.

 camcontrol negotiate ada0 -M wdma
...You can only modify user parameters

 camcontrol negotiate ada0 -NM wdma
Works, but I see no way how those user
parameters become active parameters as the
driver only reads then in attach as far as
I can see.

It seems like the ata driver's interface
allows to change the current settings
so, why is camcontrol so restrictive?

Thank you,
Norbert Koch
freebsd-hackers <at> mailing list
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe <at>"

(Continue reading)

Alan Somers | 28 Jan 00:55 2016

aesni doesn't play nice with krb5

I'm experimenting with Kerberized NFS, but my performance sucks when I
use krb5p.  I tracked the problem down to an interaction between aesni
and krb5: aes_set_key in kcrypto_aes.c registers for a crypto session
and requests support for two algorithms: CRYPTO_SHA1_HMAC and
CRYPTO_AES_CBC.  aesni(4) supports the latter, but not the former.  So
crypto_select_driver returns cryptosoft and krb5 uses software for
both algorithms.

It's too bad that aesni doesn't support SHA1, but other software like
OpenSSL deals with it by using hardware for AES and software for SHA1.
It seems to me like krb5 could be made to do the same by registering
for two sessions, one for each algorithm.  In fact, it seems like it
would be pretty easy to do.  The changes would probably be confined
strictly to crypto_aes.c.  Is there any reason why this wouldn't work?

freebsd-hackers <at> mailing list
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe <at>"

Marcelo Araujo | 27 Jan 07:21 2016

syslogd(8) with OOM Killer protection

Hi guys,

I would like to know your opinion about this REVIEW[1].
The basic idea is protect by default the syslogd(8) against been killed by
OOM with an option to disable the protection.

Some people like the idea, other people would prefer something more global
where we can protect any daemon by the discretion of our choice.





Marcelo Araujo            (__)araujo <at>
\\\'',) <>   \/  \ ^
Power To Server.         .\. /_)
freebsd-hackers <at> mailing list
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe <at>"

Ivan Radovanovic | 23 Jan 22:17 2016

Unexpected (at least to me) kevent behavior on window size change when in X

Hi everybody,

I am using kevent(2) to monitor for file changes and I just noticed some 
weird behavior - if program is running within X (in MATE terminal), and 
if it is already blocked on kevent when I change window size kevent 
returns -1 and sets errno to 0.

I am not monitoring anything weird - only normal file descriptors (of 
regular files). This is happening on 10.2-STABLE r291381

The only thing which is out of ordinary is that I am doing this from 
mono, but still I am directly invoking libc functions from it, so I 
don't think it can have anything with it.

Kind regards,
freebsd-hackers <at> mailing list
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe <at>"

Mathieu Prevot | 21 Jan 17:19 2016


Dear all,

I would like to connect several connected object (with homogeneous or
heterogenous hardare: intel edison,  samsung artik, apple AX, intel core,
etc) so the calculation needs, the storage/memory, the connection, etc are
decoupled; hence we can reach an ecosystem with several clouds.

How do you recommend to reach that ? from the kernel, a module, or
eventually a software ?

freebsd-hackers <at> mailing list
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe <at>"

Batutis, Ed | 21 Jan 14:34 2016

get number of open files in a process?


I need to determine the number of open files in my process - all types of file handles total - sockets, files, everything.

Does this work reliably for that purpose?

   int num_open = 0; /* number of open files? */
   kinfo_file *inf =  kinfo_getfile(getpid(), &num_open);
   if ( inf ) {



freebsd-hackers <at> mailing list
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe <at>"