From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6FF3E384406A; Thu, 18 May 2023 17:22:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6FF3E384406A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1684430578; bh=cH65+X8KgUeTuU+mH3GNOug+WkqDqxlMwaGBixFr/Hw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=MVmpLJF7B9EU+OSCRhtZfxPDd/9irMO+lRqcCxvJteglWQbeKLYLD9jbBecBEIQz9 KdEaEmDWSLV2c+HWYueZUKyEJ7u8WOqCZaUKHV3zCS2k7TEVJqeqDJjP+VwzIMjTF5 9R3SKQiLZjvmjs0tdC8IUkjSubEEHfe+Mav39qMk= From: "cvs-commit at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug testsuite/30414] Random failure in gdb.fortran/lbound-ubound.exp Date: Thu, 18 May 2023 17:22:57 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: testsuite X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit 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: Message-ID: In-Reply-To: References: 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=3D30414 --- Comment #7 from cvs-commit at gcc dot gnu.org --- The master branch has been updated by Simon Marchi : https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D2bf4cc2b92a4= 5f9d857907aec3d14b5ffd9ebd2e commit 2bf4cc2b92a45f9d857907aec3d14b5ffd9ebd2e Author: Simon Marchi Date: Thu May 4 11:28:48 2023 -0400 gdb.fortran/lbound-ubound.exp: read expected lbound and ubound from function parameters (PR 30414) gdb.fortran/lbound-ubound.exp reads the expected lbound and ubound values by reading some output from the inferior. This is racy when running on boards where the inferior I/O is on a separate TTY than GDB's, such as native-gdbserver. I sometimes see this behavior: (gdb) continue Continuing. Breakpoint 2, do_test (lb=3D..., ub=3D...) at /home/jenkins/workspace/binutils-gdb_master_linuxbuild/platform/jammy-amd64= /target_board/nati =20=20=20=20=20=20=20 ve-gdbserver/src/binutils-gdb/gdb/testsuite/gdb.fortran/lbound-ubound.F90:45 45 print *, "" ! Test Breakpoint (gdb) Remote debugging from host ::1, port 37496 Expected GDB Output: LBOUND =3D (-8, -10) UBOUND =3D (-1, -2) APB: Run a test here APB: Expected lbound '(-8, -10)' APB: Expected ubound '' What happened is that expect read the output from GDB before the output from the inferior, triggering this gdb_test_multiple clause: -re "$gdb_prompt $" { set found_prompt true if {$found_dealloc_breakpoint || ($expected_lbound !=3D "" && $expected_ubound !=3D "")} { # We're done. } else { exp_continue } } So it set found_prompt, but the gdb_test_multiple kept going because found_dealloc_breakpoint is false (this is the flag indicating that the test is finished) and we still don't have expected_lbound and expected_ubound. Then, expect reads in the inferior I/O, triggering this clause: -re ".*LBOUND =3D (\[^\r\n\]+)\r\n" { set expected_lbound $expect_out(1,string) if {!$found_prompt} { exp_continue } } This sets expected_lbound, but since found_prompt is true, we don't do exp_continue, and exit the gdb_test_multiple, without having an expected_ubound. Change the test to read the values from the lb and ub function parameters instead. As far as I understand, this still exercises what we want to test. These variables contain the return values of the lbound and ubound functions as computed by the program. We'll use them to check the return values of the lbound and ubound functions as computed by GDB. Change-Id: I3c4d3d17d9291870a758a42301d15a007821ebb5 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30414 --=20 You are receiving this mail because: You are on the CC list for the bug.=