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

Methods from module zip read only 65535 records from zip file #8675

Closed
sigsergv opened this issue Jul 18, 2024 · 6 comments · Fixed by #8537
Closed

Methods from module zip read only 65535 records from zip file #8675

sigsergv opened this issue Jul 18, 2024 · 6 comments · Fixed by #8537
Assignees
Labels
feature team:VM Assigned to OTP team VM
Milestone

Comments

@sigsergv
Copy link
Contributor

sigsergv commented Jul 18, 2024

Describe the bug

Methods like zip:foldl or zip:unzip process limited number of records from zip archive. No errors just incomplete list.

To Reproduce

Try to unpack or list_dir of provided file test.zip (it consists of 80000 empty files).

root@debian-experimental-amd64:~# erl
Erlang/OTP 27 [erts-15.0.1] [source] [64-bit] [smp:32:12] [ds:32:12:10] [async-threads:1] [jit:ns]

Eshell V15.0.1 (press Ctrl+G to abort, type help(). for help)
1> zip:foldl(fun(F, G, B, Acc) -> Acc + 1 end, 0, "test.zip").
{ok,65535}
2> 

The same for zip:unzip, in unpacks not all files.

System unzip command reads and unpacks everything:

root@debian-experimental-amd64:~# unzip -t test.zip |wc -l
80004

Expected behavior

Methods from module zip should process all files from provided archive.

Affected versions

27

Additional context

Test file: test.zip
Checked on otp-25, otp-27 from debian

@sigsergv sigsergv added the bug Issue is reported as a bug label Jul 18, 2024
@jhogberg jhogberg added the team:VM Assigned to OTP team VM label Jul 18, 2024
@jhogberg
Copy link
Contributor

Hi! This should be resolved by #8537, can you try it out?

@sigsergv
Copy link
Contributor Author

Hi! Nope, still reproducible:

[sigsergv@webstation:~/projects/erlang/erlang-otp]% ./bootstrap/bin/erl                        
Erlang/OTP 27 [erts-15.0] [source-7d87e7b09c] [64-bit] [smp:32:12] [ds:32:12:10] [async-threads:1] [jit:ns]

Eshell V15.0 (press Ctrl+G to abort, type help(). for help)
1> zip:foldl(fun(F, G, B, Acc) -> Acc + 1 end, 0, "/home/sigsergv/tmp/test-erl-zip/test.zip").
{ok,65535}
2> 

@jhogberg jhogberg added the stalled waiting for input by the Erlang/OTP team label Jul 18, 2024
@jhogberg
Copy link
Contributor

Thanks! I don't have the time to dig into this further as most of us are on vacation right now, but we'll revisit this once we're back. :-)

@garazdawi
Copy link
Contributor

The functionality works with #8537 if you don't use the bootstrap emulator.

> ./bin/erl
Erlang/OTP 27 [erts-15.0] [source-1c0f6cb2d2] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]

Eshell V15.0 (press Ctrl+G to abort, type help(). for help)
1> zip:foldl(fun(F, G, B, Acc) -> Acc + 1 end, 0, "test.zip").
{ok,80002}

@garazdawi garazdawi added feature and removed stalled waiting for input by the Erlang/OTP team bug Issue is reported as a bug labels Aug 12, 2024
@sigsergv
Copy link
Contributor Author

sigsergv commented Aug 20, 2024

Checked on latest pull request contents of #8537 and it's working correctly indeed:

[sigsergv@webstation:~/projects/erlang/erlang-otp]% ./bin/erl
Erlang/OTP 27 [erts-15.0] [source-4ca37b747a] [64-bit] [smp:32:12] [ds:32:12:10] [async-threads:1] [jit:ns]

Eshell V15.0 (press Ctrl+G to abort, type help(). for help)
1> zip:foldl(fun(F, G, B, Acc) -> Acc + 1 end, 0, "/home/sigsergv/tmp/test.zip").
{ok,80002}
2> 

@garazdawi
Copy link
Contributor

Fix merged to maint for release in 27.1.

@garazdawi garazdawi added this to the OTP-27.1 milestone Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature team:VM Assigned to OTP team VM
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants