D11236: [KCrash] Establish socket to allow change of ptracer

Oswald Buddenhagen noreply at phabricator.kde.org
Wed Jan 16 15:36:57 GMT 2019


ossi added a comment.


  In D11236#394363 <https://phabricator.kde.org/D11236#394363>, @croick wrote:
  
  > Actually the point I removed does not seem to be true any longer. I'm almost certain, that the `prctrl(PR_SET_PTRACER, ...)` was not required until some time ago when starting DrKonqi as a fork. But now the internal backtrace is not working without. I cannot tell, when that started (currently using kernel 4.20).
  
  
  that sounds suspicious. i don't think the kernel's behavior did changed, and the process hierarchy presumably didn't, either. the right is handed down the ancestry, and that's irrespective of whether the tracer is a "natural" ancestor or the tracee, or was set via prctl(). maybe your sysctl settings simply changed?

INLINE COMMENTS

> kcrash.cpp:657
>          // Wait forever until the started process exits. This code path is executed
> -        // when launching drkonqi. Note that drkonqi will stop this process in the meantime.
> -        if (directly) {
> -            //if the process was started directly, use waitpid(), as it's a child...
> -            while (waitpid(-1, nullptr, 0) != pid) {}
> -        } else {
> +        // when launching drkonqi. Note that DrKonqi will SIGSTOP this process in the meantime
> +        // and a backtrace will end here.

ok, so now it's claimed to apply to the entire block. but how can that be? thepollDrKonqiSocket() couldn't possibly be called then ...

> kcrash.cpp:907
> +        r = poll(&fd, 1, 1000); // wait for 1 second for a request by DrKonqi
> +    } while (r == -1 && (errno == EINTR || errno == EAGAIN));
> +    // only continue if POLLIN event returned

remove eagain here as well.

REPOSITORY
  R285 KCrash

REVISION DETAIL
  https://phabricator.kde.org/D11236

To: croick, #frameworks, ossi
Cc: dfaure, lepagevalleeemmanuel, kde-frameworks-devel, sitter, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190116/439efdc1/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list