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

_decompress consumes all memory #2

Open
NMigo opened this issue Feb 3, 2012 · 7 comments
Open

_decompress consumes all memory #2

NMigo opened this issue Feb 3, 2012 · 7 comments

Comments

@NMigo
Copy link

NMigo commented Feb 3, 2012

Hi, performing a fastlz_decompresss on a non valid compressed string, the function consumes al memory:

php -a
Interactive shell
php > fastlz_decompress('£RES');

Fatal error: Allowed memory size of 1291845632 bytes exhausted (tried to allocate 3265483334 bytes) in php shell code on line 1

Call Stack:
13.5809 633472 1. {main}() php shell code:0
13.5810 633688 2. fastlz_decompress() php shell code:1

This is tested under Debian Linux 64bits, PHP CLI and the latest version from the repo. Please let us know if you need to re-test. Thanks,

@t3rmin4t0r
Copy link
Owner

I stored the size of the buffer as the first few bytes of the string.

I probably need to write a retry based reallocation to decompress data, similar to what the gzip case does.

Probably will fix it in a while.

@t3rmin4t0r
Copy link
Owner

Fixing this would break some of the existing compressed files.

I'm guessing that is fine? :)

@NMigo
Copy link
Author

NMigo commented Feb 3, 2012

Well, for us is fine as we haven't put the code into production. ; )
But if anyone has compressed strings already in a DB, then it will be a problem...

@t3rmin4t0r
Copy link
Owner

Yeah, would somebody be crazy enough to use code I wrote on an afternoon out of boredom?

I'll add an "fastlz.format=old" ini option or something.

@NMigo
Copy link
Author

NMigo commented Feb 3, 2012

Well your code has been featured in some talks...

On Fri, Feb 3, 2012 at 5:24 PM, Gopal V <
[email protected]

wrote:

Yeah, would somebody be crazy enough to use code I wrote on an afternoon
out of boredom?

I'll add an "fastlz.format=old" ini option or something.


Reply to this email directly or view it on GitHub:
#2 (comment)

@NMigo
Copy link
Author

NMigo commented Feb 3, 2012

maybe this is fixed here at iliaal's repo? iliaal@f4ec15c

@NMigo
Copy link
Author

NMigo commented Feb 9, 2012

just verified, it is solved indeed at iliaal's repo. However the README file still points to this repo.

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