From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A9D2D386D61F; Thu, 15 Feb 2024 19:45:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A9D2D386D61F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1708026347; bh=IPYuKSQks6xN1RGiNTr1Y5w3Bf5HVFH5Lle9aE9c8z8=; h=From:To:Subject:Date:From; b=VGkkP6wmP5NJnlMMPrlYxM1p7Gl5Xxa+qXPHcUkAQGoCIsEQLxjh9of5oLTjW8Np3 w0L4gcFZWh7j2fwnF22heWphXK7KgUjgfK1TkFHP/qKIOFks6ltd0aS1PGq2wGIL2k 1Xa5nnLcpMIkASmCasitRAj/qxamSsOo+l/9935Q= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug dap/31386] New: [gdb/dap] Race between dap startup and dap log file initialization Date: Thu, 15 Feb 2024 19:45:46 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: dap X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned 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 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31386 Bug ID: 31386 Summary: [gdb/dap] Race between dap startup and dap log file initialization Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: dap Assignee: unassigned at sourceware dot org Reporter: vries at gcc dot gnu.org Target Milestone: --- In dap-support.exp, dap_gdb_start we do: ... append GDBFLAGS " -iex \"set debug dap-log-file $logfile\" -q -i=3D= dap" ... While the dap log file setting comes before the dap interpreter setting, th= at's not the order in which things happen. Consequently, there's a race between dap interpreter startup and dap log fi= le initialization. The logging procs are setup to just do nothing if the log file is not yet initialized. I found this by adding this to gdb.dap/eof.exp (dap_check_log_file_re not y= et in trunk): ... diff --git a/gdb/testsuite/gdb.dap/eof.exp b/gdb/testsuite/gdb.dap/eof.exp index 9c17725c0d0..a64ac227880 100644 --- a/gdb/testsuite/gdb.dap/eof.exp +++ b/gdb/testsuite/gdb.dap/eof.exp @@ -35,3 +35,8 @@ catch "wait -i $gdb_spawn_id" unset gdb_spawn_id dap_check_log_file +dap_check_log_file_re "JSON writer: terminating" +dap_check_log_file_re "JSON reader: terminating" +dap_check_log_file_re "DAP: terminating" +dap_check_log_file_re "WROTE:" +dap_check_log_file_re "READ:" ... and the last check fails regularly, because the initial request: ... READ: <<<{"seq": 1, "type": "request", "command": "initialize", "arguments": {"clientID": "gdb testsuite", "supportsVariableType": true, "supportsVariablePaging": true, "supportsMemoryReferences": true}}>>> ... is often not logged. I also tried using -eiex but that happens before interpreter setup, which m= eans the "set debug dap-log-file" command hasn't been setup yet, so there's no l= og file at all. I wondered whether to classify with component testsuite, but I think it sho= uld be dap because it's a bug if we can't log a complete dap session. --=20 You are receiving this mail because: You are on the CC list for the bug.=