Bug 237656 - "Freed UMA keg (rtentry) was not empty (18 items). Lost 1 pages of memory." seen when running sys/netipsec tests
Summary: "Freed UMA keg (rtentry) was not empty (18 items). Lost 1 pages of memory." ...
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Kristof Provost
URL:
Keywords: vimage
Depends on:
Blocks:
 
Reported: 2019-04-29 19:48 UTC by Enji Cooper
Modified: 2019-07-31 13:33 UTC (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Enji Cooper freebsd_committer 2019-04-29 19:48:01 UTC
I see multiple warnings from the UMA keg code when running the netipsec tunnel tests about leaked UMA kegs. From https://ci.freebsd.org/job/FreeBSD-head-amd64-test/11014/consoleText :

sys/netipsec/tunnel/aes_cbc_128_hmac_sha1:v4  ->  lock order reversal:
 1st 0xffffffff82096810 allprison (allprison) @ /usr/src/sys/kern/kern_jail.c:966
 2nd 0xffffffff820c4830 vnet_sysinit_sxlock (vnet_sysinit_sxlock) @ /usr/src/sys/net/vnet.c:575
stack backtrace:
#0 0xffffffff80c47773 at witness_debugger+0x73
#1 0xffffffff80c474bd at witness_checkorder+0xa7d
#2 0xffffffff80be9008 at _sx_slock_int+0x68
#3 0xffffffff80d0f687 at vnet_alloc+0x117
#4 0xffffffff80ba40a1 at kern_jail_set+0x1bb1
#5 0xffffffff80ba5b00 at sys_jail_set+0x40
#6 0xffffffff810b2e16 at amd64_syscall+0x276
#7 0xffffffff8108b5fd at fast_syscall_common+0x101
Freed UMA keg (rtentry) was not empty (18 items).  Lost 1 pages of memory.
passed  [0.301s]
sys/netipsec/tunnel/aes_cbc_128_hmac_sha1:v6  ->  passed  [0.278s]
sys/netipsec/tunnel/aes_cbc_256_hmac_sha2_256:v4  ->  aesni0: <AES-CBC,AES-XTS,AES-GCM,AES-ICM> on motherboard
Freed UMA keg (rtentry) was not empty (18 items).  Lost 1 pages of memory.
Freed UMA keg (rtentry) was not empty (18 items).  Lost 1 pages of memory.
passed  [0.275s]
sys/netipsec/tunnel/aes_cbc_256_hmac_sha2_256:v6  ->  passed  [0.278s]
sys/netipsec/tunnel/aes_gcm_128:v4  ->  aesni0: detached
Apr 29 18:27:50  kernel: nd6_dad_timer: called with non-tentative address fe80:3::20:9bff:fe26:1c0a(epair2a)

Freed UMA keg (rtentry) was not empty (18 items).  Lost 1 pages of memory.
Freed UMA keg (rtentry) was not empty (18 items).  Lost 1 pages of memory.
passed  [0.285s]
sys/netipsec/tunnel/aes_gcm_128:v6  ->  passed  [0.278s]
sys/netipsec/tunnel/aes_gcm_256:v4  ->  Freed UMA keg (rtentry) was not empty (18 items).  Lost 1 pages of memory.
Freed UMA keg (rtentry) was not empty (18 items).  Lost 1 pages of memory.
passed  [0.287s]
sys/netipsec/tunnel/aes_gcm_256:v6  ->  passed  [0.280s]
sys/netipsec/tunnel/aesni_aes_cbc_128_hmac_sha1:v4  ->  aesni0: <AES-CBC,AES-XTS,AES-GCM,AES-ICM> on motherboard
Freed UMA keg (rtentry) was not empty (18 items).  Lost 1 pages of memory.
Freed UMA keg (rtentry) was not empty (18 items).  Lost 1 pages of memory.
passed  [0.291s]
sys/netipsec/tunnel/aesni_aes_cbc_128_hmac_sha1:v6  ->  passed  [0.292s]
sys/netipsec/tunnel/aesni_aes_cbc_256_hmac_sha2_256:v4  ->  aesni0: detached
Freed UMA keg (rtentry) was not empty (18 items).  Lost 1 pages of memory.
Freed UMA keg (rtentry) was not empty (18 items).  Lost 1 pages of memory.
passed  [0.296s]
sys/netipsec/tunnel/aesni_aes_cbc_256_hmac_sha2_256:v6  ->  passed  [0.257s]
sys/netipsec/tunnel/aesni_aes_gcm_128:v4  ->  aesni0: <AES-CBC,AES-XTS,AES-GCM,AES-ICM> on motherboard
Freed UMA keg (rtentry) was not empty (18 items).  Lost 1 pages of memory.
Freed UMA keg (rtentry) was not empty (18 items).  Lost 1 pages of memory.
passed  [0.256s]
sys/netipsec/tunnel/aesni_aes_gcm_128:v6  ->  passed  [0.254s]
sys/netipsec/tunnel/aesni_aes_gcm_256:v4  ->  Freed UMA keg (rtentry) was not empty (18 items).  Lost 1 pages of memory.
Freed UMA keg (rtentry) was not empty (18 items).  Lost 1 pages of memory.
passed  [0.262s]
sys/netipsec/tunnel/aesni_aes_gcm_256:v6  ->  passed  [0.291s]
sys/netipsec/tunnel/empty:v4  ->  Freed UMA keg (rtentry) was not empty (18 items).  Lost 1 pages of memory.
Freed UMA keg (rtentry) was not empty (18 items).  Lost 1 pages of memory.
passed  [0.285s]
sys/netipsec/tunnel/empty:v6  ->  passed  [0.282s]

Suggested repro:

* Boot a WITNESS enabled kernel with IPSEC support.
* Run `sudo kyua test -k /usr/tests/sys/netipsec/tunnel/Kyuafile`.
Comment 1 Bjoern A. Zeeb freebsd_committer 2019-04-29 19:57:15 UTC
Missing cleanup with some component during VNET shutdown.
Comment 2 Bjoern A. Zeeb freebsd_committer 2019-05-18 18:20:17 UTC
r346890 before I go and look it up again
Comment 3 Ed Maste freebsd_committer 2019-07-31 13:33:49 UTC
(In reply to Bjoern A. Zeeb from comment #2)
Seems r346890 https://reviews.freebsd.org/rS346890 is the wrong revision?