* [Qemu-devel] [Bug 1245703] [NEW] LD_PREFIX option reads directories recursively in an endless loop
@ 2013-10-28 23:15 Sebastian Macke
2013-10-28 23:24 ` Peter Maydell
` (10 more replies)
0 siblings, 11 replies; 13+ messages in thread
From: Sebastian Macke @ 2013-10-28 23:15 UTC (permalink / raw)
To: qemu-devel
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 20000
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 20000
entries which QEMU is loading every time.
To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1245703/+subscriptions
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Qemu-devel] [Bug 1245703] [NEW] LD_PREFIX option reads directories recursively in an endless loop
2013-10-28 23:15 [Qemu-devel] [Bug 1245703] [NEW] LD_PREFIX option reads directories recursively in an endless loop Sebastian Macke
@ 2013-10-28 23:24 ` Peter Maydell
2013-10-29 0:44 ` [Qemu-devel] [Bug 1245703] " Sebastian Macke
` (9 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: Peter Maydell @ 2013-10-28 23:24 UTC (permalink / raw)
To: Bug 1245703; +Cc: QEMU Developers
On 28 October 2013 23:15, Sebastian Macke <sebastian@macke.de> 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
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Qemu-devel] [Bug 1245703] Re: LD_PREFIX option reads directories recursively in an endless loop
2013-10-28 23:15 [Qemu-devel] [Bug 1245703] [NEW] LD_PREFIX option reads directories recursively in an endless loop Sebastian Macke
2013-10-28 23:24 ` Peter Maydell
@ 2013-10-29 0:44 ` Sebastian Macke
2013-12-08 12:45 ` Antonis Kanouras
` (8 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: Sebastian Macke @ 2013-10-29 0:44 UTC (permalink / raw)
To: qemu-devel
Ok, thanks for the info.
For me it looks like removing the whole path code and putting a one-liner combining two string is the best solution. But maybe I am missing something.
--
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 20000
entries which QEMU is loading every time.
To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1245703/+subscriptions
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Qemu-devel] [Bug 1245703] Re: LD_PREFIX option reads directories recursively in an endless loop
2013-10-28 23:15 [Qemu-devel] [Bug 1245703] [NEW] LD_PREFIX option reads directories recursively in an endless loop Sebastian Macke
2013-10-28 23:24 ` Peter Maydell
2013-10-29 0:44 ` [Qemu-devel] [Bug 1245703] " Sebastian Macke
@ 2013-12-08 12:45 ` Antonis Kanouras
2013-12-08 12:57 ` Antonis Kanouras
` (7 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: Antonis Kanouras @ 2013-12-08 12:45 UTC (permalink / raw)
To: qemu-devel
qemu-arm *and* qemu-arm-static 1.5.0+dfsg-3ubuntu5.1 (AMD64 13.10 host)
are affected by this.
Steps to reproduce:
0. mkdir /mnt/mychroot
1. qemu-debootstrap --arch=armhf wheezy /mnt/mychroot http://ftp.debian.org/debian
2. qemu-arm-static -L /mnt/mychroot /mnt/mychroot/usr/sbin/chroot /mnt/mychroot /bin/sh
In this case, the loop starts when it meets /mnt/mychroot/dev/fd (which
links to /proc/self/fd).
** Bug watch added: Debian Bug tracker #636035
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=636035
** Also affects: qemu (Debian) via
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=636035
Importance: Unknown
Status: Unknown
--
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
Status in “qemu” package in Debian:
Unknown
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 20000
entries which QEMU is loading every time.
To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1245703/+subscriptions
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Qemu-devel] [Bug 1245703] Re: LD_PREFIX option reads directories recursively in an endless loop
2013-10-28 23:15 [Qemu-devel] [Bug 1245703] [NEW] LD_PREFIX option reads directories recursively in an endless loop Sebastian Macke
` (2 preceding siblings ...)
2013-12-08 12:45 ` Antonis Kanouras
@ 2013-12-08 12:57 ` Antonis Kanouras
2013-12-08 13:59 ` Bug Watch Updater
` (6 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: Antonis Kanouras @ 2013-12-08 12:57 UTC (permalink / raw)
To: qemu-devel
One ugly workaround is, in case anyone needs it:
cp -a /usr/bin/qemu-arm-static /mnt/mychroot/
chroot /mnt/mychroot /qemu-arm-static /bin/sh
--
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
Status in “qemu” package in Debian:
Unknown
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 20000
entries which QEMU is loading every time.
To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1245703/+subscriptions
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Qemu-devel] [Bug 1245703] Re: LD_PREFIX option reads directories recursively in an endless loop
2013-10-28 23:15 [Qemu-devel] [Bug 1245703] [NEW] LD_PREFIX option reads directories recursively in an endless loop Sebastian Macke
` (3 preceding siblings ...)
2013-12-08 12:57 ` Antonis Kanouras
@ 2013-12-08 13:59 ` Bug Watch Updater
2015-03-26 21:37 ` Ross Burton
` (5 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: Bug Watch Updater @ 2013-12-08 13:59 UTC (permalink / raw)
To: qemu-devel
** Changed in: qemu (Debian)
Status: Unknown => Confirmed
--
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
Status in “qemu” package in Debian:
Confirmed
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 20000
entries which QEMU is loading every time.
To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1245703/+subscriptions
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Qemu-devel] [Bug 1245703] Re: LD_PREFIX option reads directories recursively in an endless loop
2013-10-28 23:15 [Qemu-devel] [Bug 1245703] [NEW] LD_PREFIX option reads directories recursively in an endless loop Sebastian Macke
` (4 preceding siblings ...)
2013-12-08 13:59 ` Bug Watch Updater
@ 2015-03-26 21:37 ` Ross Burton
2015-03-26 22:37 ` Peter Maydell
2015-03-27 15:45 ` Ross Burton
` (4 subsequent siblings)
10 siblings, 1 reply; 13+ messages in thread
From: Ross Burton @ 2015-03-26 21:37 UTC (permalink / raw)
To: qemu-devel
We're (Yocto Project) hit this often. We're building a root file system
and then using userspace qemu to run binaries inside it (such as fc-
cache). If a cyclic symlink appears in the rootfs, it blows up.
--
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
Status in qemu package in Debian:
Confirmed
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 20000
entries which QEMU is loading every time.
To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1245703/+subscriptions
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Qemu-devel] [Bug 1245703] Re: LD_PREFIX option reads directories recursively in an endless loop
2015-03-26 21:37 ` Ross Burton
@ 2015-03-26 22:37 ` Peter Maydell
0 siblings, 0 replies; 13+ messages in thread
From: Peter Maydell @ 2015-03-26 22:37 UTC (permalink / raw)
To: Bug 1245703; +Cc: QEMU Developers
On 26 March 2015 at 21:37, Ross Burton <ross@burtonini.com> wrote:
> We're (Yocto Project) hit this often. We're building a root file system
> and then using userspace qemu to run binaries inside it (such as fc-
> cache). If a cyclic symlink appears in the rootfs, it blows up.
If you're actually building a rootfs then you're probably
better off using binfmt-misc and chrooting into it rather
than using -L. -L really isn't intended to point at a
full rootfs.
-- PMM
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Qemu-devel] [Bug 1245703] Re: LD_PREFIX option reads directories recursively in an endless loop
2013-10-28 23:15 [Qemu-devel] [Bug 1245703] [NEW] LD_PREFIX option reads directories recursively in an endless loop Sebastian Macke
` (5 preceding siblings ...)
2015-03-26 21:37 ` Ross Burton
@ 2015-03-27 15:45 ` Ross Burton
2017-11-07 17:19 ` Peter Maydell
` (3 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: Ross Burton @ 2015-03-27 15:45 UTC (permalink / raw)
To: qemu-devel
We need to be able to run qemu as not root. Has anyone tried using qemu
with fakechroot?
--
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
Status in qemu package in Debian:
Confirmed
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 20000
entries which QEMU is loading every time.
To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1245703/+subscriptions
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Qemu-devel] [Bug 1245703] Re: LD_PREFIX option reads directories recursively in an endless loop
2013-10-28 23:15 [Qemu-devel] [Bug 1245703] [NEW] LD_PREFIX option reads directories recursively in an endless loop Sebastian Macke
` (6 preceding siblings ...)
2015-03-27 15:45 ` Ross Burton
@ 2017-11-07 17:19 ` Peter Maydell
2017-11-08 9:12 ` Richard Henderson
` (2 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: Peter Maydell @ 2017-11-07 17:19 UTC (permalink / raw)
To: qemu-devel
** Changed in: qemu
Status: New => Confirmed
** Tags added: linux-user
--
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:
Confirmed
Status in qemu package in Debian:
Confirmed
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 20000
entries which QEMU is loading every time.
To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1245703/+subscriptions
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Qemu-devel] [Bug 1245703] Re: LD_PREFIX option reads directories recursively in an endless loop
2013-10-28 23:15 [Qemu-devel] [Bug 1245703] [NEW] LD_PREFIX option reads directories recursively in an endless loop Sebastian Macke
` (7 preceding siblings ...)
2017-11-07 17:19 ` Peter Maydell
@ 2017-11-08 9:12 ` Richard Henderson
2018-04-06 5:53 ` Bug Watch Updater
2020-02-03 9:17 ` Laurent Vivier
10 siblings, 0 replies; 13+ messages in thread
From: Richard Henderson @ 2017-11-08 9:12 UTC (permalink / raw)
To: qemu-devel
I posted a patch a while back that would fix this:
https://patchwork.kernel.org/patch/9512083/
--
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:
Confirmed
Status in qemu package in Debian:
Confirmed
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 20000
entries which QEMU is loading every time.
To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1245703/+subscriptions
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Qemu-devel] [Bug 1245703] Re: LD_PREFIX option reads directories recursively in an endless loop
2013-10-28 23:15 [Qemu-devel] [Bug 1245703] [NEW] LD_PREFIX option reads directories recursively in an endless loop Sebastian Macke
` (8 preceding siblings ...)
2017-11-08 9:12 ` Richard Henderson
@ 2018-04-06 5:53 ` Bug Watch Updater
2020-02-03 9:17 ` Laurent Vivier
10 siblings, 0 replies; 13+ messages in thread
From: Bug Watch Updater @ 2018-04-06 5:53 UTC (permalink / raw)
To: qemu-devel
** Changed in: qemu (Debian)
Status: Confirmed => Fix Released
--
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:
Confirmed
Status in qemu package in Debian:
Fix Released
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 20000
entries which QEMU is loading every time.
To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1245703/+subscriptions
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug 1245703] Re: LD_PREFIX option reads directories recursively in an endless loop
2013-10-28 23:15 [Qemu-devel] [Bug 1245703] [NEW] LD_PREFIX option reads directories recursively in an endless loop Sebastian Macke
` (9 preceding siblings ...)
2018-04-06 5:53 ` Bug Watch Updater
@ 2020-02-03 9:17 ` Laurent Vivier
10 siblings, 0 replies; 13+ messages in thread
From: Laurent Vivier @ 2020-02-03 9:17 UTC (permalink / raw)
To: qemu-devel
Fixed by in 4.1.0 by:
f3a8bdc1d5b2 ("util/path: Do not cache all filenames at startup")
** Changed in: qemu
Status: Confirmed => Fix Released
--
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:
Fix Released
Status in qemu package in Debian:
Fix Released
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 20000
entries which QEMU is loading every time.
To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1245703/+subscriptions
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2020-02-03 9:30 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-28 23:15 [Qemu-devel] [Bug 1245703] [NEW] LD_PREFIX option reads directories recursively in an endless loop Sebastian Macke
2013-10-28 23:24 ` Peter Maydell
2013-10-29 0:44 ` [Qemu-devel] [Bug 1245703] " Sebastian Macke
2013-12-08 12:45 ` Antonis Kanouras
2013-12-08 12:57 ` Antonis Kanouras
2013-12-08 13:59 ` Bug Watch Updater
2015-03-26 21:37 ` Ross Burton
2015-03-26 22:37 ` Peter Maydell
2015-03-27 15:45 ` Ross Burton
2017-11-07 17:19 ` Peter Maydell
2017-11-08 9:12 ` Richard Henderson
2018-04-06 5:53 ` Bug Watch Updater
2020-02-03 9:17 ` Laurent Vivier
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.