Project

General

Profile

Bug #11927

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

Added by Dan McDonald 11 months ago. Updated 10 months ago.

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

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

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 11 months ago

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

Updated by Marcel Telka 11 months 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 months 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 10 months 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).

#5

Updated by Electric Monk 10 months ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit d15801816cc716b56ada92df72ee04b7b891291c

commit  d15801816cc716b56ada92df72ee04b7b891291c
Author: Bryan Cantrill <bryan@joyent.com>
Date:   2019-11-21T15:57:15.000Z

    11927 Log, or optionally panic, on zero-length kmem allocations
    Reviewed by: Dan McDonald <danmcd@joyent.com>
    Reviewed by: Jason King <jason.brian.king@gmail.com>
    Approved by: Gordon Ross <gordon.w.ross@gmail.com>

Also available in: Atom PDF