Skip to content

Conversation

TysonAndre
Copy link
Member

@TysonAndre TysonAndre commented Oct 7, 2020

... That are freed

For example, this can be seen when __serialize returns an array that
contains a temporary array.
Before, because the result of __serialize was immediately freed,
another array could be created with the exact same memory address,
and igbinary would incorrectly assume they're duplicates.

Incorrect deduplication can be avoided by keeping references to all
serialized arrays/objects around in memory.
TODO: Add additional checks/tests for references. (done)

This may affect the performance of serialization.

Fixes #287
Based on #288

@TysonAndre TysonAndre force-pushed the serialize-temporary-array-fix branch from f6b0104 to 28de346 Compare October 7, 2020 03:40
nicolas-grekas added a commit to symfony/symfony that referenced this pull request Oct 7, 2020
This PR was merged into the 4.4 branch.

Discussion
----------

[Cache] skip igbinary < 3.1.6

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #38440
| License       | MIT
| Doc PR        | -

v3.1.6 will embed igbinary/igbinary#289

Commits
-------

065474c [Cache] skip igbinary < 3.1.6
symfony-splitter pushed a commit to symfony/cache that referenced this pull request Oct 7, 2020
This PR was merged into the 4.4 branch.

Discussion
----------

[Cache] skip igbinary < 3.1.6

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #38440
| License       | MIT
| Doc PR        | -

v3.1.6 will embed igbinary/igbinary#289

Commits
-------

065474c94f [Cache] skip igbinary < 3.1.6
@TysonAndre TysonAndre force-pushed the serialize-temporary-array-fix branch 2 times, most recently from 19e36d0 to ced56e3 Compare October 7, 2020 13:05
…ects

... That are freed

For example, this can be seen when `__serialize` returns an array that
contains a temporary array.
Before, because the result of `__serialize` was immediately freed,
another array could be created with the exact same memory address,
and igbinary would incorrectly assume they're duplicates.

Incorrect deduplication can be avoided by keeping references to all
serialized arrays/objects/references around in memory.

This may affect the performance of serialization.

Fixes igbinary#287
Based on igbinary#288
@TysonAndre TysonAndre force-pushed the serialize-temporary-array-fix branch from ced56e3 to a81109f Compare October 7, 2020 13:55
@TysonAndre TysonAndre merged commit 0acbc90 into igbinary:master Oct 7, 2020
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.

Data corruption when serializing object containing objects and with var_dump()/print_r()
1 participant