From nobody Thu Apr 2 01:54:03 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DB4B63128D4 for ; Mon, 23 Feb 2026 16:30:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771864257; cv=none; b=ZPdm8gOkoacUnntKaE1UvSmz3f/fMuB1ZzfjlWKH3wXWjDuPAJ0JEgTxwdllwSuKBeCmAsr97diEnE51YOE9tXXCG6lkpPuHhK/l4kw0UKShJ8j/yT/yeHhrrY+KPr6306fazbZiawIcZBUpgQRiG2+E+FBSM1P1R2SqRA8bChA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771864257; c=relaxed/simple; bh=4M22TMqr4Kp7d6uOCNhz/fRmCEbkYk7/hUz8OUuWkys=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZrFpikt77T0ywNoduqWHq1WFpDXC3ZGWz/BjczoZQ2v7JDy2+qFPBTbLc+ey1UGXsDCHIZvB1oamHb/yclbK/WLYJ/y9melHAHDnM718RmHnDprw1VF03nR6mpbyViLLybbHXEf0gQBEbCzb1xl1a9pj0AfSqeU24YkemgaT62k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=E2R6gC55; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="E2R6gC55" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1771864254; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AHpeVA2TW9g1nzpiKCBeIjVkqx/nyz9EMg/ZqH0sr8w=; b=E2R6gC55THXxF6SBHlFTsBsW2mSmMoIQU5IUnLv2BlmrVVsKEIEaXuEpn+zNGxZKkRlllC 5D/xoGG22Y2wMkCv8d3s37BiQxWtplHyePErcUQmLN83I/SVlzNoPXLO9FJRofqrdwn9Il /3H4Fbifn9PkPnGJ2Dj8nlpnQOmZX1Q= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-628-jioOAsEAM0GA8o3Fu3jJXg-1; Mon, 23 Feb 2026 11:30:51 -0500 X-MC-Unique: jioOAsEAM0GA8o3Fu3jJXg-1 X-Mimecast-MFC-AGG-ID: jioOAsEAM0GA8o3Fu3jJXg_1771864249 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 542B9195608F; Mon, 23 Feb 2026 16:30:49 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.22.88.94]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3BC791800370; Mon, 23 Feb 2026 16:30:46 +0000 (UTC) From: Wander Lairson Costa To: Steven Rostedt , Gabriele Monaco , Nam Cao , Wander Lairson Costa , linux-trace-kernel@vger.kernel.org (open list:RUNTIME VERIFICATION (RV)), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v3 17/19] rv/rvgen: enforce presence of initial state Date: Mon, 23 Feb 2026 13:18:00 -0300 Message-ID: <20260223162407.147003-18-wander@redhat.com> In-Reply-To: <20260223162407.147003-1-wander@redhat.com> References: <20260223162407.147003-1-wander@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Content-Type: text/plain; charset="utf-8" The __get_state_variables() method parses DOT files to identify the automaton's initial state. If the input file lacks a node with the required initialization prefix, the initial_state variable is referenced before assignment, causing an UnboundLocalError or a generic error during the state removal step. Initialize the variable explicitly and validate that a start node was found after parsing. Raise a descriptive AutomataError if the definition is missing to improve debugging and ensure the automaton is valid. Signed-off-by: Wander Lairson Costa Reviewed-by: Gabriele Monaco --- tools/verification/rvgen/rvgen/automata.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/verification/rvgen/rvgen/automata.py b/tools/verificatio= n/rvgen/rvgen/automata.py index fd2a4a0c3f6eb..ac765c9b2dece 100644 --- a/tools/verification/rvgen/rvgen/automata.py +++ b/tools/verification/rvgen/rvgen/automata.py @@ -145,6 +145,7 @@ class Automata: # wait for node declaration states =3D [] final_states =3D [] + initial_state =3D "" =20 has_final_states =3D False cursor =3D self.__get_cursor_begin_states() @@ -171,6 +172,9 @@ class Automata: final_states.append(state) has_final_states =3D True =20 + if not initial_state: + raise AutomataError("The automaton doesn't have an initial sta= te") + states =3D sorted(set(states)) states.remove(initial_state) =20 --=20 2.53.0