Skip to contentSkip to conversation

bash: Disable custom memory allocator

PATCH In review Aníbal Limón 4 participants 6 messages Oct 9, 2015 – Oct 14, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bash: Disable custom memory allocator

Bash is failing trying to allocate memory [1] using the custom memory allocator if we disable it the issue is fixed.

The major distributions also disabled by default [2], so we don't have a good reason to use it.

[YOCTO #8452]

[1] https://bugzilla.yoctoproject.org/show_bug.cgi?id=8452#c0
[2] https://bugzilla.yoctoproject.org/show_bug.cgi?id=8452#c5

---
 meta/recipes-extended/bash/bash.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-extended/bash/bash.inc +1 -1
index c06f157..020409f 100644
@@ -7,7 +7,7 @@ DEPENDS = "ncurses bison-native"
 inherit autotools gettext texinfo update-alternatives ptest
 
 EXTRA_AUTORECONF += "--exclude=autoheader"
-EXTRA_OECONF = "--enable-job-control"
+EXTRA_OECONF = "--enable-job-control --without-bash-malloc"
 
 # If NON_INTERACTIVE_LOGIN_SHELLS is defined, all login shells read the
 # startup files, even if they are not interactive.
Signature · 1 line
1.9.1
#1 lore raw
Quoted 8 lines · Aníbal Limón

Bash is failing trying to allocate memory [1] using the custom memory allocator if we disable it the issue is fixed.

The major distributions also disabled by default [2], so we don't have a good reason to use it.

The fix is OK but commit message needs improvement. The underlying issue is due to bash’s malloc using brk() calls to allocate memory, which fail when address randomization is enabled in kernel. sbrk() based custom allocators are obsolete on the downside we will lose a bit of performance but correctness is more important here.

Quoted 32 lines

[YOCTO #8452]

[1] https://bugzilla.yoctoproject.org/show_bug.cgi?id=8452#c0
[2] https://bugzilla.yoctoproject.org/show_bug.cgi?id=8452#c5

---
meta/recipes-extended/bash/bash.inc | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-extended/bash/bash.inc +0 -0
index c06f157..020409f 100644
@@ -7,7 +7,7 @@ DEPENDS = "ncurses bison-native"

inherit autotools gettext texinfo update-alternatives ptest

EXTRA_AUTORECONF += "--exclude=autoheader"

meta/recipes-extended/bash/bash.inc +1 -1
-EXTRA_OECONF = "--enable-job-control"
+EXTRA_OECONF = "--enable-job-control --without-bash-malloc"

# If NON_INTERACTIVE_LOGIN_SHELLS is defined, all login shells read the

# startup files, even if they are not interactive.
--
1.9.1

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#2 lore raw
In reply to Aníbal Limón

Hey Anibal, a line or 2 in mentioning the issue at the git commit message would be required. You're only mentioning that there is an issue and it would be informational to say what it is, even though the bug number is at the end.

Quoted 31 lines · Aníbal Limón

Bash is failing trying to allocate memory [1] using the custom memory allocator if we disable it the issue is fixed.

The major distributions also disabled by default [2], so we don't have a good reason to use it.

[YOCTO #8452]

[1] https://bugzilla.yoctoproject.org/show_bug.cgi?id=8452#c0
[2] https://bugzilla.yoctoproject.org/show_bug.cgi?id=8452#c5

---
 meta/recipes-extended/bash/bash.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes renamed from meta/recipes-extended/bash/bash.inc +0 -1
-extended/bash/bash.inc

index c06f157..020409f 100644

meta/recipes-extended/bash/bash.inc +1 -1
@@ -7,7 +7,7 @@ DEPENDS = "ncurses bison-native"
 inherit autotools gettext texinfo update-alternatives ptest
 
 EXTRA_AUTORECONF += "--exclude=autoheader"
-EXTRA_OECONF = "--enable-job-control"
+EXTRA_OECONF = "--enable-job-control --without-bash-malloc"
 
 # If NON_INTERACTIVE_LOGIN_SHELLS is defined, all login shells read

the

 # startup files, even if they are not interactive.
#3 lore raw

Hi Benjamin,

This commit is already merged Ross or RP improved the message.

Cheers,
alimon

Quoted 37 lines · Benjamin Esquivel

Hey Anibal, a line or 2 in mentioning the issue at the git commit message would be required. You're only mentioning that there is an issue and it would be informational to say what it is, even though the bug number is at the end.

Quoted 31 lines · Aníbal Limón

Bash is failing trying to allocate memory [1] using the custom memory allocator if we disable it the issue is fixed.

The major distributions also disabled by default [2], so we don't have a good reason to use it.

[YOCTO #8452]

[1] https://bugzilla.yoctoproject.org/show_bug.cgi?id=8452#c0
[2] https://bugzilla.yoctoproject.org/show_bug.cgi?id=8452#c5

---
  meta/recipes-extended/bash/bash.inc | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes renamed from meta/recipes-extended/bash/bash.inc +0 -1
-extended/bash/bash.inc

index c06f157..020409f 100644

meta/recipes-extended/bash/bash.inc +1 -1
@@ -7,7 +7,7 @@ DEPENDS = "ncurses bison-native"
  inherit autotools gettext texinfo update-alternatives ptest
 
  EXTRA_AUTORECONF += "--exclude=autoheader"
-EXTRA_OECONF = "--enable-job-control"
+EXTRA_OECONF = "--enable-job-control --without-bash-malloc"
 
  # If NON_INTERACTIVE_LOGIN_SHELLS is defined, all login shells read

the

  # startup files, even if they are not interactive.
#4 lore raw

Great!

Quoted 48 lines · Aníbal Limón

Hi Benjamin,

This commit is already merged Ross or RP improved the message.

Cheers,
alimon

Quoted 39 lines · Benjamin Esquivel

Hey Anibal, a line or 2 in mentioning the issue at the git commit message would be required. You're only mentioning that there is an issue and it would be informational to say what it is, even though the
bug number is at the end.

Quoted 32 lines · Aníbal Limón

Bash is failing trying to allocate memory [1] using the custom memory allocator if we disable it the issue is fixed.

The major distributions also disabled by default [2], so we don't have a good reason to use it.

[YOCTO #8452]

[1] https://bugzilla.yoctoproject.org/show_bug.cgi?id=8452#c0
[2] https://bugzilla.yoctoproject.org/show_bug.cgi?id=8452#c5

---
  meta/recipes-extended/bash/bash.inc | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes renamed from meta/recipes-extended/bash/bash.inc +0 -1
-extended/bash/bash.inc

index c06f157..020409f 100644

meta/recipes-extended/bash/bash.inc +1 -1
@@ -7,7 +7,7 @@ DEPENDS = "ncurses bison-native"
  inherit autotools gettext texinfo update-alternatives ptest
 
  EXTRA_AUTORECONF += "--exclude=autoheader"
-EXTRA_OECONF = "--enable-job-control"
+EXTRA_OECONF = "--enable-job-control --without-bash-malloc"
 
  # If NON_INTERACTIVE_LOGIN_SHELLS is defined, all login shells

read
the

  # startup files, even if they are not interactive.
#5 lore raw
In reply to Aníbal Limón
Quoted 3 lines · Aníbal Limón

Hi Benjamin,

This commit is already merged Ross or RP improved the message.

I did that since I wanted to get the fix merged due to the issues it was causing on the autobuilder and with the release. Nice find btw!

Cheers,

Richard