Public bug reported:

Hello,

I heavily use ubuntu as a build platform to build and package C/C++ components.
Some components are checked in a valgrind environment. On some of them, I am
reported with the described memory leak due to bash.

It seems this bug has been fixed in other distros but not in Debian nor Ubuntu.
There is an old bug from bash 4.3 which can be reproduce easily that way:

```
$ valgrind --leak-check=full /bin/bash -c 'exit 0'
...
==565== 2 bytes in 1 blocks are definitely lost in loss record 14 of 269
==565==    at 0x483577F: malloc (vg_replace_malloc.c:299)
==565==    by 0x195E8D: xmalloc (in /bin/bash)
==565==    by 0x18F51A: set_default_locale (in /bin/bash)
==565==    by 0x135EE6: main (in /bin/bash)
...
```

This has been fixed in fedora that way (and the patch is still here in the
latest RPMs):

```
>cat bash-4.3-memleak-lc_all.patch
diff -up bash-4.3/locale.c.old bash-4.3/locale.c
--- bash-4.3/locale.c.old       2015-07-15 11:55:00.002857301 +0200
+++ bash-4.3/locale.c   2015-07-15 11:48:36.698086257 +0200
@@ -77,8 +77,6 @@ set_default_locale ()
 {
 #if defined (HAVE_SETLOCALE)
   default_locale = setlocale (LC_ALL, "");
-  if (default_locale)
-    default_locale = savestring (default_locale);
 #endif /* HAVE_SETLOCALE */
   bindtextdomain (PACKAGE, LOCALEDIR);
   textdomain (PACKAGE);
```

Do you think it is worth integrating that kind of patch in your package ?
Regards,
Stac

** Affects: bash (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1860133

Title:
  Memory leak on set_default_locale

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/bash/+bug/1860133/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to