| Skip Navigation Links | |
| Exit Print View | |
![]() | man pages section 3: Basic Library Functions Oracle Solaris 11 Information Library |
enable_extended_FILE_stdio(3C)
posix_spawnattr_getschedparam(3C)
posix_spawnattr_getschedpolicy(3C)
posix_spawnattr_getsigdefault(3C)
posix_spawnattr_getsigignore_np(3C)
posix_spawnattr_getsigmask(3C)
posix_spawnattr_setschedparam(3C)
posix_spawnattr_setschedpolicy(3C)
posix_spawnattr_setsigdefault(3C)
posix_spawnattr_setsigignore_np(3C)
posix_spawnattr_setsigmask(3C)
posix_spawn_file_actions_addclose(3C)
posix_spawn_file_actions_addclosefrom_np(3C)
posix_spawn_file_actions_adddup2(3C)
posix_spawn_file_actions_addopen(3C)
posix_spawn_file_actions_destroy(3C)
posix_spawn_file_actions_init(3C)
pthread_attr_getdetachstate(3C)
pthread_attr_getinheritsched(3C)
pthread_attr_getschedparam(3C)
pthread_attr_getschedpolicy(3C)
pthread_attr_setdetachstate(3C)
pthread_attr_setinheritsched(3C)
pthread_attr_setschedparam(3C)
pthread_attr_setschedpolicy(3C)
pthread_barrierattr_destroy(3C)
pthread_barrierattr_getpshared(3C)
pthread_barrierattr_setpshared(3C)
pthread_condattr_getpshared(3C)
pthread_condattr_setpshared(3C)
pthread_cond_reltimedwait_np(3C)
pthread_key_create_once_np(3C)
pthread_mutexattr_getprioceiling(3C)
pthread_mutexattr_getprotocol(3C)
pthread_mutexattr_getpshared(3C)
pthread_mutexattr_getrobust(3C)
pthread_mutexattr_setprioceiling(3C)
pthread_mutexattr_setprotocol(3C)
pthread_mutexattr_setpshared(3C)
pthread_mutexattr_setrobust(3C)
pthread_mutex_getprioceiling(3C)
pthread_mutex_reltimedlock_np(3C)
pthread_mutex_setprioceiling(3C)
pthread_rwlockattr_destroy(3C)
pthread_rwlockattr_getpshared(3C)
pthread_rwlockattr_setpshared(3C)
pthread_rwlock_reltimedrdlock_np(3C)
pthread_rwlock_reltimedwrlock_np(3C)
pthread_rwlock_timedrdlock(3C)
pthread_rwlock_timedwrlock(3C)
rctlblk_get_enforced_value(3C)
- debugging features of the umem library
cc [flag… ]file…-lumem [library… ]#include <umem.h>
Thelibumem library provides debugging features that detect memory leaks, buffer overruns,multiple frees, use of uninitialized data, use of freed data, and manyother common programming errors. The activation of the run-time debugging features iscontrolled by environment variables.
When the library detects an error, it writes a description of theerror to an internal buffer that is readable with the::umem_statusmdb(1)dcmd and then callsabort(3C).
This variable contains a list of comma-separated options. Unrecognized options are ignored. Possible options include:
This option enables the recording of auditing information, including thread ID, high-resolution time stamp, and stack trace for the last action (allocation or free) on every allocation. If transaction logging (seeUMEM_LOGGING) is enabled, this auditing information is also logged.
Theframes parameter sets the number of stack frames recorded in the auditing structure. The upper bound for frames is implementation-defined. If a larger value is requested, the upper bound is used instead.
Ifframes is not specified or is not an integer, the default value of 15 is used.
This option also enables theguards option.
If auditing and contents logging (seeUMEM_LOGGING) are enabled, the firstcount bytes of each buffer are logged when they are freed. If a buffer is shorter thancount bytes, it is logged in its entirety.
Ifcount is not specified or is not an integer, the default value of 256 is used.
This option is equivalent toaudit,contents,guards.
This option enables filling allocated and freed buffers with special patterns to help detect the use of uninitialized data and previously freed buffers. It also enables an 8-byte redzone after each buffer that contains0xfeedfacefeedfaceULL.
When an object is freed, it is filled with0xdeadbeef. When an object is allocated, the0xdeadbeef pattern is verified and replaced with0xbaddcafe. The redzone is checked every time a buffer is allocated or freed.
For caches with either constructors or destructors, or both,umem_cache_alloc(3MALLOC) andumem_cache_free(3MALLOC) apply the cache's constructor and destructor, respectively, instead of caching constructed objects. The presence ofassert(3C)s in the destructor verifying that the buffer is in the constructed state can be used to detect any objects returned in an improper state. Seeumem_cache_create(3MALLOC) for details.
The library writes error descriptions to standard error before aborting. These messages are not localized.
To be enabled, this variable should be set to a comma-separated list of in-memory logs. The logs available are:
If theaudit debugging option is set (seeUMEM_DEBUG), the audit structures from previous transactions are entered into this log.
If theaudit debugging option is set, the contents of objects are recorded in this log as they are freed.
If the "contents" debugging option was not set, 256 bytes of each freed buffer are saved.
Records are entered into this log for every failed allocation.
For any of these options, ifsize is not specified, the default value of 64k is used. Thesize parameter must be an integer that can be qualified with K, M, G, or T to specify kilobytes, megabytes, gigabytes, or terabytes, respectively.
Logs that are not listed or that have either a size of 0 or an invalid size are disabled.
The log is disabled if during initialization the requested amount of storage cannot be allocated.
Seeattributes(5) for descriptions of the following attributes:
|
mdb(1),abort(3C),signal(3C),umem_cache_create(3MALLOC),attributes(5)
Oracle Solaris Modular Debugger Guide
Whenlibumem aborts the process usingabort(3C), any existing signal handler forSIGABRT is called. If the signal handler performs allocations, undefined behavior can result.
Some of the debugging features work only for allocations smaller than 16kilobytes in size. Allocations larger than 16 kilobytes could have reduced support.
Activating any of the library's debugging features could significantly increase the library'smemory footprint and decrease its performance.
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Legal Notices | ![]() ![]() |