Re: Libvir JNA report SIGSEGV

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
    The problem is located. The root cause is that esxConnectToHost/esxConnectToVCenter method defined in esx_driver.c will collect the username and password. JNA will allocate the memory for username and password. But esxConnectToHost/esxConnectToVCenter will free the memory allocated by Java as following defined in esxConnectToHost/esxConnectToVCenter:

VIR_FREE(username);
VIR_FREE(unescapedPassword);

When JVM run the GC, it will crash because of dual free. If I comment these two lines, the system works well. But I think this is not a good solution. What about your opinion?

B.R.
Benjamin Wang




-----Original Message-----
From: Benjamin Wang (gendwang) 
Sent: 2012年9月6日 21:43
To: 'veillard@xxxxxxxxxx'
Cc: libvir-list@xxxxxxxxxx
Subject: RE:  Libvir JNA report SIGSEGV

Hi,
   I have looked into the code for several days. But I didn't find the root cause. Because even if I only call "new Connect", the problem will occur. So this should be related to Connect.java or ConnectAuthDefault.java. Would you take a quick at the issue and give some prompt?
Then I can try to fix this. Thanks!

B.R.
Benjamin Wang

-----Original Message-----
From: Daniel Veillard [mailto:veillard@xxxxxxxxxx]
Sent: 2012年9月6日 19:05
To: Benjamin Wang (gendwang)
Cc: libvir-list@xxxxxxxxxx
Subject: Re:  Libvir JNA report SIGSEGV

On Thu, Sep 06, 2012 at 09:06:14AM +0000, Benjamin Wang (gendwang) wrote:
> Hi,
>   Actually I also did another test as following. When I comment the 
> "new Connet", the program works well. So this is the problem related 
> to Libvirt JNA. If I manually run the garbage collection for this program, it still works well. But if I run the garbage collection for the last problem, It will crash. I guess this problem is caused by ConnectAuth callback. When garbage collection is executed, the callback memory is moved.

  Okay, maybe some memory need to be pinned in some ways, I take patches !

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel@xxxxxxxxxxxx  | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library  http://libvirt.org/

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]