Re: [XenAccess-devel] Segmentation fault when calling the same function twice
Status: Beta
Brought to you by:
bdpayne
From: Daniele S. <da...@ya...> - 2006-08-25 09:22:41
|
The fix is already in the > repository, in case > you'd like to try it out. Great, I've downloaded the latest files and now it works :) One final point: I'm trying to use Xenaccess under Python using ctypes library (it allows to load a C library and call it from Python). So, I've made a file called my_lib.c that contains your examples (that, instead of being "main" functions, are "normal" functions like: char **process_list(uint32_t dom, int *proc_num)), and than adding the line "SRCS += my_lib.c" to the Makefile and recompiling, it is possible to load libxenaccess.so from Python. I also add the line "LDFLAGS += -lxenctrl" in the Xenaccess Makefile or ctypes complained about the fact that some functions were undefined. The only problem I have, it's if I try to call the same function two times (like in the previous message), Python exits with something like: Entity: line 1: parser error : Start tag expected, '<' not found ERROR: could not parse xml data for domain id 1 linux_get_kernel_name free up memory *** glibc detected *** python: corrupted double-linked list: 0x09061a80 *** ======= Backtrace: ========= /lib/i686/nosegneg/libc.so.6[0x882907] /lib/i686/nosegneg/libc.so.6(__libc_free+0x79)[0x885fbe] ./libxenaccess.so(linux_get_kernel_name+0x135)[0xb1a495] ./libxenaccess.so(linux_predict_sysmap_name+0x2d)[0xb1a58d] .... I've traced back the problem to the function "linux_get_kernel_name": in fact, simply commenting the last line before the return statement ("if (xml_data) free(xml_data);"), fixed the problem, but it's a brutal fix: in fact, if between the two calls a call to a libvirt function is made (again, from Python), there is a similar error about xml "Entity: line 1: parser error : Start tag expected, '<' not found ". Hope that can help it! Cheers Chiacchiera con i tuoi amici in tempo reale! http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com |