... continuation

>> This comes from the VIR_REALLOC_N_QUIET macro (which calls this function). 
>> and its a more complex version of: 
>> 
>> tmp = realloc(*(void**)ptrptr, size * count); 
>> 
>> Judging by what happened to QEMU instance (no memory available) I wouldn't 
>> be surprised 
>> if this call has also failed and made libvirt to fail. Unfortunately: 
>> 
>> (gdb) info locals 
>> tmp = <optimized out> 
>> 
>> Have been optimized (variables values were held in register and not on the 
>> stack). 
>> I can't see what where the values from this stack frame. 
>>
>> libvirt code doesn't check for this realloc return: 
>> 
>> ignore_value(VIR_REALLOC_N_QUIET(buf, got + 1)); 
>> 
>> which means that the logic works expecting realloc to work all the time. 

>> There is a sanity test for OOM in virReallocN, but that is only enabled: 
>> #if TEST_OOM 
>> if (virAllocTestFail()) { 
>> if TEST_OOM is declared. 

>> From Makefile, this option is NOT the default (likely introduce latency in 
>> memory allocation): 
>> 
>> --enable-test-oom memory allocation failure checking [default=no] 
>> 
>> And its not enabled in Ubuntu or Debian as well. 

#6 0x00007f945340d2f3 in virReallocN
(ptrptr=ptrptr@entry=0x7ffe2f31c0a0, size=size@entry=1,
count=count@entry=2839, report=report@entry=false,
domcode=domcode@entry=0, filename=filename@entry=0x0, funcname=0x0,
linenr=0) at ../../../src/util/viralloc.c:245

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1670659

Title:
  Libvirt can crash on lack of memory when starting multiple instances

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1670659/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to