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

cupsd don't accept return-code 0 from backend to finish the job #1892

Closed
michaelrsweet opened this issue Aug 8, 2006 · 17 comments
Closed

cupsd don't accept return-code 0 from backend to finish the job #1892

michaelrsweet opened this issue Aug 8, 2006 · 17 comments
Milestone

Comments

@michaelrsweet
Copy link
Collaborator

Version: 1.3-current
CUPS.org User: d_ferdi

hello,
i have a big problem with the aktual version which i download today.

this version don't accept the return-code 0 to finish the print-job.

after the job is printed, i must kill it, to print the next job.

first, i think i have a bug in the new backend-program and use a script, but this don't work. i look to the source from a backend, which comes with cups to see what is wrong, but i can't find any error.

after i reinstall the older version 1.2.2, it works fine.

goodby

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Please attach the following files:

/var/log/cups/error_log
/etc/cups/cupsd.conf
your backend script

Also, what operating system, compiler, etc. are you using?

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: d_ferdi

hello,
sorry, no error log, because it is deleted by the oder version of cups after configuration and print-tests.

but i found nothing in the error log.

i see later, this problem is also with all backends included with cups.

goodby

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

I still need to see the error_log file - run with the LogLevel set to "debug2"...

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: d_ferdi

hello,
i have generate a new log-file for you.

after the printjob is finished, the job is already active and not finished.

i must abort it, to print the next job.

i use version 1.2.2 at this time, because this version don't have this bug.

goodby

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Well, I've diff'd the 1.2.2 and trunk code, and there are no differences that could account for the problem you are seeing. In addition, I am unable to duplicate the problem when using the "make test" test framework.

What operating system, architecture, and compiler are you using?

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: d_ferdi

hello,
i have recompild both versions of cupsd and make a binary compare of the programs:
/src/src/cups-1.3svn-r5805/scheduler/cupsd /src/src/cups-1.2.2/scheduler/cupsd differ: byte 133, line 1 is 274 M-< 334 M-\

if there are no changes in the code, the binaries must be the same, but they don't.

and a diff of the source is not identical:
Files /src/src/cups-1.3svn-r5805/scheduler/conf.h and /src/src/cups-1.2.2/scheduler/conf.h differ
Files /src/src/cups-1.3svn-r5805/scheduler/mime.h and /src/src/cups-1.2.2/scheduler/mime.h differ
Files /src/src/cups-1.3svn-r5805/scheduler/printers.h and /src/src/cups-1.2.2/scheduler/printers.h differ
Files /src/src/cups-1.3svn-r5805/scheduler/subscriptions.h and /src/src/cups-1.2.2/scheduler/subscriptions.h differ
Files /src/src/cups-1.3svn-r5805/scheduler/auth.c and /src/src/cups-1.2.2/scheduler/auth.c differ
Files /src/src/cups-1.3svn-r5805/scheduler/client.c and /src/src/cups-1.2.2/scheduler/client.c differ
Files /src/src/cups-1.3svn-r5805/scheduler/conf.c and /src/src/cups-1.2.2/scheduler/conf.c differ
Files /src/src/cups-1.3svn-r5805/scheduler/cups-lpd.c and /src/src/cups-1.2.2/scheduler/cups-lpd.c differ
Files /src/src/cups-1.3svn-r5805/scheduler/cups-polld.c and /src/src/cups-1.2.2/scheduler/cups-polld.c differ
Files /src/src/cups-1.3svn-r5805/scheduler/dirsvc.c and /src/src/cups-1.2.2/scheduler/dirsvc.c differ
Files /src/src/cups-1.3svn-r5805/scheduler/filter.c and /src/src/cups-1.2.2/scheduler/filter.c differ
Files /src/src/cups-1.3svn-r5805/scheduler/ipp.c and /src/src/cups-1.2.2/scheduler/ipp.c differ
Files /src/src/cups-1.3svn-r5805/scheduler/job.c and /src/src/cups-1.2.2/scheduler/job.c differ
Files /src/src/cups-1.3svn-r5805/scheduler/listen.c and /src/src/cups-1.2.2/scheduler/listen.c differ
Files /src/src/cups-1.3svn-r5805/scheduler/main.c and /src/src/cups-1.2.2/scheduler/main.c differ
Files /src/src/cups-1.3svn-r5805/scheduler/mime.c and /src/src/cups-1.2.2/scheduler/mime.c differ
Files /src/src/cups-1.3svn-r5805/scheduler/printers.c and /src/src/cups-1.2.2/scheduler/printers.c differ
Files /src/src/cups-1.3svn-r5805/scheduler/statbuf.c and /src/src/cups-1.2.2/scheduler/statbuf.c differ
Files /src/src/cups-1.3svn-r5805/scheduler/subscriptions.c and /src/src/cups-1.2.2/scheduler/subscriptions.c differ
Files /src/src/cups-1.3svn-r5805/scheduler/testmime.c and /src/src/cups-1.2.2/scheduler/testmime.c differ

i don't know, which of the changes affect cupsd, but one of the difference change one byte of the binary file!

i have my own system with glibc-2.3.6 and use gcc 3.3.6 to compile the most programs, only programs, which make problems with this version, are compile with newer or older gcc.

goodby

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

You can't compare executable files to see if there have been any changes. File dates, version numbers, etc. all will change the executable image.

I did a diff of the source code, and none of the signal or job processing code has been changed since 1.2.2.

I'm guessing you are running on Linux. What processor are you using?

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: d_ferdi

hello,
i run the program on a dual p3-system with 1 gb ram.

i don't know, why the new version don't work on this system.

i can configure my system to get you access to cups or full access to a test system. i set up my second linux-server last days with a copy from first server and can test the program for this problem in the next days.

the other system has only one cpu and the most components are the same.

goodby

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Strange, what happens if you run a "make test" against 1.3/trunk?

(my main devel system is a dual Xeon system...)

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: d_ferdi

hello,
the result from make test is not good:

Starting scheduler:
../scheduler/cupsd -c /tmp/cups-root/cupsd.conf -f >/tmp/cups-root/log/debug_log 2>&1 &

Scheduler is PID 20818; run debugger now if you need to.

Press ENTER to continue...
Waiting for scheduler to become ready...
Waiting for scheduler to become ready...
Waiting for scheduler to become ready...
Waiting for scheduler to become ready...
Waiting for scheduler to become ready...
Waiting for scheduler to become ready...
Waiting for scheduler to become ready...
Waiting for scheduler to become ready...
Waiting for scheduler to become ready...
Waiting for scheduler to become ready...
Waiting for scheduler to become ready...
Waiting for scheduler to become ready...
Waiting for scheduler to become ready...
-> i terminate it here

sheduler is ready and test wait for ready.

but make test with version 1.2.2 has the same problem.

goodby

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: d_ferdi

hello,
i change my script, so that one line more is send, so it works.

you have time, to fix this problem.

the problem is know and it gives a workaround. this is not the best, but it works.

goodby

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

OK, well, I am not able to reproduce your problems on either 1.2svn or trunk on any of our single or dual CPU systems... All of them pass the "make test" tests...

Adding "one more line" to your output should have no effect...

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

OK, I just reproduced this on trunk; it is getting stuck in cupsdUpdateJob()... Will track down and fix ASAP...

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Try the attached patch and let me know if it fixes things for you (seems to work for me here...)

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: d_ferdi

hello,
with this patch, it works again.

finished jobs are deleted.

goodby

@michaelrsweet
Copy link
Collaborator Author

"cupsd.conf":

AccessLog /var/log/cups/access.log
DefaultLanguage de
ErrorLog /var/log/cups/error.log

Show general information in error_log.

LogLevel info
PageLog /usr/var/log/cups/page.log
User lp
Group daemon

Allow remote access

Port 631

Show shared printers on the local network.

Browsing On
BrowseOrder allow,deny
BrowseAllow @Local

Allow remote administration...

Order allow,deny
Allow @Local

<Location /admin>
AuthType Basic
AuthClass System

Allow remote administration...

Order allow,deny
Allow @Local

<Location /admin/conf>
AuthType Basic
Require user @System

Allow remote access to the configuration files...

Order allow,deny
Allow @Local



Require user @owner @System
Order deny,allow


AuthType Basic
Require user @System
Order deny,allow


Order deny,allow

@michaelrsweet
Copy link
Collaborator Author

"str1892.patch":

Index: client.c

--- client.c (revision 5882)
+++ client.c (working copy)
@@ -2191,7 +2222,7 @@
if (!strchr(CGIStatusBuffer->buffer, '\n'))
break;

  • if (ptr == NULL && errno)
  • if (ptr == NULL && !CGIStatusBuffer->bufused)
    {
    /*
  • Fatal error on pipe - should never happen!
    Index: dirsvc.c

    --- dirsvc.c (revision 5871)
    +++ dirsvc.c (working copy)
    @@ -1626,7 +1626,7 @@
    if (!strchr(PollStatusBuffer->buffer, '\n'))
    break;
  • if (ptr == NULL && errno)
  • if (ptr == NULL && !PollStatusBuffer->bufused)
    {
    /*
  • All polling processes have died; stop polling...
    Index: statbuf.c

    --- statbuf.c (revision 5871)
    +++ statbuf.c (working copy)
    @@ -141,13 +141,6 @@

/*

  • * Clear the errno variable since not all systems clear it after a
  • * successful read...

- */

- errno = 0;

  • /*
    • Check if the buffer already contains a full line...
      */

@@ -179,7 +172,6 @@

   *loglevel = CUPSD_LOG_NONE;
   line[0]   = '\0';
  •  errno     = 0;
    

    return (line);
    }
    @@ -201,7 +193,7 @@
    lineptr = NULL;
    }

  • if (lineptr == NULL)

  • if (!lineptr)
    {
    /*

  • End of file...
    Index: job.c

    --- job.c (revision 5875)
    +++ job.c (working copy)
    @@ -1717,7 +1717,7 @@
    break;
    }

  • if (ptr == NULL && errno)

  • if (ptr == NULL && !job->status_buffer->bufused)
    {
    /*

  • See if all of the filters and the backend have returned their

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