Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007168OCamlruntime system and C interfacepublic2016-03-07 23:092016-04-15 11:30
Reporterjacques-henri.jourdan 
Assigned To 
PrioritynormalSeveritycrashReproducibilityalways
StatusclosedResolutionfixed 
Platformamd64OSLinuxOS Version
Product Version4.03.0+dev / +beta1 
Target Version4.03.0+dev / +beta1Fixed in Version4.03.0+dev / +beta1 
Summary0007168: Exceeeding stack limit without growing stack buffer
DescriptionWhen compiling and running the attached program in *bytecode* mode, I get a libc error (free(): invalid pointer).

The reason is that the interpreter stack is exceeded without being reallocated. The estimation of stack usage computed in bytegen.ml is too optimistic in some cases. The situation is even worsened by Setup_for_event, which can use up to 6 stack slots at any time.

I can see two solutions: either we implement a precise stack usage approximation, but this can be difficult to take into account all the situations, or I suggest using a large security margin when allocation the stack buffer (e.g. 1k word).
TagsNo tags attached.
Attached Files? file icon bug.ml [^] (4,161 bytes) 2016-03-07 23:09 [Show Content]

- Relationships

-  Notes
(0015538)
gasche (administrator)
2016-03-17 22:40

See the corresponding pull request: https://github.com/ocaml/ocaml/pull/510 [^]
(0015757)
doligez (administrator)
2016-04-15 11:29

Fixed (see GPR#510).


- Issue History
Date Modified Username Field Change
2016-03-07 23:09 jacques-henri.jourdan New Issue
2016-03-07 23:09 jacques-henri.jourdan File Added: bug.ml
2016-03-14 14:37 doligez Status new => acknowledged
2016-03-17 22:40 gasche Note Added: 0015538
2016-04-15 11:29 doligez Note Added: 0015757
2016-04-15 11:29 doligez Fixed in Version => 4.03.0+dev / +beta1
2016-04-15 11:30 doligez Status acknowledged => closed
2016-04-15 11:30 doligez Resolution open => fixed
2017-02-23 16:43 doligez Category OCaml runtime system => runtime system
2017-03-03 17:45 doligez Category runtime system => runtime system and C interface


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker