From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 42240 invoked by alias); 10 Jun 2019 17:09:45 -0000 Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org Received: (qmail 42214 invoked by uid 48); 10 Jun 2019 17:09:41 -0000 From: "me at serhei dot io" To: systemtap@sourceware.org Subject: [Bug bpf/24659] New: kernel 5.2 bpf -- user and kernel-space map reads not synchronized? Date: Mon, 10 Jun 2019 17:09:00 -0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: systemtap X-Bugzilla-Component: bpf X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: me at serhei dot io X-Bugzilla-Status: NEW 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-SW-Source: 2019-q2/txt/msg00084.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=3D24659 Bug ID: 24659 Summary: kernel 5.2 bpf -- user and kernel-space map reads not synchronized? Product: systemtap Version: unspecified Status: NEW Severity: normal Priority: P2 Component: bpf Assignee: systemtap at sourceware dot org Reporter: me at serhei dot io Target Milestone: --- It appears that the recent kernels (seen on 5.2 rawhide) introduce some tim= ing issue between kernel- and user-space map operations. global value//=3D2 global status//=3D2 probe begin { println("BEGIN") value =3D 2 status =3D 2 } probe kernel.function("vfs_read") { status =3D 0 if (value =3D=3D 2) next status =3D 1 } probe kernel.function("vfs_read") { printf("vfs_read\n") printf("value %d\n", value) printf("status %d\n", status) if (status !=3D 2) exit() } probe end { printf("end\n") printf("value %d\n", value) printf("status %d\n", status) if (status) println("END FAIL") else println("END PASS") } In this example, probe end runs too soon after the map update in vfs_read a= nd receives an updated value. Changing the second probe vfs_read to probe timer.s(2) would make the testcase pass. --=20 You are receiving this mail because: You are the assignee for the bug.