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

Mix-up of Minor_heap_min and Minor_heap_max units #5945

vicuna opened this issue Mar 12, 2013 · 1 comment

Mix-up of Minor_heap_min and Minor_heap_max units #5945

vicuna opened this issue Mar 12, 2013 · 1 comment


Copy link

@vicuna vicuna commented Mar 12, 2013

Original bug ID: 5945
Reporter: bvaugon
Assigned to: @damiendoligez
Status: closed (set by @damiendoligez on 2013-07-17T11:51:30Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.00.1
Target version: 4.01.0+dev
Fixed in version: 4.01.0+dev
Category: runtime system and C interface
Monitored by: @gasche

Bug description

In the OCaml runtime, the contants representing the minor heap bounds Minor_heap_min and Minor_heap_max are sometimes used as byte number and sometimes as word number.

The comments near declarations of these constants (from config.h) tells that Minor_heap_* should be word numbers.

The attached patch fixes this problem.

Steps to reproduce

This problem can be observed in two different ways:

1/ Break an assertion with a valid minor heap size initialization:

$ grep Minor_heap_max [OCAML_PATH]/byterun/config.h
#define Minor_heap_max (1 << 28)
$ ocamlc -use-runtime [OCAML_PATH]/byterun/ocamlrund -o hw
$ CAMLRUNPARAM=s=200000000 ./hw
file minor_gc.d.c; line 82 ### Assertion failed: size <= Minor_heap_max

2/ Impossibility to dynamically change minor heap size to a valid value:

With the same Minor_heap_max (1 << 28) from config.h, run this OCaml program:

Gc.set { (Gc.get ()) with Gc.minor_heap_size = 200000000 };;
Printf.printf "%d\n" (Gc.get ()).Gc.minor_heap_size;;

-> 67108864

Additional information

This problem comes from gc_ctrl.c and minor_gc.c, see ocaml-4.00.1-minor-heap-sizes.diff.

File attachments

Copy link

@vicuna vicuna commented Jul 17, 2013

Comment author: @damiendoligez

patch applied to 4.01 branch (rev 13899)

@vicuna vicuna closed this Jul 17, 2013
@vicuna vicuna added the stdlib label Mar 14, 2019
@vicuna vicuna added this to the 4.01.0 milestone Mar 14, 2019
@vicuna vicuna added the bug label Mar 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants