Opened 11 years ago

Closed 10 years ago

Last modified 10 years ago

#1815 closed defect (fixed)

epoll not working with kamikaze

Reported by: aeh@… Owned by: developers
Priority: high Milestone:
Component: kernel Version:
Keywords: epoll Cc:


I am using kamikaze r7476 with linux 2.6.21 on Asus WL-500 GP

my program is using epoll for async i/o events, but it is not working on openwrt.
the problem is that the file descriptor is bogus on the returned event.

when epoll_wait() returns, the first struct epoll_event contains the correct
.events (which is EPOLLIN) but the .data.fd is wrong. this value is supposed to be the
same value as specified when doing epoll_ctl(EPOLL_CTL_ADD)

running a testprogram on the asus, and pressing a key gives this:

# ./a.out
event 0x00000001 on fd=715816960

-> the "fd" is supposed to be "0" (i.e. STDIN_FILENO)

I am attaching a small test program to reproduce the bug.

Attachments (1)

epoll.c (1009 bytes) - added by aeh@… 11 years ago.
Program to test epoll()

Download all attachments as: .zip

Change History (12)

Changed 11 years ago by aeh@…

Program to test epoll()

comment:1 Changed 11 years ago by aeh@…

just did a test with vanilla on an i386 machine, epoll works fine.

not sure how to proceed with this one, maybe do some debugging in the kernel?
if you know of any other programs using epoll() that are already in OpenWRT
I could test them.

comment:2 Changed 11 years ago by CtRiX

I have the same problem on this:
Linux OpenWrt #8 Mon Jun 11 22:46:33 CEST 2007 mips unknown

i'm upgrading the kernel to check this out.

comment:3 Changed 11 years ago by CtRiX

Upgraded to

Linux OpenWrt #3 Tue Jun 12 16:23:01 CEST 2007 mips unknown

The problem persists.

AFAIK programs using libevent (like tor or arpd ) have a good chance to use EPOLL.

I'm still digging but i have no clue what's happening.

comment:4 Changed 11 years ago by nbd

Please try a current version. This may be related to the cpu cache bugs that were fixed.

comment:5 Changed 11 years ago by aeh@…

Thanks for the tip. I just tried r7914 (kernel 2.6.22) and the bug is still there.
Can you tell me on which revision the cpu cache bug was fixed?

comment:6 Changed 11 years ago by florian

  • Resolution set to fixed
  • Status changed from new to closed

Fixed with [8165]

comment:7 Changed 10 years ago by aeh@…

  • Resolution fixed deleted
  • Status changed from closed to reopened

I am re-opening this ticket, since the bug is not fixed yet.

I have tested Kamikaze 7.09 and latest svn r9600 - the bug is still here.

My target it platform is Asus WL-500GP, it might be that there is a hardware
bug the broadcom chip, or perhaps a bug in my device (only).

It would be nice to see if epoll is working on other platforms,
the test-code attached can be used to verify that.

comment:8 Changed 10 years ago by anonymous

That's the same base problem as in
Re: [OpenWrt-Tickets] [OpenWrt] #1839: squid broken

Maybe the tickets could be merged?

comment:9 Changed 10 years ago by david.kammering@…

Also seems to be related to Ticket #2638

comment:10 Changed 10 years ago by florian

  • Resolution set to fixed
  • Status changed from reopened to closed

comment:11 Changed 10 years ago by aeh@…

I can now confirm that epoll() is working with 2.6.25 on Asus WL500Gp.

the image was built from svn trunk:

URL: r11494

I am not sure exactly how the bug was fixed, but thanks alot anyway for fixing it!

BTW, In my code I need to keep a compile-time check if building
with an old version of the OpenWRT SDK. Is there an easy way
of doing like this:

int have_epoll(void)

return 0;


return 1;


Add Comment

Modify Ticket

as closed .
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.