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

serialization of custom objects #2628

Closed
vicuna opened this issue Nov 29, 2000 · 2 comments
Closed

serialization of custom objects #2628

vicuna opened this issue Nov 29, 2000 · 2 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Nov 29, 2000

Original bug ID: 238
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Full_Name: Manuel Fahndrich
Version: 3.00
OS: Win2K
Submission from: tide72.microsoft.com (131.107.3.72)

I found two errors in the serialization code, one related to int64's in
particular, the other for all custom objects.

Bug 1:
byterun/ints.c:282
<
*wsize_64 = *wsize_64 = 8;

*wsize_32 = *wsize_64 = 8;

The error causes the serialization to miscompute the size of the block to
allocate when reading the data back in.

Bug 2:
byterun/intern.c:266

if (intern_obj_table != NULL) intern_obj_table[obj_counter++] = v;

Custom objects (e.g. int64) were not put into the shared lookup table, and the
object count was not correctly maintained. This causes problems when
deserializing shared custom objects.

Simplest example to exhibit bug: write a tuple (i,i), where i is an int64 to a
file with output_value. On input_value, the second component is a garbage
pointer.

@vicuna
Copy link
Author

vicuna commented Nov 30, 2000

Comment author: administrator

Dear Manuel,

I found two errors in the serialization code, one related to int64's in
particular, the other for all custom objects.

Well spotted. I've fixed both bugs as you suggested, and added the
corresponding test cases.

Thanks for the bug report.

All the best,

  • Xavier

@vicuna
Copy link
Author

vicuna commented Nov 30, 2000

Comment author: administrator

Fixed 2000-11-30 by Xavier

@vicuna vicuna closed this as completed Nov 30, 2000
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant