[Qemu-devel] [Bug 1245703] [NEW] LD_PREFIX option reads directories recursively in an endless loop

2013-10-28 Thread Sebastian Macke
Public bug reported:

If I run qemu user emulation with -L /path/to/my/sysroot/ in which also
the proc and dev filesystem is mounted QEMU eats my memory until it gets
killed by the kernel.

According to the strace output it follows the symbolic links in the proc
filesystem running forever in a recursive loop.

The easiest solution would be to add in the function "add_dir_maybe" in
the file util/path.c an additional check for symbolic links that it
don't follow them.

Also I don't really understand the need of doing this. A lot of
ressources are wasted everytime QEMU-user is started just by having the
directory structure in memory. In my case this are more than 2
entries which QEMU is loading every time.

** Affects: qemu
 Importance: Undecided
 Status: New

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1245703

Title:
  LD_PREFIX option reads directories recursively in an endless loop

Status in QEMU:
  New

Bug description:
  If I run qemu user emulation with -L /path/to/my/sysroot/ in which
  also the proc and dev filesystem is mounted QEMU eats my memory until
  it gets killed by the kernel.

  According to the strace output it follows the symbolic links in the
  proc filesystem running forever in a recursive loop.

  The easiest solution would be to add in the function "add_dir_maybe"
  in the file util/path.c an additional check for symbolic links that it
  don't follow them.

  Also I don't really understand the need of doing this. A lot of
  ressources are wasted everytime QEMU-user is started just by having
  the directory structure in memory. In my case this are more than 2
  entries which QEMU is loading every time.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1245703/+subscriptions



Re: [Qemu-devel] [Bug 1245703] [NEW] LD_PREFIX option reads directories recursively in an endless loop

2013-10-28 Thread Peter Maydell
On 28 October 2013 23:15, Sebastian Macke  wrote:
> If I run qemu user emulation with -L /path/to/my/sysroot/ in which also
> the proc and dev filesystem is mounted QEMU eats my memory until it gets
> killed by the kernel.
>
> According to the strace output it follows the symbolic links in the proc
> filesystem running forever in a recursive loop.
>
> The easiest solution would be to add in the function "add_dir_maybe" in
> the file util/path.c an additional check for symbolic links that it
> don't follow them.

Yeah, this -L code is just busted. It's really only intended to work
with extremely simple sysroot directories which don't have weird
stuff like proc mounts or symlinks and aren't very big.

If the thing you're looking at isn't like that then you might be better
off using the "static qemu and chroot into the directory" approach
instead.

-- PMM