All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Weil <sw@weilnetz.de>
To: "Alex Bennée" <alex.bennee@linaro.org>
Cc: "Thomas Huth" <thuth@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	qemu-devel@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: qemu user mode fails to run programs with large VM / built with address sanitizer (was: Re: [PATCH v4 4/4] meson: Warn when TCI is selected but TCG backend is available)
Date: Thu, 28 Jan 2021 07:51:59 +0100	[thread overview]
Message-ID: <7615aa95-79b1-45d3-f998-6ba3f2f33f35@weilnetz.de> (raw)
In-Reply-To: <87tur2vyif.fsf@linaro.org>

Am 27.01.21 um 22:47 schrieb Alex Bennée:

> Stefan Weil<sw@weilnetz.de>  writes:
>> I recently tried running tesseract with qemu-x86_64 because I had
>> expected that it might trigger some unimplemented TCG opcodes.
> qemu-x86-64 is a poor choice as a relatively under maintained front-end
> doesn't emulate a particularly new CPU or take advantage of the new TCG
> features. ARM64 is pretty good because the default cpu for linux-user is
> CPU max which a) enables all ISA features we have and b) exposes them
> fairly easily to guest detection routines which probe feature registers.
>
>> Instead
>> it showed a general problem for native TCG: qemu-x86_64 allocates too
>> much memory for tesseract and gets killed by the Linux kernel OOM
>> handler.
> Do you have a command line? That sounds like something that should be
> fixed.


The problem occurred with a locally built tesseract, but I now found 
that it is more general.

Any program which was compiled with address sanitizer uses huge virtual 
memory (TB) right at the start. QEMU user mode tries to allocate that 
memory until it is killed by the Linux kernel OOM handler.

A simple hello program compiled with "gcc -fsanitize=address hello.c" is 
sufficient to show the problem. Just run it with "qemu-x86_64 a.out".

I did not test but expect the same problem for other architectures, too, 
unless their VM is more limited.

Regards,

Stefan




  parent reply	other threads:[~2021-01-28  6:54 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-25 14:45 [PATCH v4 0/4] meson: Try to clarify TCG / TCI options for new users Philippe Mathieu-Daudé
2021-01-25 14:45 ` [PATCH v4 1/4] configure: Fix --enable-tcg-interpreter Philippe Mathieu-Daudé
2021-01-25 16:36   ` Paolo Bonzini
2021-01-25 17:10   ` Daniel P. Berrangé
2021-01-26 19:46   ` Stefan Weil
2021-01-25 14:45 ` [PATCH v4 2/4] configure: Improve TCI feature description Philippe Mathieu-Daudé
2021-01-25 16:44   ` Daniel P. Berrangé
2021-01-25 14:45 ` [PATCH v4 3/4] meson: Explicit TCG backend used Philippe Mathieu-Daudé
2021-01-25 16:45   ` Daniel P. Berrangé
2021-01-25 14:45 ` [PATCH v4 4/4] meson: Warn when TCI is selected but TCG backend is available Philippe Mathieu-Daudé
2021-01-25 16:46   ` Daniel P. Berrangé
2021-01-25 16:47   ` Daniel P. Berrangé
2021-01-25 17:05     ` Philippe Mathieu-Daudé
2021-01-25 18:58       ` Stefan Weil
2021-01-25 19:02         ` Richard Henderson
2021-01-25 21:02           ` Stefan Weil
2021-01-25 22:35             ` Richard Henderson
2021-01-26 11:40               ` Stefan Weil
2021-01-26 17:24                 ` Alex Bennée
2021-01-26 19:44                   ` Stefan Weil
2021-01-26 20:07                     ` Paolo Bonzini
2021-01-26 20:10                       ` Stefan Weil
2021-01-26 22:39                     ` Richard Henderson
2021-01-27  6:53                       ` Stefan Weil
2021-01-27 17:19                         ` Richard Henderson
2021-01-27 19:52                         ` Alex Bennée
2021-01-27 20:49                           ` Stefan Weil
2021-01-27 21:47                             ` Alex Bennée
2021-01-28  2:49                               ` Stefan Weil
2021-01-28  6:51                               ` Stefan Weil [this message]
2021-01-28  8:29                                 ` qemu user mode fails to run programs with large VM / built with address sanitizer (was: Re: [PATCH v4 4/4] meson: Warn when TCI is selected but TCG backend is available) Richard Henderson
2021-01-27 10:02                   ` [PATCH v4 4/4] meson: Warn when TCI is selected but TCG backend is available Daniel P. Berrangé
2021-01-27 12:34                     ` Alex Bennée
2021-01-26 10:34           ` Daniel P. Berrangé
2021-01-29  8:06 ` [PATCH v4 0/4] meson: Try to clarify TCG / TCI options for new users Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7615aa95-79b1-45d3-f998-6ba3f2f33f35@weilnetz.de \
    --to=sw@weilnetz.de \
    --cc=alex.bennee@linaro.org \
    --cc=berrange@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.