Project

General

Profile

Feature #12359

Want a means to set the umem mtbf at runtine

Added by Robert Mustacchi 9 months ago. Updated 8 months ago.

Status:
Closed
Priority:
Normal
Category:
lib - userland libraries
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

libumem today has a private means of injecting failures into a program via the memory allocator. It would be great if we had a way to set this at run-time from a program so we can properly test the out of memory failure paths in various programs and routines without using allocator-specific kludges like trying to map right above the brk and eating up all of the memory, which would then make it harder to continue.

This adds a function umem_setmtbf which allows one to update the already existing umem functionality.


Related issues

Related to illumos gate - Feature #7092: Want support for stdio memory streamsClosedRobert Mustacchi

Actions
#1

Updated by Robert Mustacchi 8 months ago

I tested this by using the functionality in the test suite for the memory streams (7092) work. They all behaved as expected and memory allocations properly failed.

#2

Updated by Robert Mustacchi 8 months ago

  • Related to Feature #7092: Want support for stdio memory streams added
#3

Updated by Electric Monk 8 months ago

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

git commit 1470234269f4edea4cbf270cb2475e4988b788d5

commit  1470234269f4edea4cbf270cb2475e4988b788d5
Author: Robert Mustacchi <rm@fingolfin.org>
Date:   2020-03-26T07:42:53.000Z

    12359 Want a means to set the umem mtbf at runtine
    Reviewed by: John Levon <john.levon@joyent.com>
    Reviewed by: Yuri Pankov <ypankov@fastmail.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF