[libvirt-users] dump in virEventPollRunOnce

libvirt version: 3.4.0 architecture: x86_64 ubuntu16.04-server hypervisor: kvm,qemu My program use libvirt event , the program is a module(.so) file in cloud application, when unload the module, program will dump in virEventPoolRunOnce call. program frame virInitialize virEventAddTimeOut virEventRunDefaultImpl virConnectXXX virConnectDomainEventRegisterAny ... virConnectDomainEventDeregisterAny ... when unload the module will dump , the gdb bt commad output is [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Core was generated by `/usr/local/lssa/bin/lssa -f'. Program terminated with signal SIGSEGV, Segmentation fault. ---Type <return> to continue, or q <return> to quit--- #0 0x00007f9a3e9fc2f2 in ?? () [Current thread is 1 (Thread 0x7f9a39349700 (LWP 2897))] (gdb) bt #0 0x00007f9a3e9fc2f2 in ?? () #1 0x00007f9a3e1728bd in virEventPollRunOnce () from /usr/lib/libvirt.so.0 #2 0x00007f9a3e171391 in virEventRunDefaultImpl () from /usr/lib/libvirt.so.0 #3 0x00007f9a3e9fbc16 in ?? () #4 0x0000000000000000 in ?? () (gdb) Thanks

On 08/21/2017 05:22 AM, llilulu wrote:
libvirt version: 3.4.0 architecture: x86_64 ubuntu16.04-server
hypervisor: kvm,qemu
My program use libvirt event , the program is a module(.so) file in cloud application, when unload the module, program will dump in virEventPoolRunOnce call. program frame
This is perfectly expected. IIUC you're providing your own event loop callbacks (virEventRegisterImpl()) which are implemented in your module. Well, if you remove it dead pointers are left behind in libvirt's internals and thus when libvirt tries to call your function it accesses dead pointer and thus SIGSEGVs. The proper way to do it is to unload your module only after the last call to libvirt (and after every connection was closed). Michal
participants (2)
-
llilulu
-
Michal Privoznik