Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpusd looping on close() system call with EBADF error on AIX 5.3 TL 05 #2329

Closed
michaelrsweet opened this issue Apr 4, 2007 · 4 comments
Closed
Milestone

Comments

@michaelrsweet
Copy link
Collaborator

Version: 1.2-current
CUPS.org User: jldowdy

Howdy,

When I build cups version 1.2.10 on AIX 5.3 the cupsd daemon begins looping on a close() system call which receives EBADF errors. The file handle used by the close system call increments with each call.

I am using AIX version 5.3 TL 05. Below is the info regarding my C compiler.

$ gcc -v
Using built-in specs.
Target: powerpc-ibm-aix5.3.0.0
Configured with: ../configure --with-as=/usr/bin/as --with-ld=/usr/bin/ld --disable-nls --enable-languages=c,c++ --prefix=/opt/freeware --enable-threads --enable-version-specific-runtime-libs --host=powerpc-ibm-aix5.3.0.0
Thread model: aix
gcc version 4.0.0

I have attached a text file that contains the spec file that I used to build CUPS and the output from the truss command which captures the errors from the cupsd program.

Thanks,

Jamie.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

What does "ulimit -a" report?

Normally CUPS will close all files on startup (to run in "daemon" mode), based on the file descriptor limit.

Does running cupsd with the "-f" option (foreground) work?

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: jldowdy

The ulimit -a command reports:

root@naadmd11:22# ulimit -a
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) unlimited
stack(kbytes) 4194304
memory(kbytes) unlimited
coredump(blocks) unlimited
nofiles(descriptors) unlimited

The cupsd program runs normally in the foreground with the -f option.

I changed the ulimit for the number of file descriptors from unlimited to 4096 and cupsd runs normally in the background now. I'll insure that the number of file decriptors is not set to unlimited from now on. Thanks for your help.

Jamie.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Fixed in Subversion repository.

I added the attached change to main() to limit the number of file descriptors we close to the first 1024...

@michaelrsweet
Copy link
Collaborator Author

"str2329.patch":

Index: main.c

--- main.c (revision 6450)
+++ main.c (working copy)
@@ -366,7 +366,7 @@

 getrlimit(RLIMIT_NOFILE, &limit);
  • for (i = 0; i < limit.rlim_cur; i ++)
  • for (i = 0; i < limit.rlim_cur && i < 1024; i ++)
    close(i);
    #endif /* DEBUG */
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant