[Bug 2049315] Re: cups-browsed running non-stop on two cores

2025-02-07 Thread Till Kamppeter
Jeffrey, thanks for your testing.

The `run-tests.sh` is meant to check whether cups-browsed's original
functionality of creating working print queues is working. Therefore I
never ran it repeatedly.

How often did you run your loop with the old version and with the new
version? Does the old version always do more runs than the new version
before failing?

CI think what you observed is not a regression, as failure already
happened with the old version.

To investigate the occasional failures of the test script I recommend
you to create a new bug, DO NOT mark it as regression of this one, and
attach logs of the failures to it, both the screen output of `run-
tests.sh` and the log file of cups-browsed. Thanks in advance.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2049315

Title:
  cups-browsed running non-stop on two cores

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups-browsed/+bug/2049315/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2049315] Re: cups-browsed running non-stop on two cores

2025-02-06 Thread Jeffrey Knockel
Hi Till,

I've tried running this test in a loop:

```
while { echo 3; echo N; echo; } | run-tests.sh; do true; done
```

With the new version of cups-browsed from -proposed, it ran 14
iterations until failure (i.e., until a nonzero exit status).  However,
with the old version of cups-browsed, it still failed, but after 141
iterations.  So I don't really know how to interpret this or if this
difference is significant.  It seems unideal that the test inevitably
fails for me regardless of which version I am testing!

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2049315

Title:
  cups-browsed running non-stop on two cores

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups-browsed/+bug/2049315/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2049315] Re: cups-browsed running non-stop on two cores

2025-02-06 Thread Launchpad Bug Tracker
This bug was fixed in the package cups-browsed - 2.0.0-0ubuntu10.3

---
cups-browsed (2.0.0-0ubuntu10.3) noble; urgency=medium

  * 0003-separate-http-connections.patch: Fixed cups-browsed getting
stuck with 100% CPU on 1 or 2 cores (LP: #2049315, LP: #2067918,
LP: #2073504, CUPS upstream issue #879).

 -- Till Kamppeter   Sun, 12 Jan 2025 14:39:33
+0100

** Changed in: cups-browsed (Ubuntu Noble)
   Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2049315

Title:
  cups-browsed running non-stop on two cores

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups-browsed/+bug/2049315/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2049315] Re: cups-browsed running non-stop on two cores

2025-02-06 Thread Launchpad Bug Tracker
This bug was fixed in the package cups-browsed - 2.0.1-0ubuntu2.2

---
cups-browsed (2.0.1-0ubuntu2.2) oracular; urgency=medium

  * 0003-separate-http-connections.patch: Fixed cups-browsed getting
stuck with 100% CPU on 1 or 2 cores (LP: #2049315, LP: #2067918,
LP: #2073504, CUPS upstream issue #879).

 -- Till Kamppeter   Sun, 12 Jan 2025 15:17:33
+0100

** Changed in: cups-browsed (Ubuntu Oracular)
   Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2049315

Title:
  cups-browsed running non-stop on two cores

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups-browsed/+bug/2049315/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2049315] Re: cups-browsed running non-stop on two cores

2025-02-06 Thread Till Kamppeter
Sorry for posting a test case only focusing on the busy-loop bug going
away. Important is also that cups-browsed is still doing its original
functionality  of automatically creating print queues for network
printers (IPP printers, remote CUPS queues, Printer Applications)
correctly.

At least nobody commented here that their printing ceased to work after
the update.

I checked the functionality on my Oracular system with my printers, but
it is also checked, for both Oracular and Noble, by it passing its
autopkgtest (otherwise the package had not made it into -proposed).

My autopkgtest is the script test/run-tests.sh in the upstream source of
cups-browsed.

While cups-browsed and also cupsd is running this script

- creates two software emulations of driverless IPP printers (Printer 
Applications) with unique names, and 
  printing jobs into a file
- waits until cups-browsed has auto-created CUPS queues for them, checking the 
presence of the queues with 
  "lpstat -v"
- sends a print job to one of them
- waits until the job appears in the CUPS queue and disappears from it
- checks the presence of the print job output file
- kills the Printer Applications
- checks whether cups-browsed removes the queues
- shuts down cups-browsed

This test can be easily done by anyone of you, no printer required.
Install it via

sudo apt install cups-browsed-tests

Then run (no root or sudo required):

run-tests.sh

Answer the questions with "3" (use system's cups-browsed) and "N" (do
not use Valgrind).

The above-mentioned test sequence is done, verbosely telling on the
screen what is happening. If all got done correctly, the exit status is
0.

Run

echo $?

to check the exit status.


** Description changed:

  [ Impact ]
  
  During the past months it often happened that a user observed that cups-
  browsed takes 100% or 200% (2 cores) of CPU and ceases to do its actual
  work. This even happens for users who do not print anything, just
  printers shared by other computers in the local network, triggering
  cups-browsed to make them available on the local machine, can make cups-
  browsed getting stuck hogging 1 or 2 CPU cores. To free the CPU cores
  and make cups-browsed working again one needs to kill and restart it.
  
  The bug is not easily reproducible. It only occurs sporadically.
  Restarting a stuck cups-browsed will not end up getting it stuck
  immediately again.
  
  It is annoying for the user that suddenly a significant part of their
  CPU power gets hogged and the machine's fan producing noise. Especially
  most users do not know the root cause of it and how to stop it.
  
  The problem is caused by concurrent use of one global HTTP connection to
  CUPS by several sub-threads. This corrupts the data structure which
  makes the httpGets() function of CUPS fall into an infinite loop. The
  proposed packages (for Noble and Oracular) contain a backport of the fix
  of the upstream version 2.1.1 (already uploaded to Plucky). This fix
  lets each function create its own HTTP connection to CUPS instead of
  using one single global one. None of these is used by multiple threads
  and therefore the problem should go away.
  
  The fix I did solely do by taking a few backtraces (by reporters of the
  bug and one where I observed the bug by myself) to locate it (gets
  always stuck in httpGets() of libcups), and reviewing the HTTP-related
  code of libcups and of cups-browsed, discovering the described problem
  and remedying it as described. I did not do any before/after testing. I
  only based my self on my observations and code reviews.
  
  What happens in httpGets() is described in my comments here (especially
  near the end):
  
  https://github.com/OpenPrinting/cups/issues/879
  
  [ Test Plan ]
  
  UPDATE
  
  Please everybody do this test, especially users of Oracular (24.10) as
  we are still needing verification there.
  
  Paste the following script into a file
  
  ```
  #!/bin/sh
  
  while true; do
  service cups-browsed restart
  printf .
  sleep 15s
  done
  ```
  
  and make the file executable. Then execute the file and leave it running
  for some hours.
  
  Without the update applied, cups-browsed will sooner or later get stuck
  with 100% CPU. Once this happens, it will require a SIGKILL signal
  ("kill -9") to be stopped. As the "service cups-browsed restart" command
  only sends SIGTERM, the stuck cups-browsed will keep running on 100% CPU
  while the script is spinning and trying to restart cups-browsed every 15
  sec. This way you will see the failure whenever you come back and check,
  no need to be present through the whole process.
  
  Now stop the script with Ctrl+C and do
  
  ```
  killall -9 cups-browsed
  ```
  
  After that update to package with the fix proposed here.
  
  Now run the script again and leave it running for some hours. cups-
  browsed should not get stuck.
  
  Thanks a lot, Jeffrey Knockel (jeff250), for providing this testing
  method (comme

[Bug 2049315] Re: cups-browsed running non-stop on two cores

2025-01-28 Thread Till Kamppeter
I have now tested with the script of @jeff250 on Oracular.

Unfortunately, a failure of cups-browsed does not stop the script, cups-
browsed gets killed after a timeout of 90 second.

So to capture failures I ran the following command from another
terminal:

while true; do sleep 2; ps aux | grep /usr/sbin/cups-browsed | grep -v
grep; done | tee log.txt

This produces a line like

cups-br+  949545  0.2  0.0 817024 20968 ?Ssl  08:58   0:00
/usr/sbin/cups-browsed

every 2 seconds.

With the ¨0:00" right before "/usr/sbin/cups-browsed" being the
accumulated CPU time of the process. Not getting stuck, cups-browsed
never accumulates visible CPU time when running only 15 seconds, but
hanging in a busy loop for op to 90 seconds the CPU time gets visible.

So

grep -v ' 0:00 /usr/sbin/cups-browsed' log.txt

easily reveals the fact.

Now I ran the script for 3 hours with the original cups-browsed package
and got ~10 failures. After that I updated to the fixed package and ran
8 hours (over night) and got no failure at all.

So the in the new version the bug is fixed.

Marking this SRU as verified.

** Description changed:

  [ Impact ]
  
  During the past months it often happened that a user observed that cups-
  browsed takes 100% or 200% (2 cores) of CPU and ceases to do its actual
  work. This even happens for users who do not print anything, just
  printers shared by other computers in the local network, triggering
  cups-browsed to make them available on the local machine, can make cups-
  browsed getting stuck hogging 1 or 2 CPU cores. To free the CPU cores
  and make cups-browsed working again one needs to kill and restart it.
  
  The bug is not easily reproducible. It only occurs sporadically.
  Restarting a stuck cups-browsed will not end up getting it stuck
  immediately again.
  
  It is annoying for the user that suddenly a significant part of their
  CPU power gets hogged and the machine's fan producing noise. Especially
  most users do not know the root cause of it and how to stop it.
  
  The problem is caused by concurrent use of one global HTTP connection to
  CUPS by several sub-threads. This corrupts the data structure which
  makes the httpGets() function of CUPS fall into an infinite loop. The
  proposed packages (for Noble and Oracular) contain a backport of the fix
  of the upstream version 2.1.1 (already uploaded to Plucky). This fix
  lets each function create its own HTTP connection to CUPS instead of
  using one single global one. None of these is used by multiple threads
  and therefore the problem should go away.
  
  The fix I did solely do by taking a few backtraces (by reporters of the
  bug and one where I observed the bug by myself) to locate it (gets
  always stuck in httpGets() of libcups), and reviewing the HTTP-related
  code of libcups and of cups-browsed, discovering the described problem
  and remedying it as described. I did not do any before/after testing. I
  only based my self on my observations and code reviews.
  
  What happens in httpGets() is described in my comments here (especially
  near the end):
  
  https://github.com/OpenPrinting/cups/issues/879
  
  [ Test Plan ]
  
  UPDATE
  
  Please everybody do this test, especially users of Oracular (24.10) as
  we are still needing verification there.
  
  Paste the following script into a file
  
  ```
  #!/bin/sh
  
  while true; do
  service cups-browsed restart
  printf .
  sleep 15s
  done
  ```
  
  and make the file executable. Then execute the file and leave it running
  for some hours.
  
  Without the update applied, cups-browsed will sooner or later get stuck
  with 100% CPU. Once this happens, it will require a SIGKILL signal
  ("kill -9") to be stopped. As the "service cups-browsed restart" command
  only sends SIGTERM, the stuck cups-browsed will keep running on 100% CPU
  while the script is spinning and trying to restart cups-browsed every 15
  sec. This way you will see the failure whenever you come back and check,
  no need to be present through the whole process.
  
  Now stop the script with Ctrl+C and do
  
  ```
  killall -9 cups-browsed
  ```
  
  After that update to package with the fix proposed here.
  
  Now run the script again and leave it running for some hours. cups-
  browsed should not get stuck.
  
  Thanks a lot, Jeffrey Knockel (jeff250), for providing this testing
  method (comment #40).
+ 
+ UPDATE 2
+ 
+ Unfortunately, a failure of cups-browsed does not stop the script, cups-
+ browsed gets killed after a timeout of 90 seconds.
+ 
+ So to capture failures I ran the following command from another
+ terminal:
+ 
+ while true; do sleep 2; ps aux | grep /usr/sbin/cups-browsed | grep -v
+ grep; done | tee log.txt
+ 
+ This produces a line like
+ 
+ cups-br+ 949545 0.2 0.0 817024 20968 ? Ssl 08:58 0:00 /usr/sbin/cups-
+ browsed
+ 
+ every 2 seconds.
+ 
+ With the ¨0:00" right before "/usr/sbin/cups-browsed" being the
+ accumulated CPU time of the process. Not gettin

[Bug 2049315] Re: cups-browsed running non-stop on two cores

2025-01-28 Thread Till Kamppeter
** Tags removed: verification-needed verification-needed-oracular
** Tags added: verification-done verification-done-oracular

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2049315

Title:
  cups-browsed running non-stop on two cores

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups-browsed/+bug/2049315/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2049315] Re: cups-browsed running non-stop on two cores

2025-01-21 Thread Till Kamppeter
Did you kill the old instance of cups-browsed, which was stuck on 200%
CPU, with

```
killall -9 cups-browsed
```

before doing the update?

If not, the update can take significantly longer. This is due to the
fact that on regular restarting of cups-browsed only the SIGTERM signal
(`kill -TERM`) is used, and this does not stop the stuck cups-browsed.
Therefore, after a certain timeout period with the cups-browsed process
not disappearing a SIGKILL is sent (`kill -9`).

To make sure that your updated cups-browsed is actually not getting
stuck any more, please follow the "[ Test Plan ]" procedure in the
description at the top of this bug report.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2049315

Title:
  cups-browsed running non-stop on two cores

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups-browsed/+bug/2049315/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2049315] Re: cups-browsed running non-stop on two cores

2025-01-20 Thread Pavel Petrovic
Hi, I am on Ubuntu 24.04.1 LTS

ASUS Vivobook Laptop.

200% CPU used by cups-browsed.

Found this bug report, added the noble-proposed into apt sources,
updated apt, then issued:

$ sudo apt install cups-browsed/noble-proposed

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Selected version '2.0.0-0ubuntu10.3' (Ubuntu:24.04/noble-proposed [amd64]) for 
'cups-browsed'
The following packages were automatically installed and are no longer required:
  libpkcs11-helper1t64 nvidia-firmware-535-535.183.01 python3-netifaces
Use 'sudo apt autoremove' to remove them.
The following packages will be upgraded:
  cups-browsed
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 118 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu noble-proposed/main amd64 cups-browsed 
amd64 2.0.0-0ubuntu10.3 [118 kB]
Fetched 118 kB in 0s (565 kB/s)
(Reading database ... 49 files and directories currently installed.)
Preparing to unpack .../cups-browsed_2.0.0-0ubuntu10.3_amd64.deb ...
Unpacking cups-browsed (2.0.0-0ubuntu10.3) over (2.0.0-0ubuntu10.2) ...
Setting up cups-browsed (2.0.0-0ubuntu10.3) ...
Processing triggers for man-db (2.12.0-4build2) ...

the setting of the package got stuck on 60% for a minute or so... almost
thought I have to kill it, but eventually finished and now:

finally the cooler fan is quiet and the CPU utilization went down to
about 0%. Hopefully it will stay so, if not, I will report here.

THANKS.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2049315

Title:
  cups-browsed running non-stop on two cores

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups-browsed/+bug/2049315/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2049315] Re: cups-browsed running non-stop on two cores

2025-01-20 Thread Till Kamppeter
** Description changed:

  [ Impact ]
  
  During the past months it often happened that a user observed that cups-
  browsed takes 100% or 200% (2 cores) of CPU and ceases to do its actual
  work. This even happens for users who do not print anything, just
  printers shared by other computers in the local network, triggering
  cups-browsed to make them available on the local machine, can make cups-
  browsed getting stuck hogging 1 or 2 CPU cores. To free the CPU cores
  and make cups-browsed working again one needs to kill and restart it.
  
  The bug is not easily reproducible. It only occurs sporadically.
  Restarting a stuck cups-browsed will not end up getting it stuck
  immediately again.
  
  It is annoying for the user that suddenly a significant part of their
  CPU power gets hogged and the machine's fan producing noise. Especially
  most users do not know the root cause of it and how to stop it.
  
  The problem is caused by concurrent use of one global HTTP connection to
  CUPS by several sub-threads. This corrupts the data structure which
  makes the httpGets() function of CUPS fall into an infinite loop. The
  proposed packages (for Noble and Oracular) contain a backport of the fix
  of the upstream version 2.1.1 (already uploaded to Plucky). This fix
  lets each function create its own HTTP connection to CUPS instead of
  using one single global one. None of these is used by multiple threads
  and therefore the problem should go away.
  
  The fix I did solely do by taking a few backtraces (by reporters of the
  bug and one where I observed the bug by myself) to locate it (gets
  always stuck in httpGets() of libcups), and reviewing the HTTP-related
  code of libcups and of cups-browsed, discovering the described problem
  and remedying it as described. I did not do any before/after testing. I
  only based my self on my observations and code reviews.
  
  What happens in httpGets() is described in my comments here (especially
  near the end):
  
  https://github.com/OpenPrinting/cups/issues/879
  
  [ Test Plan ]
+ 
+ UPDATE
+ 
+ Please everybody do this test, especially users of Oracular (24.10) as
+ we are still needing verification there.
+ 
+ Paste the following script into a file
+ 
+ ```
+ #!/bin/sh
+ 
+ while true; do
+ service cups-browsed restart
+ printf .
+ sleep 15s
+ done
+ ```
+ 
+ and make the file executable. Then execute the file and leave it running
+ for some hours.
+ 
+ Without the update applied, cups-browsed will sooner or later get stuck
+ with 100% CPU. Once this happens, it will require a SIGKILL signal
+ ("kill -9") to be stopped. As the "service cups-browsed restart" command
+ only sends SIGTERM, the stuck cups-browsed will keep running on 100% CPU
+ while the script is spinning and trying to restart cups-browsed every 15
+ sec. This way you will see the failure whenever you come back and check,
+ no need to be present through the whole process.
+ 
+ Now stop the script with Ctrl+C and do
+ 
+ ```
+ killall -9 cups-browsed
+ ```
+ 
+ After that update to package with the fix proposed here.
+ 
+ Now run the script again and leave it running for some hours. cups-
+ browsed should not get stuck.
+ 
+ ORIGINAL TEXT
  
  Due to the problem only occuring sporadically it is not easy to make a
  test, install the proposed, fixed version, do the same test again and
  see that the problem has disappeared.
  
  But if somebody of you observes the bug with a certain frequency, like
  in 1 of 10 attempts for example, you could try until getting the bug
  with the old version, update, and then try again, if you reach a
  reasonably high number of tests without the bug occuring again, you
  could consider it as fixed.
  
  The bug requires cups-browsed to create or remove local CUPS queues for
  remote printers, so that it interacts with the local CUPS, which it does
  by IPP, using libcups' HTTP API. This requires the appearing and
  disappearing of network printers, emulations of them with tools like
  ippeveprinter, or shared remote CUPS queues. Also disruption in the
  network connection between a remote server (printer, CUPS) and the
  client, like shutting down network connection or suspending the machine
  could cause the problem.
  
  A possible situation where it happened but we have no proof was on a
  Canonical Sprint (where all of Canonical's engineers meet physically). I
  have some print queues on my laptop which are shared (and so other
  people could see them in their print dialogs) and during the event I
  often had to get from one room to another and for that I closed my
  laptop, it suspended, and went to the other room where I opened again.
  Other people on the event observed the bug. I already tried to cause it
  by myself, suspending a laptop which shares printers and observing cups-
  browsed on another laptop but I was not able to reproduce it. Probably
  the Sprint with a big network and many people is a different situation.
  
  So unfortuna

[Bug 2049315] Re: cups-browsed running non-stop on two cores

2025-01-20 Thread Till Kamppeter
@jeff250, thank you very much! And also thanks a lot for finding a
method to reproduce the problem. I did not come to the idea that one
could hammer the daemon with restarts, was only thinking about remote
print queues.

So anybody else here, especially with an Oracular system, please do the
same test as Jeffrey did.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2049315

Title:
  cups-browsed running non-stop on two cores

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups-browsed/+bug/2049315/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2049315] Re: cups-browsed running non-stop on two cores

2025-01-20 Thread Jeffrey Knockel
Thanks Timo.  I have tested the noble package from the -proposed
repository using the following script:

```
#!/bin/sh

while true; do
service cups-browsed restart
printf .
sleep 15s
done
```

On two different machines, *before* upgrading to the package in
-proposed, this script got the cups-browsed service caught in a 100%
loop in under 15 minutes on two different machines (this script will
fail to restart the service after it gets stuck, so the service will be
stuck at 100% CPU where it can be easily observed until it is
SIGKILL'd).  Then, *after* upgrading to the package in -proposed, I have
been running this script on two machines for over six hours without it
getting stuck on either.

** Tags removed: verification-needed-noble
** Tags added: verification-done-noble

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2049315

Title:
  cups-browsed running non-stop on two cores

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups-browsed/+bug/2049315/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2049315] Re: cups-browsed running non-stop on two cores

2025-01-17 Thread Timo Aaltonen
Hello Heinrich, or anyone else affected,

Accepted cups-browsed into noble-proposed. The package will build now
and be available at https://launchpad.net/ubuntu/+source/cups-
browsed/2.0.0-0ubuntu10.3 in a few hours, and then in the -proposed
repository.

Please help us by testing this new package.  See
https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how
to enable and use -proposed.  Your feedback will aid us getting this
update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug,
mentioning the version of the package you tested, what testing has been
performed on the package and change the tag from verification-needed-
noble to verification-done-noble. If it does not fix the bug for you,
please add a comment stating that, and change the tag to verification-
failed-noble. In either case, without details of your testing we will
not be able to proceed.

Further information regarding the verification process can be found at
https://wiki.ubuntu.com/QATeam/PerformingSRUVerification .  Thank you in
advance for helping!

N.B. The updated package will be released to -updates after the bug(s)
fixed by this package have been verified and the package has been in
-proposed for a minimum of 7 days.

** Changed in: cups-browsed (Ubuntu Noble)
   Status: Confirmed => Fix Committed

** Tags added: verification-needed-noble

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2049315

Title:
  cups-browsed running non-stop on two cores

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups-browsed/+bug/2049315/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2049315] Re: cups-browsed running non-stop on two cores

2025-01-17 Thread Timo Aaltonen
Hello Heinrich, or anyone else affected,

Accepted cups-browsed into oracular-proposed. The package will build now
and be available at https://launchpad.net/ubuntu/+source/cups-
browsed/2.0.1-0ubuntu2.2 in a few hours, and then in the -proposed
repository.

Please help us by testing this new package.  See
https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how
to enable and use -proposed.  Your feedback will aid us getting this
update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug,
mentioning the version of the package you tested, what testing has been
performed on the package and change the tag from verification-needed-
oracular to verification-done-oracular. If it does not fix the bug for
you, please add a comment stating that, and change the tag to
verification-failed-oracular. In either case, without details of your
testing we will not be able to proceed.

Further information regarding the verification process can be found at
https://wiki.ubuntu.com/QATeam/PerformingSRUVerification .  Thank you in
advance for helping!

N.B. The updated package will be released to -updates after the bug(s)
fixed by this package have been verified and the package has been in
-proposed for a minimum of 7 days.

** Changed in: cups-browsed (Ubuntu Oracular)
   Status: Confirmed => Fix Committed

** Tags added: verification-needed verification-needed-oracular

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2049315

Title:
  cups-browsed running non-stop on two cores

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups-browsed/+bug/2049315/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2049315] Re: cups-browsed running non-stop on two cores

2025-01-12 Thread Till Kamppeter
I have backported the fix from cups-browsed 2.1.1 also to the cups-
browsed packages of Noble (2.0.0-0ubuntu10.3) and Oracular
(2.0.1-0ubuntu2.2) and uploaded them.

As soon as these packages are accepted into the -proposed repositories,
testing instructions will get posted here. Please test then and report
your results here.

** Description changed:

+ [ Impact ]
+ 
+ During the past months it often happened that a user observed that cups-
+ browsed takes 100% or 200% (2 cores) of CPU and ceases to do its actual
+ work. This even happens for users who do not print anything, just
+ printers shared by other computers in the local network, triggering
+ cups-browsed to make them available on the local machine, can make cups-
+ browsed getting stuck hogging 1 or 2 CPU cores. To free the CPU cores
+ and make cups-browsed working again one needs to kill and restart it.
+ 
+ The bug is not easily reproducible. It only occurs sporadically.
+ Restarting a stuck cups-browsed will not end up getting it stuck
+ immediately again.
+ 
+ It is annoying for the user that suddenly a significant part of their
+ CPU power gets hogged and the machine's fan producing noise. Especially
+ most users do not know the root cause of it and how to stop it.
+ 
+ The problem is caused by concurrent use of one global HTTP connection to
+ CUPS by several sub-threads. This corrupts the data structure which
+ makes the httpGets() function of CUPS fall into an infinite loop. The
+ proposed packages (for Noble and Oracular) contain a backport of the fix
+ of the upstream version 2.1.1 (already uploaded to Plucky). This fix
+ lets each function create its own HTTP connection to CUPS instead of
+ using one single global one. None of these is used by multiple threads
+ and therefore the problem should go away.
+ 
+ The fix I did solely do by taking a few backtraces (by reporters of the
+ bug and one where I observed the bug by myself) to locate it (gets
+ always stuck in httpGets() of libcups), and reviewing the HTTP-related
+ code of libcups and of cups-browsed, discovering the described problem
+ and remedying it as described. I did not do any before/after testing. I
+ only based my self on my observations and code reviews.
+ 
+ What happens in httpGets() is described in my comments here (especially
+ near the end):
+ 
+ https://github.com/OpenPrinting/cups/issues/879
+ 
+ [ Test Plan ]
+ 
+ Due to the problem only occuring sporadically it is not easy to make a
+ test, install the proposed, fixed version, do the same test again and
+ see that the problem has disappeared.
+ 
+ But if somebody of you observes the bug with a certain frequency, like
+ in 1 of 10 attempts for example, you could try until getting the bug
+ with the old version, update, and then try again, if you reach a
+ reasonably high number of tests without the bug occuring again, you
+ could consider it as fixed.
+ 
+ The bug requires cups-browsed to create or remove local CUPS queues for
+ remote printers, so that it interacts with the local CUPS, which it does
+ by IPP, using libcups' HTTP API. This requires the appearing and
+ disappearing of network printers, emulations of them with tools like
+ ippeveprinter, or shared remote CUPS queues. Also disruption in the
+ network connection between a remote server (printer, CUPS) and the
+ client, like shutting down network connection or suspending the machine
+ could cause the problem.
+ 
+ A possible situation where it happened but we have no proof was on a
+ Canonical Sprint (where all of Canonical's engineers meet physically). I
+ have some print queues on my laptop which are shared (and so other
+ people could see them in their print dialogs) and during the event I
+ often had to get from one room to another and for that I closed my
+ laptop, it suspended, and went to the other room where I opened again.
+ Other people on the event observed the bug. I already tried to cause it
+ by myself, suspending a laptop which shares printers and observing cups-
+ browsed on another laptop but I was not able to reproduce it. Probably
+ the Sprint with a big network and many people is a different situation.
+ 
+ So unfortunately I am not able to force the occurrence of this bug.
+ 
+ A possible way could be brute-forcing with many printers, writing a
+ script starting 100s of instances of ippeveprinter or so.
+ 
+ To test cups-browsed without having a printer one can use cups-browsed's
+ own test script, test/run-tests.sh in the source code of cups-browsed.
+ 
+ The test script, applying to the installed cups-browsed can be run most
+ easily as follows:
+ 
+ $ sudo apt install cups-browsed-tests
+ $ mkdir test
+ $ cd test
+ $ cp /usr/share/cups-browsed-tests/* .
+ $ /usr/bin/run-tests.sh 3 no
+ 
+ The script creates 2 printers with ippeveprinter, checks whether cups-
+ browsed creates queues for them, printes on one of them, checks
+ completion of the job, then stops the ippeveprinter instances one by one
+ and checks 

[Bug 2049315] Re: cups-browsed running non-stop on two cores

2025-01-12 Thread Till Kamppeter
** Also affects: cups-browsed (Ubuntu Oracular)
   Importance: Undecided
   Status: New

** Also affects: cups-browsed (Ubuntu Plucky)
   Importance: Undecided
   Status: Fix Released

** Also affects: cups-browsed (Ubuntu Noble)
   Importance: Undecided
   Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2049315

Title:
  cups-browsed running non-stop on two cores

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups-browsed/+bug/2049315/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2049315] Re: cups-browsed running non-stop on two cores

2025-01-11 Thread Launchpad Bug Tracker
This bug was fixed in the package cups-browsed - 2.1.1-0ubuntu1

---
cups-browsed (2.1.1-0ubuntu1) plucky; urgency=medium

  * New upstream release
- Fixed cups-browsed getting stuck with 100% CPU on 1 or 2 cores
  (LP: #2049315, LP: #2067918, LP: #2073504, CUPS upstream issue #879).
- Fix for CVE-2024-47176 included.
  * Removed patches for CVE-2024-47176, included upstream.
  * Updated the remaining patches.

 -- Till Kamppeter   Sat, 11 Jan 2025 22:16:34
+0100

** Changed in: cups-browsed (Ubuntu)
   Status: Confirmed => Fix Released

** CVE added: https://cve.mitre.org/cgi-bin/cvename.cgi?name=2024-47176

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2049315

Title:
  cups-browsed running non-stop on two cores

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups-browsed/+bug/2049315/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2049315] Re: cups-browsed running non-stop on two cores

2024-12-18 Thread Till Kamppeter
I have now followed my suspect what can have caused the 100%-CPU issue
in cups-browsed, that there was a global HTTP connection and it was used
by paralalizing threads. So I have done away with the global HTTP
connection:

https://github.com/OpenPrinting/cups-browsed/commit/a8b645e4b3

I have done a regression test by running make check, which is running
cups-browsed with emulated network printers and also sending jobs
through the auto-created queues.

As the bug is not easily reproducible, occurs only sporadically, the
change has to be tried out. I will make it available in packages soon.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2049315

Title:
  cups-browsed running non-stop on two cores

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups-browsed/+bug/2049315/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2049315] Re: cups-browsed running non-stop on two cores

2024-11-25 Thread Matthias May
Okay, after a couple of days of testing, the problem still did not come
back, even after activating 'Browsing Yes' in cupsd.conf. In other
words, setting

BrowseRemoteProtocols none
BrowseProtocols none

in /etc/cups/cups-browsed.conf

is sufficient as a workaround.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2049315

Title:
  cups-browsed running non-stop on two cores

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups-browsed/+bug/2049315/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2049315] Re: cups-browsed running non-stop on two cores

2024-11-20 Thread Matthias May
@Till: I have reverted the changes to /etc/cups/cupsd.conf back to
'BrowseLocalProtocols dnssd' and the problem still does not occur.
However, my default setting there was 'Browsing No'. I am now also
testing 'Browsing Yes' in cupsd.conf.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2049315

Title:
  cups-browsed running non-stop on two cores

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups-browsed/+bug/2049315/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2049315] Re: cups-browsed running non-stop on two cores

2024-11-19 Thread John V
I have sent an ubuntu bug with it maxing out 3 cores

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2049315

Title:
  cups-browsed running non-stop on two cores

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups-browsed/+bug/2049315/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2049315] Re: cups-browsed running non-stop on two cores

2024-11-07 Thread Till Kamppeter
@matthias-may, if you turn off browsing in cups-browed.conf but not in
cupsd.conf, does the problem (high CPU usage by cups-browsed) still
occur?

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2049315

Title:
  cups-browsed running non-stop on two cores

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups-browsed/+bug/2049315/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2049315] Re: cups-browsed running non-stop on two cores

2024-11-07 Thread Matthias May
Also in my university network environment, this bug made me stop the
transition of other machines, that I manage, to Ubuntu 24.04 or higher.

For me, the following workaround, disabling browsing, seems to work.
That means I set

BrowseRemoteProtocols none
BrowseProtocols none

in /etc/cups/cups-browsed.conf

and

BrowseLocalProtocols none

in /etc/cups/cupsd.conf

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2049315

Title:
  cups-browsed running non-stop on two cores

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups-browsed/+bug/2049315/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2049315] Re: cups-browsed running non-stop on two cores

2024-10-30 Thread Leon White
I updated to Ubuntu 24.10 and I'm still experiencing this problem with
cups 2.4.10-1ubuntu2

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2049315

Title:
  cups-browsed running non-stop on two cores

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups-browsed/+bug/2049315/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2049315] Re: cups-browsed running non-stop on two cores

2024-09-12 Thread Jeffrey Knockel
> We are in function httpGets() which seemingly has been called with parameter 
> line being a NUL terminated string "Content-Security-Policy".
> 
> We cycle in the loop 'while (lineptr < lineend)'.
> http->used = -47
> bufptr > bufend
> *lineptr = "Content-Security-Policy"
>
> As bufptr > bufend we never set eol.
>
> The function expects as input a string terminated by a linefeed. But the 
> parameter line = "Content-Security-Policy" has no linefeed. We should not 
> rely on web-servers providing well formed responses.

I think we have to rethink what is happening here a bit.  In gdb, after
hitting the infinite loop, I investigated the underlying file descriptor
by printing `http->fd` and then matching it with what was outputted by
`lsof`.  I found a surprising discovery -- the file descriptor in use
wasn't an Internet socket -- it was a Unix domain socket!  I suspect the
infinite loop we are hitting is from cups-browsed querying
`/run/cups/cups.sock`.  I believe that your debugging above Heinrich
supports this hypothesis as well, since "Content-Security-Policy" is one
of the headers returned by `/run/cups/cups.sock`.  I am curious if you
can reproduce my finding.

For me, this was an unexpected discovery because if my analysis is
correct then (1) I don't think we can easily blame buggy network
printers for what is happening (but maybe the cups server is buggy?) and
(2) I also don't think we can explain the nondeterminism behind this bug
by appealing to random network errors, since this issue is occurring
over a Unix domain socket and not (e.g.) a dodgy WiFi connection.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2049315

Title:
  cups-browsed running non-stop on two cores

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups-browsed/+bug/2049315/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2049315] Re: cups-browsed running non-stop on two cores

2024-09-10 Thread Michael De La Rue
I sent an ubuntu-bug.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2049315

Title:
  cups-browsed running non-stop on two cores

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups-browsed/+bug/2049315/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2049315] Re: cups-browsed running non-stop on two cores

2024-09-10 Thread Michael De La Rue
ps aux | grep cups-b
root2095  0.0  0.0   2892  1280 ?Ss   Sep09   0:00 /bin/sh 
/snap/cups/1058/scripts/run-cups-browsed
root2428  0.0  0.0   2892   768 ?SSep09   0:00 /bin/sh 
/snap/cups/1058/scripts/run-cups-browsed
cups-br+2856  163  0.0 416060 21656 ?Rsl  Sep09 2716:27 
/usr/sbin/cups-browsed

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2049315

Title:
  cups-browsed running non-stop on two cores

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups-browsed/+bug/2049315/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2049315] Re: cups-browsed running non-stop on two cores

2024-08-20 Thread Leon White
I'm currently experiencing this issue 2-3 times a day if I can help with
any further debugging, seems my environment is particularly prone to it.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2049315

Title:
  cups-browsed running non-stop on two cores

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups-browsed/+bug/2049315/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2049315] Re: cups-browsed running non-stop on two cores

2024-08-13 Thread Leon White
And gdb output

** Attachment added: "cups-browsed-gdb.txt"
   
https://bugs.launchpad.net/ubuntu/+source/cups-browsed/+bug/2049315/+attachment/5805406/+files/cups-browsed-gdb.txt

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2049315

Title:
  cups-browsed running non-stop on two cores

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups-browsed/+bug/2049315/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2049315] Re: cups-browsed running non-stop on two cores

2024-08-13 Thread Leon White
I am experiencing this problem at work and followed the instructions
from https://bugs.launchpad.net/ubuntu/+source/cups-
browsed/+bug/2049315/comments/13, logs are attached


** Attachment added: "Debug logs"
   
https://bugs.launchpad.net/ubuntu/+source/cups-browsed/+bug/2049315/+attachment/5805405/+files/cups-browsed-debug-log.txt

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2049315

Title:
  cups-browsed running non-stop on two cores

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups-browsed/+bug/2049315/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2049315] Re: cups-browsed running non-stop on two cores

2024-06-22 Thread Till Kamppeter
No, the CUPS of 24.04 is 2.4.7.

I am have currently installed 2.4.8 from source and I will see if it
actually prevents the problem, but it will need some days to get good
evidence whether the bug is really fixed.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2049315

Title:
  cups-browsed running non-stop on two cores

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups-browsed/+bug/2049315/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2049315] Re: cups-browsed running non-stop on two cores

2024-06-22 Thread Tom Chiverton
> CUPS 2.4.8 got released and the fix
https://github.com/OpenPrinting/cups/issues/879 is included.

Is this incorporated into 24.04 yet ?

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2049315

Title:
  cups-browsed running non-stop on two cores

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups-browsed/+bug/2049315/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2049315] Re: cups-browsed running non-stop on two cores

2024-06-12 Thread theofficialgman
I frequently get 100% cups-browsed
should I open a separate report?

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2049315

Title:
  cups-browsed running non-stop on two cores

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups-browsed/+bug/2049315/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2049315] Re: cups-browsed running non-stop on two cores

2024-05-09 Thread Till Kamppeter
So you got the 200% on cupsd now, not on cups-browsed? Seems that cupsd
can run into a similar bug.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2049315

Title:
  cups-browsed running non-stop on two cores

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups-browsed/+bug/2049315/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2049315] Re: cups-browsed running non-stop on two cores

2024-05-09 Thread Heinrich Schuchardt
>> The instructions are for applying when cups-browsed is running and
stuck, not after killing it.

I did not kill any process before attaching gdb.
And top shows 200 % cpu usage by cupsd.

This is what still needs to be solved.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2049315

Title:
  cups-browsed running non-stop on two cores

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups-browsed/+bug/2049315/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2049315] Re: cups-browsed running non-stop on two cores

2024-05-09 Thread Till Kamppeter
These processes
-
$ ps aux | grep cups-browsed | grep -v grep
root 2912 0.0 0.0 2892 1708 ? Ss 10:13 0:00 /bin/sh 
/snap/cups/1047/scripts/run-cups-browsed
root 3407 0.0 0.0 2892 892 ? S 10:13 0:00 /bin/sh 
/snap/cups/1047/scripts/run-cups-browsed
-
come from the CUPS Snap. They are from a wrapper script to start cups-browsed, 
but in your case the CUPS Snap does not start cups-browsed, as you have a 
classically installed CUPS and the CUPS Snap is only running as proxy for 
snapped applications. There is no ¨../cups-browsed" process, so cups-browsed is 
currently not running for you.

You have attached gdb to cupsd.

The instructions I have posted are for applying when cups-browsed is
running and stuck, not after killing it. They only make sense if there
are actually 1 or 2 cups-browsed processes hanging in a 100%-CPU busy
loop.

For your patch on CUPS, which Michael has actually accepted, I am not
absolutely sure whether it will solve the problem. If you do not add the
"return(NULL);" line, the flow will go into the "return(NULL);" right
after the "if () {} else if {}" and so we have no different effect. Or
is this not the case?

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2049315

Title:
  cups-browsed running non-stop on two cores

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups-browsed/+bug/2049315/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2049315] Re: cups-browsed running non-stop on two cores

2024-05-09 Thread Heinrich Schuchardt
@Till

There are two processes running:

$ ps aux | grep cups-browsed | grep -v grep
root2912  0.0  0.0   2892  1708 ?Ss   10:13   0:00 /bin/sh 
/snap/cups/1047/scripts/run-cups-browsed
root3407  0.0  0.0   2892   892 ?S10:13   0:00 /bin/sh 
/snap/cups/1047/scripts/run-cups-browsed

None of these relates to what top shows as culprit:

2898 root  20   0  195916  16320  11736 R 197.0   0.1 139:30.91
cupsd

$ ps -aux | grep 2898
root2898  134  0.1 195916 16320 ?Rsl  10:13 141:15 
/usr/sbin/cupsd -l

$ sudo gbd -p 2898
(gdb) t a a bt

(gdb) t a a bt

Thread 2 (Thread 0x729b3cc006c0 (LWP 5305) "cupsd"):
#0  0x729b3f6a3439 in __pthread_rwlock_wrlock_full64 (abstime=0x0, 
clockid=0, rwlock=0x64af2f2b0270) at ./nptl/pthread_rwlock_common.c:821
#1  ___pthread_rwlock_wrlock (rwlock=0x64af2f2b0270) at 
./nptl/pthread_rwlock_wrlock.c:26
#2  0x64af2d5231a1 in create_local_bg_thread (con=0x64af2f3a1d70) at 
/build/cups-0ETlfZ/cups-2.4.7/scheduler/ipp.c:5333
#3  0x729b3f69ca94 in start_thread (arg=) at 
./nptl/pthread_create.c:447
#4  0x729b3f729c3c in clone3 () at 
../sysdeps/unix/sysv/linux/x86_64/clone3.S:78

Thread 1 (Thread 0x729b3e5b1b40 (LWP 2898) "cupsd"):
#0  0x729b3f71c5ad in __GI___libc_write (nbytes=63, buf=0x64af2f1b07c8, 
fd=6) at ../sysdeps/unix/sysv/linux/write.c:26
#1  __GI___libc_write (fd=6, buf=0x64af2f1b07c8, nbytes=63) at 
../sysdeps/unix/sysv/linux/write.c:24
#2  0x729b3f95cf66 in ??? () at /lib/x86_64-linux-gnu/libcups.so.2
#3  0x729b3f95d3ea in cupsFileFlush () at /lib/x86_64-linux-gnu/libcups.so.2
#4  0x64af2d5399f5 in cupsdWriteErrorLog (message=0x64af2f1ae7b0 "[Client 
26] Closing connection.", level=8) at 
/build/cups-0ETlfZ/cups-2.4.7/scheduler/log.c:1276
#5  cupsdWriteErrorLog (level=level@entry=8, message=0x64af2f1ae7b0 "[Client 
26] Closing connection.") at /build/cups-0ETlfZ/cups-2.4.7/scheduler/log.c:1220
#6  0x64af2d539b72 in cupsdLogClient (con=, level=8, 
message=) at /build/cups-0ETlfZ/cups-2.4.7/scheduler/log.c:540
#7  0x64af2d50d741 in cupsdCloseClient (con=con@entry=0x64af2f3a1d70) at 
/build/cups-0ETlfZ/cups-2.4.7/scheduler/client.c:405
#8  0x64af2d50f071 in cupsdReadClient (con=0x64af2f3a1d70) at 
/build/cups-0ETlfZ/cups-2.4.7/scheduler/client.c:618
#9  0x64af2d508469 in cupsdDoSelect (timeout=) at 
/build/cups-0ETlfZ/cups-2.4.7/scheduler/select.c:477
#10 main (argc=, argv=) at 
/build/cups-0ETlfZ/cups-2.4.7/scheduler/main.c:855

Thread 1 (process 2912 "run-cups-browse"):
#0  0x75225bf4e7dc in sigsuspend () from 
target:/lib/x86_64-linux-gnu/libc.so.6
#1  0x5d1641298ee8 in ?? ()
#2  0x5d164129911a in ?? ()
#3  0x5d164129e58a in ?? ()
#4  0x5d16412a3826 in ?? ()
#5  0x5d16412a650f in ?? ()
#6  0x5d164129fc00 in ?? ()
#7  0x5d16412a4b28 in ?? ()
#8  0x5d1641297d53 in ?? ()
#9  0x75225bf35d90 in ?? () from target:/lib/x86_64-linux-gnu/libc.so.6
#10 0x75225bf35e40 in __libc_start_main () from 
target:/lib/x86_64-linux-gnu/libc.so.6
#11 0x5d1641297f15 in ?? ()

Thread 1 (process 3407 "run-cups-browse"):
#0  0x75225bff63ea in wait4 () from target:/lib/x86_64-linux-gnu/libc.so.6
#1  0x5d1641298ea4 in ?? ()
#2  0x5d164129911a in ?? ()
#3  0x5d16412a63c0 in ?? ()
#4  0x5d164129fc00 in ?? ()
#5  0x5d16412a0070 in ?? ()
#6  0x5d164129fc00 in ?? ()
#7  0x5d16412a48ad in ?? ()
#8  0x5d164129fc00 in ?? ()
#9  0x5d16412a48ad in ?? ()
#10 0x5d164129fc00 in ?? ()
#11 0x5d164129fc3a in ?? ()
#12 0x5d164129fc00 in ?? ()
#13 0x5d16412a4b28 in ?? ()
#14 0x5d1641297d53 in ?? ()
#15 0x75225bf35d90 in ?? () from target:/lib/x86_64-linux-gnu/libc.so.6
#16 0x75225bf35e40 in __libc_start_main () from 
target:/lib/x86_64-linux-gnu/libc.so.6
#17 0x5d1641297f15 in ?? ()

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2049315

Title:
  cups-browsed running non-stop on two cores

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups-browsed/+bug/2049315/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2049315] Re: cups-browsed running non-stop on two cores

2024-05-08 Thread Heinrich Schuchardt
>> Do you know how to quickly trigger the bug?
Till, unfortunately I would not know how to trigger it on purpose.

Concerning SRU of any fix, I think it would be enough to verify that
printing still works.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2049315

Title:
  cups-browsed running non-stop on two cores

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups-browsed/+bug/2049315/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2049315] Re: cups-browsed running non-stop on two cores

2024-05-08 Thread Till Kamppeter
CUPS 2.4.8 got released and the fix
https://github.com/OpenPrinting/cups/issues/879 is included.

Heinrich, thanks again for the investigations and bug report.

Heinrich, best would be to do an SRU of CUPS, applying the patch to
Ubuntu's 2.4.7 would be easy, but how does one verify this fix? Do you
know how to quickly trigger the bug? I had it only once in more than a
year.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2049315

Title:
  cups-browsed running non-stop on two cores

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups-browsed/+bug/2049315/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2049315] Re: cups-browsed running non-stop on two cores

2024-05-08 Thread Till Kamppeter
Thanks everyone for posting logs here.

I would like to have another thing from everyone who runs into the
problem.

1. When you observe the problem, DO NOT kill cups-browsed.

2. Save the debug log and attach it to this bug report.

3. Determine the process ID (PID) of cup-browsed:

ps aux  | grep cups-browsed | grep -v grep
cups-browsed  846190  0.0  0.0 112932  5760 ?Ssl  00:00   0:00 
/usr/sbin/cups-browsed

The first number (second word) in the line is the PID

4. Install the debug symbols package of cups-browsed. Its name is "cups-
browsed-dbgsym". Follow the instructions on

https://ubuntu.com/server/docs/debug-symbol-packages

5. Install the debugger gdb if needed:

sudo apt install gdb

6. Attach the debugger gdb to cup-browsed:

sudo gdb attach PID

or

sudo -u cups-browsed attach PID

Replace PID by the PID you determined in (3)

On the prompt of the debugger enter the command

t a a bt

You get some output. If it ends with

--Type  for more, q to quit, c to continue without paging--

press Enter, until you get back to the prompt:

(gdb)

DO NOT press Enter when you are at the prompt.

Now copy the complete output of gdb into an editor, save the file and
attach it to this bug report.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2049315

Title:
  cups-browsed running non-stop on two cores

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups-browsed/+bug/2049315/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2049315] Re: cups-browsed running non-stop on two cores

2024-05-07 Thread Bryan Beus
The problem occurred again. 
I did have the debug mode active for cups-browsed, and here is the resulting 
log file.

** Attachment added: "cups-browsed_log"
   
https://bugs.launchpad.net/ubuntu/+source/cups-browsed/+bug/2049315/+attachment/5776180/+files/cups-browsed_log

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2049315

Title:
  cups-browsed running non-stop on two cores

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups-browsed/+bug/2049315/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs