Project

General

Profile

Bug #11927

Log, or optionally panic, on zero-length kmem allocations

Added by Dan McDonald 16 days ago. Updated about 9 hours ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
kernel
Start date:
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:

Description

Joyent bug OS-4297 implements a tracking of zero-length kmem allocations in the kernel. We generally want to discourage these.

Additional fixes to that are needed, and are filed-but-not-fixed as Joyent bug OS-8018. This upstream-it bug should contain both.


Related issues

Related to illumos gate - Bug #11928: rpcmod's clnt_cots can do zero-length kmem allocationsClosed

Actions

History

#1

Updated by Marcel Telka 15 days ago

  • Related to Bug #11928: rpcmod's clnt_cots can do zero-length kmem allocations added
#2

Updated by Marcel Telka 15 days ago

From the kmem_alloc(9f) man page:

NOTES
       kmem_alloc(0, flag) always returns NULL.  kmem_free(NULL, 0) is legal.
#3

Updated by Dan McDonald 10 days ago

This is actually three SmartOS bugs, OS-4194 (initial change with cleanups), OS-8018 (not yet fixed), AND OS-4297 (reduction to log-only in DEBUG by default, vs. panic).

These fixes have been in SmartOS since August of 2015.

commit 92d00144d1e2f01ebc15a0099c0a06a8210c7ccb
Author: Bryan Cantrill <>
AuthorDate: Fri Jul 31 07:14:02 2015 +0000
Commit: Bryan Cantrill <>
CommitDate: Fri Jul 31 07:14:02 2015 +0000

OS-4297 zero-sized allocations should be logged but not warned about
#4

Updated by Dan McDonald about 9 hours ago

Additionally, this code was additionally tested by the DEBUG smoke-testing of nfs-zone. Apart from fixes in #11928, there were no other zero-allocation noises (because of the accompanying fixes in kernel code in this wad).

Also available in: Atom PDF