OpenPrinting / cups

OpenPrinting CUPS Sources
https://openprinting.github.io/cups
Apache License 2.0
958 stars 174 forks source link

cupsd 2.4.7 crashes due to recent bug fixes (from issue #347) #934

Closed andreas-karlson closed 2 months ago

andreas-karlson commented 2 months ago

I've been doing some testing for the new Ubuntu release (24.04).

I noticed that cupsd crashes consistently after closing my Firefox tab / window. The title of the crash (from the bug-report window) is "cupsd crashed with SIGSEGV in ???()"

The proposed version of cups (2.4.7-1.2ubuntu4) backports the following commits: https://github.com/OpenPrinting/cups/commit/df3718b09f395d59b454e0aa233490ba7f2aa857 (Issue #347) https://github.com/OpenPrinting/cups/commit/6c6e1b0d99417317defab30b67a591e740477a5d (Issue #871) https://github.com/OpenPrinting/cups/commit/ff16dab58e55abb2f71572ba5ddba58f770891ed

I think the following commit introduced the bug since I'm unable to reproduce this behavior with versions prior to the commit being backported (and it has lots of changes): https://github.com/OpenPrinting/cups/commit/df3718b09f395d59b454e0aa233490ba7f2aa857 - fixes https://github.com/OpenPrinting/cups/issues/347

Reproduction steps

  1. Open Firefox and manage CUPS on http://localhost:631
  2. Go to Administration -> Printers -> Add Printer and choose your printer
  3. Add your printer (I used the ipps:// protocol to manage the printer)
  4. After clicking the "Add printer" button, immediately close your Firefox tab
  5. cupsd will crash and Ubuntu will display a bug-report popup

System Information Ubuntu - 24.04 daily builds Firefox - 124.0.1-1 r4033 CUPS - 2.4.7-1.2ubuntu5

Printer Lexmark MS415dn (supported)

michaelrsweet commented 2 months ago

Using your PR for the 2.4.x fix, 2.5 fix is here:

[master 379f5d0da] Fix regression for background queue creation (Issue #934)

andreas-karlson commented 2 months ago

Thanks!

andreas-karlson commented 2 months ago

After additional testing I've discovered that cupsd still crashes in some cases. There needs to be a change in create_local_bg_thread to indicate the thread has finished.

I have updated my branch to accommodate for this change: https://github.com/OpenPrinting/cups/pull/937

michaelrsweet commented 2 months ago

Change for 2.5:

[master d95df8100] Don't mark BG thread done until the response is sent.