From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1B8D43858D38; Sat, 13 Apr 2024 09:48:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1B8D43858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1713001707; bh=IH2OsgYZfMBwnTNVoa8goneLozoLo2RRltLwdhUM34g=; h=From:To:Subject:Date:In-Reply-To:References:From; b=d62SH7G3PJ78+nndAVubxXgMlCVmJyQvJHkUA5xB9uO7RRdcv4vPQHhZCzvJnHEMn CkCBK6IdBkng6nkK6lBYqBvKrS55zbQBWhTdWNTk0zbNTzMBZqvugXTkP/ZydJL8Ks y3kik9nG6iQ7oB3s1OeVDYcsrUZuElRqwSwDof3U= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug testsuite/31632] [gdb/testsuite] Connecting to wrong gdbserver during parallel testing Date: Sat, 13 Apr 2024 09:48:26 +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: 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: 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=3D31632 --- Comment #1 from Tom de Vries --- I'm not sure exactly how this failure is caused, but I think making sure test-cases run in parallel get unique portnums is a way to fix this. The current approach is that we have: ... global portnum set portnum "2345" ... and in gdbserver_start we do: ... # Bump the port number to avoid conflicts with hung ports.=20=20=20= =20=20=20=20=20=20=20=20=20=20=20 incr portnum ... which works ok for serial testing. There there's this bit: ... -re "Can't (bind address|listen on socket): Address already in use\\.\r\n" { verbose -log "Port $portnum is already in use." if ![target_info exists gdb,socketport] { # Bump the port number to avoid the conflict.=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20 wait -i $expect_out(spawn_id) incr portnum continue } } ... which should avoid clashes with other uses. We can't avoid clashes completely, given that things may happen outside of = the scope of gdb testing, but we should avoid running into clashes due to paral= lel gdb testing. So, we're gonna need a unique dir that needs to be created/emptied when mak= ing make-target check//%, and passed down using a variable say, GDB_LOCK_DIR. Each make invocation can then check GDB_LOCK_DIR, if it doesn't exist (beca= use of not using make check//), create it's own and use it, and if it does, use that one. [ I then wonder what happens when using check// and plain check next to each other. But perhaps this is already unsupported/broken today. ] Then we can track portnum in $GDB_LOCK_DIR/portnum and use $GDB_LOCK_DIR/portnum.lock to serialize parallel access. --=20 You are receiving this mail because: You are on the CC list for the bug.=