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

Files in spool directory cause cupsd-startup to fail: "Child exited on signal 11" #82

Closed
michaelrsweet opened this issue May 10, 2003 · 5 comments
Milestone

Comments

@michaelrsweet
Copy link
Collaborator

Version: 1.1.19rc4
CUPS.org User: pipitas

I can reproduce this at will....


Certain printfiles on hold in the spool directory cause
cupsd to fail starting. If I move the files away the startup

completes. If I move only one of the files back, it fails.

kde-bitshop:/usr/lib/cups/backend # /etc/init.d/cups start
cupsd: Child exited on signal 11!
cups: unable to start scheduler.

This is how far the scheduler logs its startup phase (LogLevel debug2
can be created on demand):

I [10/May/2003:19:05:31 +0200] Sending browsing info to ffffffff:631
D [10/May/2003:19:05:31 +0200] AddLocation: added location 'CUPS_INTERNAL_BROWSE_ACL'
D [10/May/2003:19:05:31 +0200] DenyIP: CUPS_INTERNAL_BROWSE_ACL deny ffffffff/00000000
D [10/May/2003:19:05:31 +0200] AllowIP: CUPS_INTERNAL_BROWSE_ACL allow 00000000/00000000
I [10/May/2003:19:05:31 +0200] Loaded configuration file "/etc/cups/cupsd.conf"
I [10/May/2003:19:05:31 +0200] Configured for up to 100 clients.
I [10/May/2003:19:05:31 +0200] Allowing up to 100 client connections per host.
I [10/May/2003:19:05:31 +0200] Full reload is required.
[.........]
D [10/May/2003:19:05:59 +0200] SetJobHoldUntil: hold_until = 0
D [10/May/2003:19:05:59 +0200] LoadAllJobs: Loading attributes for job 1498...
D [10/May/2003:19:05:59 +0200] SetJobHoldUntil(1498, "indefinite")
D [10/May/2003:19:05:59 +0200] SetJobHoldUntil: hold_until = 0
D [10/May/2003:19:05:59 +0200] LoadAllJobs: Loading attributes for job 1499...
D [10/May/2003:19:05:59 +0200] LoadAllJobs: Loading attributes for job 1500...
D [10/May/2003:19:05:59 +0200] LoadAllJobs: Loading attributes for job 2152...
D [10/May/2003:19:05:59 +0200] LoadAllJobs: Loading attributes for job 2156...
D [10/May/2003:19:05:59 +0200] LoadAllJobs: Loading attributes for job 2157...
D [10/May/2003:19:05:59 +0200] LoadAllJobs: Loading attributes for job 2163...
D [10/May/2003:19:05:59 +0200] LoadAllJobs: Loading attributes for job 2226...

kde-bitshop:/usr/lib/cups/backend # ls -tlar /var/spool/cups/2226
-rw------- 1 lp sys 583 May 10 15:32 /var/spool/cups/c02226

I moved all job (simple ASCII) and control files from the spool directory.
one after the other and re-started again. The signal 11 always occured after
loading job attributes for job 2163. Only when everything above 2226 was
away, did the scheduler start up completely.

So -- what's up with these files' job attributes to cause such a nasty
error? The files are simple ASCII, and the c-files are revealing nothing
special if looked at with the strings utiliy.... (Attached to STR)

Cheers,
Kurt [ BTW, is there a utility to look at the content of the c-files?
Appart from KDEPrint's "IPP report" feature, I mean? ]

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: pipitas

More info:

You'll notice that I am using a few additional backends
and filters. These are mainly shell scripts I play with.
They haven't been changed for a few days, and they did
never cause problems to the scheduler's startup.

What I changed on this system today:

  • added the printers hp8550clj and hp4550
  • printed a few jobs to printers
  • printed a few jobs "on hold" (amongs them the weird ones)
  • upgraded to 1.1.19rc4 (from rc2)
  • tested web interface authentication
  • found problems described in STR job management via web interface not working (authentication problems) #81
  • changed cups.conf from "Satisfy Any" to "Satisfy All"
  • restarted cupsd and encoutered problem.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

The testipp program in the cups subdirectory can be used to list the attributes in the job control file.

The control file for job 2226 has a job-state attribute of type nameWithoutLanguage (it should be an enum...) This is likely the cause of the problem... I'll update the code to check for this and log this error if found, however we need to determine how this happened...

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

The attached patch should correct this problem and has been commited to CVS for rc5.

@michaelrsweet
Copy link
Collaborator Author

"cupsd.conf":

ServerName 10.160.51.60
ServerAdmin root@localhost
Classification none
DefaultCharset UTF-8
DefaultLanguage en
Printcap /etc/printcap
PrintcapFormat BSD
RemoteRoot remroot
SystemGroup sys
ServerCertificate /etc/cups/ssl/server.crt
ServerKey /etc/cups/ssl/server.key

AuthType None
Encryption IfRequested
Satisfy Any
Order deny,allow
Deny None
Allow All
Allow 127.0.0.1
Allow 127.0.0.2

<Location /printers>
AuthType None
Encryption IfRequested
Satisfy Any
Order deny,allow
Deny None
Allow All
Allow 127.0.0.1
Allow 127.0.0.2

<Location /admin>
AuthType Basic
AuthClass System
Encryption IfRequested
Satisfy All
Order deny,allow
Deny All
Allow 127.0.0.1
Allow All
Allow 192.168.*
Allow 10.160.*

<Location /jobs>
AuthType None
Encryption IfRequested
Satisfy Any
Order deny,allow
Deny None
Allow 127.0.0.1
Allow localhost
Allow All

HostnameLookups Off
KeepAlive On
KeepAliveTimeout 60
MaxClients 100
MaxRequestSize 0m
Timeout 60
Port 631
AccessLog /var/log/cups/access_log
ErrorLog /var/log/cups/error_log
PageLog /var/log/cups/page_log
MaxLogSize 0m
LogLevel debug2
PreserveJobHistory On
PreserveJobFiles No
AutoPurgeJobs No
MaxJobs 500
MaxJobsPerPrinter 0
MaxJobsPerUser 0
User lp
Group sys
RIPCache 100m
FilterLimit 0
DataDir /usr/share/cups
DocumentRoot /usr/share/doc/cups
FontPath /usr/share/cups/fonts
RequestRoot /var/spool/cups
ServerBin /usr/lib/cups
ServerRoot /etc/cups
FileDevice Yes
TempDir /var/spool/cups/tmp
Browsing On
BrowseProtocols cups
BrowsePort 631
BrowseInterval 30
BrowseTimeout 60
BrowseAddress 255.255.255.255
BrowseDeny None
BrowseAllow All
BrowseOrder deny,allow
ImplicitClasses On
ImplicitAnyClasses Off
HideImplicitMembers Yes
BrowseShortNames No

@michaelrsweet
Copy link
Collaborator Author

"cupsd-str82.patch":

Index: ipp.c

RCS file: /development/cvs/cups/scheduler/ipp.c,v
retrieving revision 1.214
diff -u -r1.214 ipp.c
--- ipp.c 2003/05/09 15:11:12 1.214
+++ ipp.c 2003/05/12 15:05:30
@@ -114,8 +114,8 @@
static void cancel_all_jobs(client_t *con, ipp_attribute_t *uri);
static void cancel_job(client_t *con, ipp_attribute_t *uri);
static int check_quotas(client_t *con, printer_t *p);
-static void copy_attribute(ipp_t *to, ipp_attribute_t *attr,

  •                  int quickcopy);
    
    +static ipp_attribute_t *copy_attribute(ipp_t *to, ipp_attribute_t *attr,
  •                           int quickcopy);
    
    static void copy_attrs(ipp_t *to, ipp_t *from, ipp_attribute_t *req,
    ipp_tag_t group, int quickcopy);
    static int copy_banner(client_t *con, job_t *job, const char *name);
    @@ -2025,7 +2025,7 @@
    • 'copy_attribute()' - Copy a single attribute.
      */

-static void
+static ipp_attribute_t * /* O - New attribute /
copy_attribute(ipp_t *to, /
O - Destination request/response /
ipp_attribute_t *attr, /
I - Attribute to copy /
int quickcopy)/
I - Do a quick copy? /
@@ -2177,6 +2177,8 @@
}
break; /
anti-compiler-warning-code */
}
+

  • return (toattr);
    }

@@ -5984,6 +5986,12 @@
uri->values[0].string.text);

/*

  • * Start with "everything is OK" status...
  • */
  • con->response->request.status.status_code = IPP_OK;
  • /*
    • See if we have a job URI or a printer URI...
      */

@@ -6076,25 +6084,125 @@
if (attr->group_tag != IPP_TAG_JOB || !attr->name)
continue;

  • if (strcmp(attr->name, "job-originating-host-name") == 0 ||
  •    strcmp(attr->name, "job-originating-user-name") == 0 ||
    
  • strcmp(attr->name, "job-media-sheets-completed") == 0 ||
  • strcmp(attr->name, "job-k-octets") == 0 ||
  • strcmp(attr->name, "job-id") == 0 ||
  • strcmp(attr->name, "job-sheets") == 0 ||
  • strncmp(attr->name, "time-at-", 8) == 0)
  •  continue; /\* Read-only attrs */
    
  • if (!strcmp(attr->name, "attributes-charset") ||
  • !strcmp(attr->name, "attributes-natural-language") ||
  • !strcmp(attr->name, "document-compression") ||
  • !strcmp(attr->name, "document-format") ||
  • !strcmp(attr->name, "job-detailed-status-messages") ||
  • !strcmp(attr->name, "job-document-access-errors") ||
  • !strcmp(attr->name, "job-id") ||
  • !strcmp(attr->name, "job-k-octets") ||
  •    !strcmp(attr->name, "job-originating-host-name") ||
    
  •    !strcmp(attr->name, "job-originating-user-name") ||
    
  • !strcmp(attr->name, "job-printer-up-time") ||
  • !strcmp(attr->name, "job-printer-uri") ||
  • !strcmp(attr->name, "job-sheets") ||
  • !strcmp(attr->name, "job-state-message") ||
  • !strcmp(attr->name, "job-state-reasons") ||
  • !strcmp(attr->name, "job-uri") ||
  • !strcmp(attr->name, "number-of-documents") ||
  • !strcmp(attr->name, "number-of-intervening-jobs") ||
  • !strcmp(attr->name, "output-device-assigned") ||
  • !strncmp(attr->name, "date-time-at-", 13) ||
  • !strncmp(attr->name, "job-impressions", 15) ||
  • !strncmp(attr->name, "job-k-octets", 12) ||
  • !strncmp(attr->name, "job-media-sheets", 16) ||
  • !strncmp(attr->name, "time-at-", 8))
  • {
  • /*
    
  •  \* Read-only attrs!
    
  •  */
    
  • if (strcmp(attr->name, "job-priority") == 0 &&
  •    attr->value_tag == IPP_TAG_INTEGER &&
    
  • job->state->values[0].integer != IPP_JOB_PROCESSING)
  •  send_ipp_error(con, IPP_ATTRIBUTES_NOT_SETTABLE);
    
  •  if ((attr2 = copy_attribute(con->response, attr, 0)) != NULL)
    
  •    attr2->group_tag = IPP_TAG_UNSUPPORTED_GROUP;
    
  •  continue;
    
  • }
  • if (!strcmp(attr->name, "job-priority"))
    {
    /*
  •  \* Change the job priority
    
  •  \* Change the job priority...
    
    */
    +
  •  if (attr->value_tag != IPP_TAG_INTEGER)
    
  •  {
    
  • send_ipp_error(con, IPP_REQUEST_VALUE);
  •  SetJobPriority(jobid, attr->values[0].integer);
    
  • if ((attr2 = copy_attribute(con->response, attr, 0)) != NULL)
  •      attr2->group_tag = IPP_TAG_UNSUPPORTED_GROUP;
    
  •  }
    
  •  else if (job->state->values[0].integer >= IPP_JOB_PROCESSING)
    
  •  {
    
  • send_ipp_error(con, IPP_NOT_POSSIBLE);
  • return;
  •  }
    
  •  else if (con->response->request.status.status_code == IPP_OK)
    
  •    SetJobPriority(jobid, attr->values[0].integer);
    
    }
  • else if (!strcmp(attr->name, "job-state"))
  • {
  • /*
    
  •  \* Change the job state...
    
  •  */
    
  •  if (attr->value_tag != IPP_TAG_ENUM)
    
  •  {
    
  • send_ipp_error(con, IPP_REQUEST_VALUE);
  • if ((attr2 = copy_attribute(con->response, attr, 0)) != NULL)

  •      attr2->group_tag = IPP_TAG_UNSUPPORTED_GROUP;
    
  •  }
    
  •  else
    
  •  {
    
  •    switch (attr->values[0].integer)
    
  • {

  • case IPP_JOB_PENDING :
    
  • case IPP_JOB_HELD :
    
  •     if (job->state->values[0].integer > IPP_JOB_HELD)
    
  •     {
    
  •   send_ipp_error(con, IPP_NOT_POSSIBLE);
    
  •   return;
    
  •     }
    
  •          else if (con->response->request.status.status_code == IPP_OK)
    
  •   job->state->values[0].integer = attr->values[0].integer;
    
  •     break;
    
  • case IPP_JOB_PROCESSING :
    
  • case IPP_JOB_STOPPED :
    
  •     if (job->state->values[0].integer != attr->values[0].integer)
    
  •     {
    
  •   send_ipp_error(con, IPP_NOT_POSSIBLE);
    
  •   return;
    
  •     }
    
  •     break;
    
  • case IPP_JOB_CANCELLED :
    
  • case IPP_JOB_ABORTED :
    
  • case IPP_JOB_COMPLETED :
    
  •     if (job->state->values[0].integer > IPP_JOB_PROCESSING)
    
  •     {
    
  •   send_ipp_error(con, IPP_NOT_POSSIBLE);
    
  •   return;
    
  •     }
    
  •          else if (con->response->request.status.status_code == IPP_OK)
    
  •     {
    
  •            CancelJob(job->id, 0);
    
  •   if (JobHistory)
    
  •   {
    
  •              job->state->values[0].integer = attr->values[0].integer;
    
  •     SaveJob(job->id);
    
  •   }
    
  •     }
    
  •     break;
    
  • }

  •  }
    
  • }

  • else if (con->response->request.status.status_code != IPP_OK)

  •  continue;
    

    else if ((attr2 = ippFindAttribute(job->attrs, attr->name, IPP_TAG_ZERO)) != NULL)
    {
    /*
    @@ -6187,12 +6295,6 @@
    */

    CheckJobs();

  • /*

  • * Return with "everything is OK" status...

- */

  • con->response->request.status.status_code = IPP_OK;
    }

Index: job.c

RCS file: /development/cvs/cups/scheduler/job.c,v
retrieving revision 1.210
diff -u -r1.210 job.c
--- job.c 2003/05/01 17:58:27 1.210
+++ job.c 2003/05/12 15:05:31
@@ -619,7 +619,15 @@
close(fd);
}

  •  job->state = ippFindAttribute(job->attrs, "job-state", IPP_TAG_ENUM);
    
  •  if ((job->state = ippFindAttribute(job->attrs, "job-state", IPP_TAG_ENUM)) == NULL)
    
  •  {
    
  •    LogMessage(L_ERROR, "LoadAllJobs: Missing or bad job-state attribute in control file \"%s\"!",
    
  •          filename);
    
  • ippDelete(job->attrs);

  • free(job);

  • unlink(filename);

  • continue;

  •  }
    

    if ((attr = ippFindAttribute(job->attrs, "job-printer-uri", IPP_TAG_URI)) == NULL)
    {

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

No branches or pull requests

1 participant