Hello,
I recently ported a small application from Windows using winelib. The app uses a third-party DLL that I don't have source for (which is why I'm using winelib instead of just writing a Unix program). It seems to work fine, but it takes up 100% of the CPU all the time:
24916 activewv 25 0 1080 1080 920 R 50.2 0.2 44:06 0 wineserver 24938 activewv 16 0 0 0 0 Z 24.5 0.0 3:52 0 wine-pthread <defunct> 24913 activewv 15 0 0 0 0 Z 24.1 0.0 17:38 0 wine-pthread <defunct>
Also Linux claims that the two threads of the program are zombies, and are taking up 25% of the CPU, which doesn't really make any sense. The app isn't CPU-intensive under Windows.
The app is just sending a short request to the serial port every 5-10 seconds, and sometimes getting back a short response. When I strace wineserver, it's doing:
31132 poll([{fd=5, events=POLLIN}, {fd=4, events=POLLIN}, {fd=7, events=POLLIN}, {fd=9, events=POLLIN}, {fd=11, events=POLLIN}, {fd=13, events=POLLIN}, {fd=15, events=POLLIN}, {fd=-1}, {fd=-1}, {fd=16, events=POLLIN}, {fd=-1}, {fd=-1}, {fd=-1}, {fd=-1}, {fd=-1}, {fd=17, events=POLLIN}, {fd=-1}, {fd=-1}, {fd=-1}, {fd=28, events=POLLIN}, {fd=-1}, { fd=-1}, {fd=-1}, {fd=32, events=0, revents=POLLERR|POLLHUP}, {fd=33, events=POLLIN, revents=POLLIN}, {fd=-1}, {fd=-1}, {fd=36, events=POLLIN}, {fd=-1}, {fd=-1}, {fd=18, events=POLLIN}, {fd=-1}, {fd=-1}, {fd=-1}, {fd=-1}, {fd=44, events=0, revents=POLLERR|POLLHUP}, {fd=45, events=POLLIN, revents=POLLIN}, {fd=-1}, {fd=-1}, {fd=48, events=POLLIN}, {fd=-1}, {fd=-1}, {fd=24, events=POLLIN}, {fd=-1}, {fd=-1}, {fd=-1}, {fd=-1}, {fd=56, events=POLLIN}, {fd=57, events=POLLIN}, {fd=-1}, {fd=-1}, {fd=60, events=POLLIN}, {fd=-1}, {fd=-1}, {fd=63, events=POLLIN}, {fd=64, events=POLLIN}, {fd=-1}, {fd=-1}, {fd=-1}, {fd=-1}, {fd=-1}, {fd=-1}, {! fd=71, events=POLLIN}, {fd=72, events=POLLIN}, {fd=-1}, {fd=-1}, {fd=75, events=POLLIN}, {fd=-1}, {fd=-1}], 69, -1) = 4 31132 read(33, "&\0\0\0\0\0\0\0\0\0\0\0L\0\0\0\0\0\0@\0\0\0\0\0\0\0\0\0"..., 64) = 64 31132 write(34, "\0\0\0\0\0\0\0\0\t\0\0\0\1\0\0\0\1\0\0\0\0\0\0\0\0\0\0"..., 64) = 64 31132 read(45, "\25\0\0\0\0\0\0\0\0\0\0\0l\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 64) = 64 31132 write(46, "\0\0\0\0\0\0\0\0\377\377\377\377\0\0\0\0\0\0\0\0\0\0\0"..., 64) = 64
Those file descriptors are all pipes according to lsof, and I'm not sure what they're connected to---although it seems likely they're connected to those two threads, especially since those are the only threads this copy of wineserver is servicing.
I'm not really sure how to go about figuring this out; I'm about to port another similar application, and I'd prefer not to have both of them trying to get the CPU all the time.
This is with Wine-20040309, compiled myself for a Fedora Core Release 1 (Yarrow) Linux.
I'm not really sure what my next step is in figuring this out. Any ideas?
Thanks!
----ScottG.