[Libevent-users] problem with Sigint and http events
W.C.A. Wijngaards
wouter at nlnetlabs.nl
Wed Oct 10 04:39:51 EDT 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Well its catching the signal allright, but you do the wrong things in
your signal handler.
The event_del and _free calls are probably not good to call from a
signal handler. I guess the dispatch after that fails.
You could call exit(0), or event_loopexit(0); right after the printf.
Best regards,
Wouter
william at opensource4you.com wrote:
> Hi,
>
> I'm not a good expert of C, but trying to build a simple example using
> libevent.
>
> I've succesfully build a very simple http server with the stupid "Hello
> World" message.
>
> Now I'm trying to capture a SIGINT as shown in "sample/signal-test.c"
> present in the libevent tar file.
>
> Unfortunately, I receive a segmentation fault
> "
> *** glibc detected *** ./test: double free or corruption (!prev):
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
iD8DBQFHDI/XkDLqNwOhpPgRAqG7AKCVzg2bBvDsUh/CULtnXFUtpW9WDACgtNoG
68q3saH1loTQ0YIW8anccvk=
=+Xe0
-----END PGP SIGNATURE-----
More information about the Libevent-users
mailing list