process_posix error on Mac OS

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

process_posix error on Mac OS

Postby mrdeliciousrax » Wed Jun 21, 2023 11:24 pm

Hello, I am using cef_binary_107.1.11+g26c0b5e+chromium-107.0.5304.110_macosarm64 on MacOS Ventura 13.0.1, and I am seeing the following error when closing both cefclient and cefsimple (browser mode) tests:

Code: Select all
[0620/072835.483647:ERROR:process_posix.cc(343)] Unable to terminate process 59512: No such process (3)


I added print statements to cefsimple to print the thread IDs, and made sure that CefRunMessageLoop(), CefQuitMessageLoop(), and CefShutdown() are being called from the same thread.

I found some version of process_posix.cc online, and noticed that the section of the code that produces this message, has a IS_CHROMEOS guard:

Code: Select all
bool Process::Terminate(int exit_code, bool wait) const {
  // exit_code isn't supportable.
  DCHECK(IsValid());
  CHECK_GT(process_, 0);
  // RESULT_CODE_KILLED_BAD_MESSAGE == 3, but layering prevents its use.
  // |wait| is always false when terminating badly-behaved processes.
  const bool maybe_compromised = !wait && exit_code == 3;
  if (maybe_compromised) {
    // Forcibly terminate the process immediately.
    const bool was_killed = kill(process_, SIGKILL) != 0;
#if BUILDFLAG(IS_CHROMEOS)
    if (was_killed)
      CleanUpProcessAsync();
#endif
    DPLOG_IF(ERROR, !was_killed) << "Unable to terminate process " << process_;
    return was_killed;
  }
  // Terminate process giving it a chance to clean up.
  if (kill(process_, SIGTERM) != 0) {
    DPLOG(ERROR) << "Unable to terminate process " << process_;
    return false;
  }
#if BUILDFLAG(IS_CHROMEOS)
  CleanUpProcessAsync();
#endif
  if (!wait || WaitForExitWithTimeout(Seconds(60), nullptr)) {
    return true;
  }
  if (kill(process_, SIGKILL) != 0) {
    DPLOG(ERROR) << "Unable to kill process " << process_;
    return false;
  }
  return WaitForExit(nullptr);
}


Any ideas on how to fix this error are welcome! We can't leave this error in production code, especially since our customers will be using CEF windowless, from the command line.
mrdeliciousrax
Newbie
 
Posts: 1
Joined: Wed Jun 21, 2023 10:58 pm

Re: process_posix error on Mac OS

Postby magreenblatt » Thu Jun 22, 2023 1:10 am

magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 203 guests