[XenAccess-devel] Segmentation fault when calling the same function twice
Status: Beta
Brought to you by:
bdpayne
From: Daniele S. <da...@ya...> - 2006-08-24 11:12:26
|
Hi! I've tried to build a simple library, sort of a wrapper for your examples (process-list, process-data). It seems there are little problems when calling two times the same function. For example, if I modify the file process-list.c, in this way (I've replaced the name "main" with "mainb" and created another "main" that calls two times "mainb"): int mainb (int argc, char **argv) { xa_instance_t xai; unsigned char *memory = NULL; uint32_t offset, next_process, list_head; char *name = NULL; int pid = 0; ...... } int main (int argc, char **argv) { printf("first\n"); mainb(argc, argv); printf("second\n"); mainb(argc, argv); return 0; } I get a segmentation fault error: [examples]# ./run ./process-list 1 first [ 1] init [ 2] migration/0 [ 3] ksoftirqd/0 [ 4] watchdog/0 [ 5] events/0 [ 6] khelper [ 7] kthread [ 8] xenwatch [ 9] xenbus [ 16] kblockd/0 [ 20] khubd [ 58] pdflush [ 59] pdflush [ 61] aio/0 [ 60] kswapd0 [ 577] kseriod [ 657] kpsmoused [ 660] nash-hotplug [ 678] kjournald [ 1098] syslogd [ 1104] klogd [ 1148] exim4 [ 1154] inetd [ 1163] sshd [ 1180] atd [ 1183] cron [ 1198] login [ 1199] getty [ 1200] getty [ 1201] getty [ 1202] getty [ 1203] getty [ 1204] bash [ 1218] sshd [ 1222] sftp-server second ./run: line 4: 6347 Segmentation fault $@ [examples]# I'm using Xenaccess 0.2 on Fedora 5, with Xen 3.0.2-2. I 've tried to find the problem and probably it's something with xa_access_kernel_symbol routine. Thanks Chiacchiera con i tuoi amici in tempo reale! http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com |