Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Jul 2019 07:00:55 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 239520] Possible memory leak in newlocale/uselocale
Message-ID:  <bug-239520-227@https.bugs.freebsd.org/bugzilla/>

index | next in thread | raw e-mail

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=239520

            Bug ID: 239520
           Summary: Possible memory leak in newlocale/uselocale
           Product: Base System
           Version: 12.0-RELEASE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: misc
          Assignee: bugs@FreeBSD.org
          Reporter: a.shikov@itcons.net.ua

Hello!

Running the binary compiled from the simple code

#include <locale.h>                                                             

int main() {                                                                    
  while (1) {                                                                   
    locale_t n = newlocale(LC_TIME, "en_AU.UTF-8", (locale_t)0);                
    locale_t old = uselocale(n);                                                
    uselocale(old);                                                             
    freelocale(n);                                                              
  }                                                                             
}                                                                               

results to rapid memory leak. It was tested on 12.0-RELEASE/amd64,
11.2-RELEASE/amd64 and 9.3-RELEASE-p53/i386.

First time the problem with memory leak was found with Perl 5.28 and Perl 5.30
on 12.0-RELEASE/amd64. The firt suspicion was about Perl, but further
discussion came to this test C code. Discussion on rt.perl.org:
https://rt.perl.org/Public/Bug/Display.html?id=134305

-- 
You are receiving this mail because:
You are the assignee for the bug.

help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-239520-227>