a segmentation fault on minGW

ss_liao ss_liao at 163.com
Sat Dec 1 16:57:30 CET 2012


Hi,

I'm beginner on libev, I can compile libev-4.11 in minGW, and I write some code like this:

#include <ev.h>
#include <stdio.h> // for puts
ev_io stdin_watcher;
ev_timer timeout_watcher;
static void stdin_cb (EV_P_ ev_io *w, int revents)
{
puts ("stdin ready");
ev_io_stop (EV_A_ w);
ev_break (EV_A_ EVBREAK_ALL);
}

static void timeout_cb (EV_P_ ev_timer *w, int revents)
{
puts ("timeout");
ev_break (EV_A_ EVBREAK_ONE);
}

int main (void)
{
struct ev_loop *loop = EV_DEFAULT;
ev_io_init (&stdin_watcher, stdin_cb, /*STDIN_FILENO*/ 0, EV_READ);
ev_io_start (loop, &stdin_watcher);
ev_timer_init (&timeout_watcher, timeout_cb, 5.5, 0.);
ev_timer_start (loop, &timeout_watcher);
ev_run (loop, 0);
return 0;
}

I can compile it successfully, when run it, report segmentation fault. The GDB debug info below:

anybody can help me?



shuishengliao
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.schmorp.de/pipermail/libev/attachments/20121201/4e26bc4e/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Catch(12-01-23-57-23)(1).jpg
Type: image/jpeg
Size: 145919 bytes
Desc: not available
URL: <http://lists.schmorp.de/pipermail/libev/attachments/20121201/4e26bc4e/attachment-0001.jpg>


More information about the libev mailing list