Results 1 to 5 of 5

Thread: GLib-WARNING **: poll(2) failed due to: Invalid argument.

  1. #1
    Join Date
    Sep 2006
    Posts
    68
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default GLib-WARNING **: poll(2) failed due to: Invalid argument.

    I am writing a server application, but have run into a problem.

    When I reach about 850 connection, the program jumps to using a lot of CPU, and I get a deluge of the following message:

    (process:9804): GLib-WARNING **: poll(2) failed due to: Invalid argument.

    I've no idea where that could be coming from, does anyone know what might actually cause that?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,365
    Thanks
    3
    Thanked 5,014 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: GLib-WARNING **: poll(2) failed due to: Invalid argument.

    Could be that a large number of sockets is causing this. The amount of sockets you may open (and handle) at the same time is often limited. Maybe you reached some limit.

  3. #3
    Join Date
    Sep 2006
    Posts
    68
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: GLib-WARNING **: poll(2) failed due to: Invalid argument.

    It does seem to be that. When I compiled and ran it on another machine that had a customized kernel to allow more Sockets, I didn't run into the same problem.

    So how can I detect this problem is occurring and have my program take steps to prevent this crash?

    QTcpServer does not seem to have any onError signals :-(

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,365
    Thanks
    3
    Thanked 5,014 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: GLib-WARNING **: poll(2) failed due to: Invalid argument.

    Quote Originally Posted by December View Post
    So how can I detect this problem is occurring and have my program take steps to prevent this crash?
    As for Linux, you can query /proc or /sys for the number of allowed file descriptors per process. As for other OSes, I have no idea. Do you really need such a large number of sockets?

    QTcpServer does not seem to have any onError signals :-(
    You can access the error from the regular socket (See QAbstractSocket::error ()).

  5. #5
    Join Date
    Feb 2008
    Posts
    60
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: GLib-WARNING **: poll(2) failed due to: Invalid argument.

    I am getting the same error "(process:2795): GLib-WARNING **: poll(2) failed due to: Invalid argument." , when the connection exceeds 550.

    Is the "Kernel rebuilding by allowing more sockets" only solves the problem? or any other way to solve this?

    Note:
    I am running this in Slackware.

Similar Threads

  1. Visual Studio 2005 Express
    By Muzz in forum Installation and Deployment
    Replies: 22
    Last Post: 6th November 2008, 06:21
  2. Client/Server Error: BadIDChoice
    By 3nc31 in forum Qt Programming
    Replies: 5
    Last Post: 27th November 2007, 10:22
  3. Problem at time compilation in traslation of language
    By thomasjoy in forum Qt Programming
    Replies: 3
    Last Post: 22nd May 2007, 14:18
  4. problem with linking
    By mickey in forum Qt Programming
    Replies: 49
    Last Post: 12th August 2006, 21:41
  5. how to corss compile for windows in Linux
    By safknw in forum Qt Programming
    Replies: 24
    Last Post: 13th May 2006, 05:23

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.