When malloc() Never Returns NULL – Reliability as an Illusion

08/17/2022
by   Gunnar Kudrjavets, et al.
0

For decades, the guidance given to software engineers has been to check the memory allocation results. This validation step is necessary to avoid crashes. However, in user mode, in modern operating systems (OS), such as Android, FreeBSD, iOS, and macOS, the caller does not have an opportunity to handle the memory allocation failures. This behavioral trait results from the actions of a system component called an out-of-memory (OOM) killer. We identify that the only mainstream OS that, by default, lets applications detect memory allocation failures is Microsoft Windows. The false expectation that an application can handle OOM errors can negatively impact its design. The presence of error-handling code creates an illusion of reliability and is wasteful in terms of lines of code and code size. We describe the current behavior of a sample of popular OSs during low-memory conditions and provide recommendations for engineering practices going forward.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
03/08/2022

Quantifying Daily Evolution of Mobile Software Based on Memory Allocator Churn

The pace and volume of code churn necessary to evolve modern software sy...
research
05/14/2018

A Chaos Engineering System for Live Analysis and Falsification of Exception-handling in the JVM

Software systems contain resilience code to handle those failures and un...
research
09/15/2021

Signaling Design for Cooperative Resource Allocation and its Impact to Reliability

Decentralized cooperative resource allocation schemes for robotic swarms...
research
08/02/2017

Revisiting Exception Handling Practices with Exception Flow Analysis

Modern programming languages, such as Java and C#, typically provide fea...
research
05/12/2019

Automating chaos experiments in production

Distributed systems often face transient errors and localized component ...
research
12/14/2017

Choreographies meet Communication Failures

Choreographies are global descriptions of communication structures, insp...
research
12/22/2022

Who Ate My Memory? Towards Attribution in Memory Management

To understand applications' memory usage details, engineers use instrume...

Please sign up or login with your details

Forgot password? Click here to reset