Calling Setlocale(3C) Multiple Time Leaks Memory

(Doc ID 2000322.1)

Last updated on AUGUST 03, 2016

Applies to:

Solaris Operating System - Version 11 11/11 to 11.2 [Release 11.0]
Information in this document applies to any platform.


Calling setlocale(3C) multiple times with different locales may leak memory.

Example output from ::findleaks in mdb:

> ::findleaks -dv
08071010      13 08092f20`strdup+0x29
   Total      13 buffers, 312 bytes
umem_alloc_24 leak: 13 buffers, 24 bytes each, 312 bytes total
            ADDR          BUFADDR        TIMESTAMP           THREAD
                            CACHE          LASTLOG         CONTENTS
         8092f20          808cf80   d2212a75ca56e0                1
                          8071010                0                0



The problem occurs on Solaris 11 without the fix for unpublished bug 20077461.
The problem does not occur on Solaris 10.

The problem only occurs when the locale is different for different calls to setlocale(3C), and the category is different to LC_ALL.
The problem does not occur when setlocale(3C) is called repeatedly with the same locale.


Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms