Debugging Memory Problems with MemoryScape™ : Chapter 1 Locating Memory Problems : Event and Error Notification : Types of Problems : Freeing bss Data
Freeing bss Data
The bss section contains uninitialized data. That is, variables in this section have a name and a size but they do not have a value. Specifically, these variables are your program’s uninitialized static and global variables. Because they exist in a data section, your program cannot free their memory.
The following program tries to free a variable in this section:
static int bss_var;
int main (int argc, char *argv[])
{
void *addr = (void *) (&bss_var);
/* Error: address in bss section */
free(addr);
return 0;
}