问题
I am working on Ubuntu. When I run my program about after 1 hour I received this error :
GLib-ERROR **: Cannot create pipe main loop wake-up: Too many open files The program has unexpectedly finished.
When I run with gdb it does not crash.
I Don't understand why? and What is the reason for this error ?
Thank you very much..
回答1:
Too many open files
Is pretty obvious. Probalby you have a leak with file descriptors, so you should check if your code opens lots of files/filedescriptors but doesn't close them properly. If you fork a process, you should also consider to close them, before you start the actual process, as this might also be a common mistake.
The operating system has a limited table of how many filedescreptors it can maintain, and apparently you exceeded this limit.
来源:https://stackoverflow.com/questions/17969804/glib-error-cannot-create-pipe-main-loop-wake-up-too-many-open-files-on-qt