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

Issue with huge file uploads on 32-bit Perl #445

Merged
merged 1 commit into from Jan 16, 2013
Merged

Issue with huge file uploads on 32-bit Perl #445

merged 1 commit into from Jan 16, 2013

Conversation

augensalat
Copy link
Contributor

I have to depoy a Mojolicious application on a Perl 5.10.1 w/ 32 bit on an Open Solaris system.
That application offers a file upload.
By trying to upload a file > 2G (and smaller than 4G) with multipart/form-data, the application tries to load everything into RAM - without considerung $MOJO_MAX_MESSAGE_SIZE.
The reason seems to be an overflow of a signed 32-bit decimal in substr(). A simple test:

[host ~]# perl -wE 'my $s = "abc"; say length(substr $s, 0, 2_200_000_000)'
0

On a 64-bit system the result is '3' of course.

Also interesting is the double-overflow btw:

[host ~]# perl -wE 'my $s = "abc"; say length(substr $s, 0, 4_400_000_000)'
2

The additional tests in t/mojo/content.t are failing without the changes in lib/Mojo/Content.pm .

kraih added a commit that referenced this pull request Jan 16, 2013
Issue with huge file uploads on 32-bit Perl
@kraih kraih merged commit 2acdad7 into mojolicious:master Jan 16, 2013
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

Successfully merging this pull request may close these issues.

None yet

2 participants