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

crash when logging loading of job attributes #4687

Closed
michaelrsweet opened this issue Aug 10, 2015 · 2 comments
Closed

crash when logging loading of job attributes #4687

michaelrsweet opened this issue Aug 10, 2015 · 2 comments

Comments

@michaelrsweet
Copy link
Collaborator

Version: 2.1rc1
CUPS.org User: jpopelka

I'm still seeing one left-over after STR #4661 fix.

The scheduler crashes in cupsdLogJob() in
PWG_JobState"=%s", job_states[job->state_value - IPP_JSTATE_PENDING],
because job->state_value == 0.
Since IPP_JSTATE_PENDING == 3 we try to get job_states[-3].

After fixing (like in the attached patch) this one the scheduler seems to finally start & work OK.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Fixed in Subversion repository.

@michaelrsweet
Copy link
Collaborator Author

"0001-Fix-index-out-of-range-in-cupsdLogJob.patch":

From d6474c395e14b3079dd198fadf7427c67412e816 Mon Sep 17 00:00:00 2001
From: Jiri Popelka jpopelka@redhat.com
Date: Mon, 10 Aug 2015 17:12:32 +0200
Subject: [PATCH] Fix index out of range in cupsdLogJob()


scheduler/log.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scheduler/log.c b/scheduler/log.c
index cef0219..21489d5 100644
--- a/scheduler/log.c
+++ b/scheduler/log.c
@@ -667,7 +667,7 @@ cupsdLogJob(cupsd_job_t job, / I - Job */
PWG_Event"=JobStateChanged",
PWG_ServiceURI"=%s", printer ? printer->uri : "",
PWG_JobID"=%d", job->id,

  •         PWG_JobState"=%s", job_states[job->state_value - IPP_JSTATE_PENDING],
    
  •         PWG_JobState"=%s", job->state_value >= IPP_JSTATE_PENDING ? job_states[job->state_value - IPP_JSTATE_PENDING] : "",
          PWG_JobImpressionsCompleted"=%d", ippGetInteger(job->impressions, 0),
          NULL);
    

    else

    2.5.0

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