[OE-core] [PATCH] pseudo: fix memory leak and missed privilege drop
Peter A. Bigot
pab at pabigot.com
Mon Aug 26 00:47:43 UTC 2013
On 08/25/2013 07:40 PM, Peter A. Bigot wrote:
> From: "Peter A. Bigot" <pab at pabigot.com>
>
> qemu.bbclass adds PSEUDO_UNLOAD=1 in qemu_run_binary to avoid reference to
> pseudo functions that may not exist in the target environment. This patch
> detects the addition of that variable within the environment to which the
> call applies, even if not present in the parent environment.
>
> As a side effect it fixes a memory leak.
>
> [YOCTO #4843]
Some explanation because this one bothers me:
I ran into bug #4843 when building core-image-minimal on an Ubuntu 12.04
host under x86_64, where the RPM post-install script for udev-hwdb ran
udevadm under qemu-arm. I added some debug code to pseudo and
determined that pseudo_dropenv() was not being invoked for these
commands, making the presence of PSEUDO_UNLOAD=1 irrelevant.
I discovered that the code that implements the unload didn't look at the
environment that applied to the operation, only to the environment in
which pseudo was being run. I also noticed that the need-to-unload code
appears to have a memory leak.
Please look this over; it does work for me, and it seems like the right
approach, but it also seems like the approach couldn't possibly have
worked in the past and should have been detected before so maybe there's
something else going on my environment.
Peter
More information about the Openembedded-core
mailing list