Bug 1361205
| Summary: | nvdimm: fix memory leak in error code path | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Stefan Hajnoczi <stefanha> |
| Component: | qemu-kvm-rhev | Assignee: | Stefan Hajnoczi <stefanha> |
| Status: | CLOSED ERRATA | QA Contact: | Yumei Huang <yuhuang> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 7.3 | CC: | chayang, juzhang, mrezanin, stefanha, virt-maint, yuhuang |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | qemu-kvm-rhev-2.6.0-18.el7 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2016-11-07 21:27:03 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Stefan Hajnoczi
2016-07-28 13:43:17 UTC
Hi Stefan, Could you provide an efficient way to reproduce and verify this bz? Best Regards, Junyi (In reply to juzhang from comment #1) > Could you provide an efficient way to reproduce and verify this bz? There is currently no NVDIMM hotplug support so you cannot easily test this at runtime by adding the device many times and watching the RSS memory statistic. Here is the command-line to trigger the error code path: qemu-system-x86_64 -object memory-backend-file,id=memdev0,size=128,mem-path=/tmp/foo -device nvdimm,memdev=memdev0 You could step through nvdimm_realize() under GDB to confirm that path is freed. If you prefer to just verify that the patch is included in the build then that is fine. (In reply to Stefan Hajnoczi from comment #2) > (In reply to juzhang from comment #1) > > Could you provide an efficient way to reproduce and verify this bz? > > There is currently no NVDIMM hotplug support so you cannot easily test this > at runtime by adding the device many times and watching the RSS memory > statistic. > > Here is the command-line to trigger the error code path: > > qemu-system-x86_64 -object > memory-backend-file,id=memdev0,size=128,mem-path=/tmp/foo -device > nvdimm,memdev=memdev0 > > You could step through nvdimm_realize() under GDB to confirm that path is > freed. If you prefer to just verify that the patch is included in the build > then that is fine. Thanks, Stefan. Best Regards, Junyi Fix included in qemu-kvm-rhev-2.6.0-18.el7 The actual process is executing machine instructions, not lines of C code, so the order of execution might not follow the C source code (due to compiler optimizations). This means that stepping through a program with gdb can be confusing. I suggest: (gdb) b nvdimm_realize (gdb) r (gdb) b g_free (gdb) r Now you can check that g_free() is being called from line 101 g_free(path) and that path points to a string "memdev0" in memory. (Maybe g_free() is called from other points in this code path so you may need to continue.) Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2016-2673.html |