#28 ocm-gtk hangs in poll()-read()-loop

Other (9)
Philipp Hahn

Today I build version 1.0.3 and tried to start it. I get the splash-screen, sometimes a blank screen, but than nothing. Using "strace" I've seen that the application is quiet busy doing some poll()-read()-loop all the time:

poll([{fd=4, events=POLLIN}, {fd=3, events=POLLIN}, {fd=13, events=POLLIN|POLLPRI}, {fd=6, events=POLLIN|POLLPRI}, {fd=11, events=POLLIN|POLLPRI}, {fd=12, events=POLLIN|POLLPRI}, {fd=17, events=POLLIN}, {fd=15, events=POLLIN}, {fd=19, events=POLLIN}, {fd=22, events=POLLIN}, {fd=23, events=POLLIN}], 11, 0) = 1 ([{fd=22, revents=POLLIN}])
read(3, 0xa09d04, 4096) = -1 EAGAIN (Resource temporarily unavailable)

This might be a bug in mono or Gtk, but this looks wrong:
poll() reports that one file descriptor is available for reading, but this 1 gets interpreted as an index into the list of file descriptors passed in to poll(), which results in the the read() call for the 2nd entry (since C arrays are 0 based).
Instead the array should be scanned for the exact file descriptor, which is now ready for IO.

Using "lsof" shows the following files being associated to the file descriptors:
mono 4511 pmhahn 3u unix 0xffff880124c82080 0t0 112175 socket
mono 4511 pmhahn 4r FIFO 0,7 0t0 112177 pipe
mono 4511 pmhahn 10r FIFO 0,7 0t0 108083 pipe
mono 4511 pmhahn 12u unix 0xffff88006d95acc0 0t0 108084 socket
mono 4511 pmhahn 13u unix 0xffff88008eb0d9c0 0t0 108085 /tmp/user/1000/orbit-pmhahn/linc-119f-0-434d595612782
mono 4511 pmhahn 14u unix 0xffff880079514080 0t0 108087 /tmp/user/1000/orbit-pmhahn/linc-119f-0-434d595612782
mono 4511 pmhahn 15u unix 0xffff880018049c80 0t0 108088 socket
mono 4511 pmhahn 17u unix 0xffff88013e0e43c0 0t0 108091 socket
mono 4511 pmhahn 19u unix 0xffff88006d903c80 0t0 112181 socket
mono 4511 pmhahn 22u IPv4 112187 0t0 TCP scout.pmhahn.de:57067->ber01s02-in-f105.1e100.net:www (ESTABLISHED)
mono 4511 pmhahn 23r FIFO 0,7 0t0 112188 pipe

So it looks like some data from ber01s02-in-f105.1e100.net:www is available for reading, it tries to read from the socket to the X-server instead:

connect(3, {sa_family=AF_FILE, path=@"/tmp/.X11-unix/X0"}, 20) = 0


  • kmcamp_ott

    What version of Linux are you running? If you're using Fedora 15 or Ubuntu 11.04 there seems to be a problem with version of Webkit that OCM uses being incompatible with more recent versions of GTK.

    Start OCM from the command line using mono --debug ocm-gtk and see what it reports.

  • kmcamp_ott

    I think I have an idea of what's causing this hang issue now (that socket connection is to Google Maps). In the 1.0 stream I tried to speed things up by starting the map load before the main window is actually shown, but I think this is causing problems if things are still loading as the window goes from hidden to shown.



Cancel   Add attachments