free(): invalid pointer

Bug #1035320 reported by Claudio Bley
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libvirt (Ubuntu)
Fix Released
High
Unassigned
Precise
Fix Released
High
Unassigned

Bug Description

=======================
SRU justification
1. Impact: libvirt crashes
2. Development fix: upstream commit which avoids freeing memoryin an error path where it has not been allocated.
3. Stable fix: cherrypick development fix.
4. Test case: specify invalid lvm volume and start vm
5. Regression potential: should be none as it was a straightforward cherrypick of upstream commit.
=======================

libvirtd is crashing for me with these messages:

---
2012-08-10 12:34:10.459+0000: 11684: info : libvirt version: 0.9.8
2012-08-10 12:34:10.459+0000: 11684: error : virStorageBackendVolOpenCheckMode:1019 : cannot stat file '/dev/vg1/kvm.24': No such file or directory
*** glibc detected *** libvirtd: free(): invalid pointer: 0x00007faaf8000078 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x7e626)[0x7fab09d9b626]
/usr/lib/libvirt.so.0(virFree+0x29)[0x7fab0b7f99c9]
/usr/lib/libvirt.so.0(virStorageVolDefFree+0x19)[0x7fab0b841469]
/usr/lib/libvirt.so.0(virStoragePoolObjClearVols+0x2a)[0x7fab0b8429ca]
libvirtd[0x4bd948]
libvirtd[0x4b6409]
libvirtd[0x4b6786]
/usr/lib/libvirt.so.0(virStateInitialize+0x6e)[0x7fab0b86729e]
libvirtd[0x420e61]
/usr/lib/libvirt.so.0(+0x4e9d2)[0x7fab0b8029d2]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x7e9a)[0x7fab0a0e1e9a]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7fab09e0f4bd]
---

Apparently, the problem was some dangling LVM volume still listed by "lvs" but actually not existent in /dev/vg1.

I'm running precise, amd64, libvirt-0.9.8-2ubuntu17.3.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Thanks for reporting this bug.

I suspect upstream commit 380f326955a25f84dca45b4eead2a7aa4d11e6f2 may be the fix for crash. Are you still able to reproduce this at will? If so I'll push a package with the proposed fix to a ppa for testing.

Changed in libvirt (Ubuntu):
importance: Undecided → High
status: New → Incomplete
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

@Claudio,

I've built a version of libvirt for precise with the proposed fix in ppa:serge-hallyn/libvirt-mav. You can enable this by doing

sudo add-apt-repository ppa:serge-hallyn/libvirt-mav
sudo apt-get update
sudo apt-get dist-upgrade

Can you verify whether that version fixes the problem for you?

Changed in libvirt (Ubuntu Precise):
status: New → Incomplete
importance: Undecided → High
Revision history for this message
Claudio Bley (cbley) wrote :

@Serge,

Thanks for your quick response.

I tried your ppa version and this fixes the problem for me.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Great, thanks, I'll request an SRU for that.

Changed in libvirt (Ubuntu Precise):
status: Incomplete → Confirmed
Changed in libvirt (Ubuntu):
status: Incomplete → Fix Released
Changed in libvirt (Ubuntu Precise):
assignee: nobody → Serge Hallyn (serge-hallyn)
description: updated
Changed in libvirt (Ubuntu Precise):
assignee: Serge Hallyn (serge-hallyn) → nobody
status: Confirmed → Triaged
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Claudio, or anyone else affected,

Accepted libvirt into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/libvirt/0.9.8-2ubuntu17.4 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please change the bug tag from verification-needed to verification-done. If it does not, change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in libvirt (Ubuntu Precise):
status: Triaged → Fix Committed
tags: added: verification-needed
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

@Claudio,

will you be able to verify this fix in precise-proposed?

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

I've verified the fix on precise.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libvirt - 0.9.8-2ubuntu17.4

---------------
libvirt (0.9.8-2ubuntu17.4) precise-proposed; urgency=low

  * storage-fix-a-potential-crash-when-creating-vol-object: avoid a crash
    on bad free() on error lvm storage. (LP: #1035320)
  * add pm-utils as suggests to avoid log spamming with messages about
    pm-is-supported not being found. (LP: #994476)
 -- Serge Hallyn <email address hidden> Mon, 13 Aug 2012 09:49:10 -0500

Changed in libvirt (Ubuntu Precise):
status: Fix Committed → Fix Released
Revision history for this message
Colin Watson (cjwatson) wrote : Update Released

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.