** Description changed:

+ [ Impact ]
+ 
  test_add_proc_info fails with the parent cmdline content:
  
  ```
-        self.assertEqual(pr["ProcCmdline"], f"{catcmd} /foo\\ bar \\\\h \\\\\\ 
\\\\ -")
+        self.assertEqual(pr["ProcCmdline"], f"{catcmd} /foo\\ bar \\\\h \\\\\\ 
\\\\ -")
  E       AssertionError: 'python3 -m pytest -ra -v -m not\\ require[37 
chars]ion/' != '/usr/bin/gnucat /foo\\ bar \\\\h \\\\\\ \\\\ -'
  E       - python3 -m pytest -ra -v -m not\ requires_internet tests/unit/ 
tests/integration/
  E       + /usr/bin/gnucat /foo\ bar \\h \\\ \\ -
  ```
  
  1. When `subprocess.Popen` spawns a process, it first calls `fork()`
  before calling `execve()`.
  
  2. Immediately after `fork()`, the child process shares the parent's
  memory image.
  
  3. During this brief window (before `execve()` completes),
  `/proc/{pid}/cmdline` contains the parent's command line.
  
  4. The `wait_for_proc_cmdline` method checks if `/proc/{pid}/cmdline`
  has content. Because the parent's cmdline is non-empty, it return
  prematurely before `execve()` finishes replacing the process.
  
  5. Apport then reads `/proc/{pid}/cmdline` while it still holds pytest's
  command line.
  
  Example failure on s390x:
  https://autopkgtest.ubuntu.com/results/autopkgtest-
  stonking/stonking/s390x/a/apport/20260725_070814_3faa8@/log.gz
+ 
+ [ Test Plan ]
+ 
+ Check that the autopkgtest is run successfully on all architectures
+ (except for riscv64 which hasn't been successful in the past, see bug
+ #2159030).
+ 
+ [ Where problems could occur ]
+ 
+ The change only touches the test code. The test cases are only part of
+ the apport source package and are not copied in any binary packages.
+ Changes to the test will only affect the package build and test
+ execution.
+ 
+ [ Other Info ]
+ 
+ This SRU addresses a big number of bugs, because it addresses the
+ several bugs that causes the autopkgtest to fail or fail under certain
+ conditions. I also bundled the fixes around reporting/retracing the bugs
+ reports that we found after modernizing the retracing infrastructure.

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

Title:
  test_add_proc_info fails with parent cmdline content

To manage notifications about this bug go to:
https://bugs.launchpad.net/apport/+bug/2161888/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to