groupadd, useradd and rpm.real have the similar error. when set the length of builddir longer than 266(maybe smaller), there are such errors: NOTE: package dbus-1.4.20-r3.0: task do_install: Started *** glibc detected *** groupadd: malloc(): memory corruption: 0x000000000101da70 *** *** glibc detected *** groupadd: malloc(): memory corruption: 0x000000000101da70 *** Then the build would hang, this is caused by the command: PSEUDO_PREFIX=/too/long/path/tmp/sysroots/x86_64-linux/usr PSEUDO_LOCALSTATEDIR=... PSEUDO_PASSWD=... PSEUDO_NOSYMLINKEXP=1 PSEUDO_DISABLED=0 PSEUDO_LOCALSTATEDIR ... /too/long/path/to/tmp/sysroots/x86_64-linux/usr/bin/pseudo groupadd --root /too/long/path/to/tmp/sysroots/qemux86 -r netdev -f 1) I had looked into the code of groupadd, and found that this would happen when it used the glibc function which needs malloc(for example, the access()), so it seemed this was caused by the glibc or pseudo, but I didn't know why it only happened to groupadd/useradd. 2) I had tried not to use pseudo, it worked well: sudo groupadd --root /too/long/path/to/tmp/sysroots/qemux86 -r netdev -f From this, it seemed that the glibc was ok 3) I had tried to write a small piece of code which used the access(), and used pseudo to run it, it worked well: /too/long/path/for/pseudo/settings/and/then/run/pseudo my_app
It's a bug of pseudo, re-assign it to Peter, he will send a patch sooner.
Here is the code that can reproduce the problem simply: The too_long_line path should be longer than 300. #include <unistd.h> #include <stdio.h> main() { if(chroot(too_long_line)){ printf("OOOOOOOOOOOO\n"); } else printf("NNNNNNNNNNN\n"); access("/etc/gshadow", F_OK); } Compile it and use the pseudo to run it, then we can see the error.
Fixed in pseudo 1.3.1. Updating tar balls and such, will send out an oe-core update for this Real Soon.
Merged into master: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=fe5feba665980b515a624bf6f07fff864a9edcfa
Verified with 1.3 master branch git info: bd726660a3b365b8f0f702771afef30dcd05b6d7 Create a build directory, the length is 410. No errors when running "bitbake core-image-sato".