[bug #68441] Entering "x ..." causes Octave to become unresponsive

"Dmitri A. Sergatskov" <[email protected]> Thu, 11 Jun 2026 15:14:58 -0400 (EDT)
Newsgroups gmane.comp.gnu.octave.bugs
Message-ID <[email protected]>
Please use the bug tracker to post updates to a bug report.  The mailing list is intended as a read-only notification stream.  Info posted to this mailing list address won't appear in the tracker database where it is most useful.

Follow-up Comment #2, bug #68441 (group octave):

THe following diff fixes the probleem for me:

--- a/libinterp/parse-tree/lex.ll       Wed Jun 10 20:03:57 2026 +0200
+++ b/libinterp/parse-tree/lex.ll       Thu Jun 11 15:11:46 2026 -0400
@@ -1881,8 +1881,18 @@
 
     // Check for possible command syntax before doing any other operations
     // that may modify the input buffer.
-
-    if (curr_lexer->previous_token_may_be_command ()
+    //
+    // If we are using the push parser/lexer interface, the current
+    // character may be the special ASCII 1 marker that
+    // push_lexer::fill_flex_buffer inserts when it reaches the end of
+    // the input buffer.  That marker means we need more input, so it
+    // must not begin a command argument.  If it did, the COMMAND_START
+    // rules would consume the marker (and any subsequent markers)
+    // without ever requesting more input, sending the lexer into an
+    // infinite loop.
+
+    if (! (curr_lexer->is_push_lexer () && yytext[0] == '\001')
+        && curr_lexer->previous_token_may_be_command ()
         && curr_lexer->space_follows_previous_token ())
       {
         yyless (0);


Attached as CSET (file bug68441_lexer_hangs_20260611_100.cset)

Dmitri.
-- 


(file #58707)

    _______________________________________________________

Additional Item Attachment:

Name: bug68441_lexer_hangs_20260611_100.cset Size: 2.8KiB

<https://file.savannah.gnu.org/file/bug68441_lexer_hangs_20260611_100.cset?file_id=58707>


    AGPL NOTICE

These attachments are served by Savane. You can download the corresponding
source code of Savane at
https://git.savannah.nongnu.org/cgit/administration/savane.git/snapshot/savane-c36938be85ff6c1b727bc7dd7fd30e48f9142870.tar.gz


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?68441>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----

iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCaisJMgAKCRCqLAuaBUf3
TnmmAP9VrdpEmh1Et5LEXdujpuKd8sl4uBTLjgAcClsrUdeSPAD9ESHo5AInljQq
b6d0mViReMR29XFXMR9sia4SDhfpjw4=
=flpc
-----END PGP SIGNATURE-----