From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0263E3840C33; Sun, 21 Jun 2020 06:51:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0263E3840C33 From: "agentzh at gmail dot com" To: systemtap@sourceware.org Subject: [Bug runtime/26144] New: task finder: vma maps callback may run after other task finder callbacks Date: Sun, 21 Jun 2020 06:51:49 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: systemtap X-Bugzilla-Component: runtime X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: agentzh at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: systemtap at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: systemtap@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Systemtap mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jun 2020 06:51:50 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D26144 Bug ID: 26144 Summary: task finder: vma maps callback may run after other task finder callbacks Product: systemtap Version: unspecified Status: UNCONFIRMED Severity: normal Priority: P2 Component: runtime Assignee: systemtap at sourceware dot org Reporter: agentzh at gmail dot com Target Milestone: --- I've noted on fedora's kernel-debug package's kernels, it's easy to reprodu= ce the case where __stp_utrace_task_finder_target_quiesce() fails to run the callbacks because the current context does not allow sleeping. Then the callbacks would be postponed using stp_task_work_add() which in turn calls task_work_add(). The task_work_add() always adds the callbacks in the rever= sed order, which leads to the incorrect result of running vma maps callback aft= er other callbacks (like process.begin's). Below is the logs demonstrating this bad case: https://gist.github.com/agentzh/c2e99a87c6aae652bb2eb6d39c20c077 It seems the correct fix would be combining all the callbacks, including the vma maps and other task finder callbacks, into a single utrace attach callb= ack. If we always handle all callbacks for each target task as a single entity, = it would be possible to ensure the execution order of these callbacks, even in= the case of non-sleeping contexts and task_work_add(). Any better ideas would be highly appreciated. Thanks! --=20 You are receiving this mail because: You are the assignee for the bug.=