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

Marshalling may possibly crash with finalisation functions #4030

Closed
vicuna opened this issue May 22, 2006 · 1 comment
Closed

Marshalling may possibly crash with finalisation functions #4030

vicuna opened this issue May 22, 2006 · 1 comment
Labels

Comments

@vicuna
Copy link

vicuna commented May 22, 2006

Original bug ID: 4030
Reporter: @mmottl
Status: closed (set by @xavierleroy on 2006-06-10T09:03:22Z)
Resolution: fixed
Priority: normal
Severity: major
Version: 3.09.2
Category: ~DO NOT USE (was: OCaml general)
Monitored by: @mmottl

Bug description

If I am not mistaken, the function "caml_output_value_to_string" in byterun/extern.c is buggy, because it does not save the pointer "extern_output_first" to the marshalling blocks before calling the string allocation function. Allocating the string might cause the GC to call finalisation functions, which might call marshalling functions again, thus making this global pointer refer to wrong data. The function "caml_output_val" got it right, and should be used as example for the correct way to handle that case.

@vicuna
Copy link
Author

vicuna commented Jun 10, 2006

Comment author: @xavierleroy

Fixed as suggested in 3.09 bugfix branch

@vicuna vicuna closed this as completed Jun 10, 2006
@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