Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Large multi-line regular expressions do not match #22

Open
pillravi opened this issue Mar 16, 2017 · 6 comments
Open

Large multi-line regular expressions do not match #22

pillravi opened this issue Mar 16, 2017 · 6 comments

Comments

@pillravi
Copy link

This seems to be a similar issue to #17, but on the expect side rather than the send side.

I am cat-ing a file multiple times to search for several different blocks of text. (I cannot use a file compare utility such as diff because the text blocks may appear in any order.)

Script 3 passes:

!cat test.txt
"""??
<48 bytes (5 lines)>
"""
!cat test.txt
"""??
<48 bytes (5 lines)>
"""
!cat test.txt
"""??
<4057 bytes (113 lines)>
"""
!cat test.txt
"""??
<4057 bytes (113 lines)>
"""

while script 4 fails:

!cat test.txt
"""??
<Block 1: 48 bytes (5 lines)>
"""
!cat test.txt
"""??
<Block 2: 48 bytes (5 lines)>
"""
!cat test.txt
"""??
<Block 3: 3875 bytes (108 lines)>
"""
!cat test.txt
"""??
<Block 4: 3875 bytes (108 lines)>
"""

with the following output:

result            : FAIL at 40:21:-1:22:121:1834
expected
	<Block 3: 3875 bytes (108 lines)>
actual match_timeout

	<Block 3: 3875 bytes (108 lines)>
	<Block 4: 3875 bytes (108 lines)>
	SH-PROMPT:cat test.txt
	cat test.txt
	<Block 1: 48 bytes (5 lines)>
	<Block 2: 48 bytes (5 lines)>
	<Block 3: 3875 bytes (108 lines)>
	<Block 4: 3875 bytes (108 lines)>
	SH-PROMPT:cat test.txt
	<Block 1: 48 bytes (5 lines)>
	<Block 2: 48 bytes (5 lines)>
	<Block 3: 3875 bytes (108 lines)>
	<Block 4: 3875 bytes (108 lines)>
	SH-PROMPT:

successful        : 0
failed            : 1
script_04.lux:40:21:-1:22:121:1834 - match_timeout
summary           : FAIL

There is no particular length that causes it to fail; from the examples we see that an expect of 4057 bytes succeeds but an expect of 3875 bytes fails. However this problem does only manifest on expects that are qualitatively "long."

I am using the latest Lux from the non-blocking-pty branch.

@hawk
Copy link
Owner

hawk commented Mar 16, 2017 via email

@pillravi
Copy link
Author

Yes, the issue is reproducible on the develop branch. I see the new diff feature added with 1.16, but other than that the output is the same. Lux's diff seems to think there is something different in code block 3, but when I diff the expected and the actual match_timeout myself, they are identical.

@hawk
Copy link
Owner

hawk commented Mar 17, 2017 via email

@pillravi
Copy link
Author

Here is an example test case:
failing lux test.zip

@hawk
Copy link
Owner

hawk commented Mar 24, 2017 via email

@hawk
Copy link
Owner

hawk commented Apr 4, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants