Re: [PATCH-for-5.0] qga-posix: Avoid crashing process when failing to allocate memory

2020-03-31 Thread Philippe Mathieu-Daudé
On 3/30/20 7:06 PM, Daniel P. Berrangé wrote: On Mon, Mar 30, 2020 at 06:04:49PM +0200, Philippe Mathieu-Daudé wrote: Cc'ing the ppl who responded the thread you quoted. On 3/30/20 4:11 PM, Markus Armbruster wrote: Philippe Mathieu-Daudé writes: --- qga/commands-posix.c | 8 +++- 1 f

Re: [PATCH-for-5.0] qga-posix: Avoid crashing process when failing to allocate memory

2020-03-30 Thread Daniel P . Berrangé
On Mon, Mar 30, 2020 at 06:04:49PM +0200, Philippe Mathieu-Daudé wrote: > Cc'ing the ppl who responded the thread you quoted. > > On 3/30/20 4:11 PM, Markus Armbruster wrote: > > Philippe Mathieu-Daudé writes: > > --- > > qga/commands-posix.c | 8 +++- > > 1 file changed, 7 insertions(+),

Re: [PATCH-for-5.0] qga-posix: Avoid crashing process when failing to allocate memory

2020-03-30 Thread Daniel P . Berrangé
On Mon, Mar 30, 2020 at 05:38:05PM +0100, Dr. David Alan Gilbert wrote: > * Philippe Mathieu-Daudé (phi...@redhat.com) wrote: > > Cc'ing the ppl who responded the thread you quoted. > > > > On 3/30/20 4:11 PM, Markus Armbruster wrote: > > > Philippe Mathieu-Daudé writes: > > > --- > > > qga/com

Re: [PATCH-for-5.0] qga-posix: Avoid crashing process when failing to allocate memory

2020-03-30 Thread Dr. David Alan Gilbert
* Philippe Mathieu-Daudé (phi...@redhat.com) wrote: > Cc'ing the ppl who responded the thread you quoted. > > On 3/30/20 4:11 PM, Markus Armbruster wrote: > > Philippe Mathieu-Daudé writes: > > --- > > qga/commands-posix.c | 8 +++- > > 1 file changed, 7 insertions(+), 1 deletion(-) > > >

Re: [PATCH-for-5.0] qga-posix: Avoid crashing process when failing to allocate memory

2020-03-30 Thread Daniel P . Berrangé
On Tue, Mar 24, 2020 at 08:48:36PM +0100, Philippe Mathieu-Daudé wrote: > Similarly to commit 807e2b6fce0 for Windows, kindly return a > QMP error message instead of crashing the whole process. > > Cc: qemu-sta...@nongnu.org > Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1594054 I find th

Re: [PATCH-for-5.0] qga-posix: Avoid crashing process when failing to allocate memory

2020-03-30 Thread Philippe Mathieu-Daudé
On 3/30/20 6:04 PM, Philippe Mathieu-Daudé wrote: Cc'ing the ppl who responded the thread you quoted. On 3/30/20 4:11 PM, Markus Armbruster wrote: Philippe Mathieu-Daudé writes: > --- >   qga/commands-posix.c | 8 +++- >   1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git

Re: [PATCH-for-5.0] qga-posix: Avoid crashing process when failing to allocate memory

2020-03-30 Thread Philippe Mathieu-Daudé
Cc'ing the ppl who responded the thread you quoted. On 3/30/20 4:11 PM, Markus Armbruster wrote: Philippe Mathieu-Daudé writes: > --- > qga/commands-posix.c | 8 +++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/qga/commands-posix.c b/qga/commands-posix.c > index 93

Re: [PATCH-for-5.0] qga-posix: Avoid crashing process when failing to allocate memory

2020-03-30 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > On 3/25/20 7:19 AM, Dietmar Maurer wrote: >> but error_setg() also calls malloc, so this does not help at all? > > IIUC the problem, you can send a QMP command to ask to read let's say > 3GB of a file, and QEMU crashes. But this doesn't mean there the .heap > is e

Re: [PATCH-for-5.0] qga-posix: Avoid crashing process when failing to allocate memory

2020-03-25 Thread Philippe Mathieu-Daudé
On 3/25/20 7:19 AM, Dietmar Maurer wrote: but error_setg() also calls malloc, so this does not help at all? IIUC the problem, you can send a QMP command to ask to read let's say 3GB of a file, and QEMU crashes. But this doesn't mean there the .heap is empty, there is probably few bytes still

Re: [PATCH-for-5.0] qga-posix: Avoid crashing process when failing to allocate memory

2020-03-24 Thread Dietmar Maurer
but error_setg() also calls malloc, so this does not help at all? > On March 24, 2020 8:48 PM Philippe Mathieu-Daudé wrote: > > > Similarly to commit 807e2b6fce0 for Windows, kindly return a > QMP error message instead of crashing the whole process. > > Cc: qemu-sta...@nongnu.org > Buglink: h

[PATCH-for-5.0] qga-posix: Avoid crashing process when failing to allocate memory

2020-03-24 Thread Philippe Mathieu-Daudé
Similarly to commit 807e2b6fce0 for Windows, kindly return a QMP error message instead of crashing the whole process. Cc: qemu-sta...@nongnu.org Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1594054 Reported-by: Fakhri Zulkifli Signed-off-by: Philippe Mathieu-Daudé --- qga/commands-posix