[Libevent-users] Segmentation fault - const struct eventop *evsel = base->evsel;

João Pascoaes joao.pascoaes at hotmail.com
Sat Aug 11 19:27:41 EDT 2007


Hello all,

My problem is:

I'm developping an application in C++ with libevent 1.3c (and g++ 4.0.3).
My main function creates an object from a class A witch creates one object 
from class B.

- In object from class A, I call event_init() and event_dispatch() functions 
(there are events related with sockets here, all working good);
- In object from class B there is an event timer triggering each 50 seconds 
(tvTime);
- "struct event evTime" and "struct timeval tvTime" are declared in class B;
- "evtimer_set(&evTime, func, (void *) this)" and "evtimer_add(&evTime)" 
present in class B;

>From time to time, object from class B is deleted.

Problem:
	After that, when object from class A creates another object from class B:
	- "evtimer_initialized(&evTime)" returns true (how?), followed by 
"evtimer_del(&evTime)" (working!) and after by "evtimer_add(&evTime)".

	However, "evtimer_add(&evTime)" raises a segmentation default:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1212361024 (LWP 8533)]
event_add (ev=0x80a39c0, tv=0x80a3a14) at event.c:622
622             const struct eventop *evsel = base->evsel;


What am I dowing wrong?
Can you help me, please?

Thanks :)

João

_________________________________________________________________
Transfira JÁ a última versão do Windows Live Messenger! 
http://get.live.com/pt-pt/messenger/overview



More information about the Libevent-users mailing list