[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 10/47] readline: don't free completions in readline_f
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 10/47] readline: don't free completions in readline_free() |
Date: |
Mon, 5 Feb 2018 20:28:24 +0100 |
From: Greg Kurz <address@hidden>
Since commit e5dc1a6c6c43, QEMU aborts on exit if completion was used
in the monitor:
*** Error in `obj/ppc64-softmmu/qemu-system-ppc64': double free or
corruption (fasttop): 0x00000100331069d0 ***
/home/greg/Work/qemu/qemu-spapr/util/readline.c:514
/home/greg/Work/qemu/qemu-spapr/monitor.c:586
/home/greg/Work/qemu/qemu-spapr/monitor.c:4125
argv=<optimized out>, envp=<optimized out>) at
/home/greg/Work/qemu/qemu-spapr/vl.c:4795
Completion strings are not persistent accross completions (why would
they?). They are allocated under readline_completion(), which already
takes care of freeing them before returning.
Maybe all completion related bits should be moved out of ReadLineState
to a dedicated structure ?
In the meantime, let's drop the offending lines from readline_free()
to fix the crash.
Signed-off-by: Greg Kurz <address@hidden>
Message-Id: <address@hidden>
Fixes: e5dc1a6c6c43
Signed-off-by: Paolo Bonzini <address@hidden>
---
util/readline.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/util/readline.c b/util/readline.c
index 24ec839..ec91ee0 100644
--- a/util/readline.c
+++ b/util/readline.c
@@ -510,9 +510,6 @@ void readline_free(ReadLineState *rs)
for (i = 0; i < READLINE_MAX_CMDS; i++) {
g_free(rs->history[i]);
}
- for (i = 0; i < READLINE_MAX_COMPLETIONS; i++) {
- g_free(rs->completions[i]);
- }
g_free(rs);
}
--
1.8.3.1
- [Qemu-devel] [PULL 00/47] Misc patches for 2018-02-05, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 01/47] memory: update comments and fix some typos, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 02/47] qdev: rename typedef qdev_resetfn() -> DeviceReset(), Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 03/47] qdev: add helpers to be more explicit when using abstract QOM parent functions, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 05/47] kvm: Add kvm_set_user_memory tracepoint, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 06/47] qemu: improve hugepage allocation failure message, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 04/47] qdev: use device_class_set_parent_realize/unrealize/reset(), Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 07/47] memory: set ioeventfd_update_pending after address_space_update_ioeventfds, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 10/47] readline: don't free completions in readline_free(),
Paolo Bonzini <=
- [Qemu-devel] [PULL 08/47] scsi-generic: Simplify error handling code, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 09/47] chardev: fix incorrect unref of source, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 11/47] scripts/qemu-gdb/timers.py: define encoding in header comment, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 12/47] memory-internal.h: Remove obsolete claim that header is obsolete, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 13/47] i2c: Add a CONFIG_I2C master switch to the configuration files, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 14/47] Add missing hvdos public domain attribution:, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 15/47] hvf: ept_emulation_fault() needs NetApp BSD attribution, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 18/47] exynos4210: workaround UBSAN compilation error, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 16/47] Drop remaining bits of ia64 host support, Paolo Bonzini, 2018/02/05
- [Qemu-devel] [PULL 19/47] build-sys: add --enable-sanitizers, Paolo Bonzini, 2018/02/05