#39 99% CPU loop in miniserver.c on a non ipv6 system

closed-fixed
upnp (66)
9
2014-08-23
2010-10-13
Jin
No

I cross compiled libupnp 1.6.7 for ARM9 using the --disable-ipv6 option, my system is an ipv4 only setup.

I do not know why this problem only appears when running the app in the background (for instance using nohup &), but then it starts using 99% CPU.

I traced the problem down to the select() call in miniserver.c in the RunMiniServer() function. Select returns code 1, but errno is set to "Socket operation on non-socket", I also see this when running my app under strace.

I set all ...Sock6 variables to INVALID_SOCKET to make sure that they do not get added to the FD_SET and the problem is gone.

Discussion

    • assigned_to: nobody --> mroberto
    • priority: 5 --> 9
    • labels: 899808 --> upnp
    • status: open --> pending-fixed
     
  • Hi Jin,

    We believe we have fixed the issue now. Can you test it? You can get the latest sources like this:

    $ git clone git://pupnp.git.sourceforge.net/gitroot/pupnp/pupnp
    $ git checkout branch-1.6.x

    If you say it is ok, I will do a new release, 1.6.8.

    Regards,
    Marcelo.

     
    • status: pending-fixed --> closed-fixed
     
  • Bug fixed, please try the new release.