You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 6516 Reporter:@stedolan Assigned to:@lefessan Status: closed (set by @xavierleroy on 2016-12-07T10:34:28Z) Resolution: fixed Priority: low Severity: minor Fixed in version: 4.03.0+dev / +beta1 Category: misc Monitored by:@gasche
Bug description
tests / lib-dynlink-bytecode / stub1.c contains the following code:
value stub1() {
CAMLlocal1(x);
printf("This is stub1!\n"); fflush(stdout);
x = caml_copy_string("ABCDEF");
return x;
}
This uses CAMLlocal1 incorrectly, without CAMLparam0 or CAMLreturn. I'm working on an experimental branch of the runtime with multicore support, where this test actually crashes. It seems to work on trunk, but I think this is just by coincidence.
Am I correct in thinking this code is broken? It seems to keep the address of an out-of-scope local.
Steps to reproduce
Bug doesn't trigger on trunk, but you can observe that caml_local_roots contains a dangling pointer to the out-of-scope local x after stub1() returns.
The text was updated successfully, but these errors were encountered:
I committed a new version:
value stub1() {
CAMLparam0();
CAMLlocal1(x);
printf("This is stub1!\n"); fflush(stdout);
x = caml_copy_string("ABCDEF");
CAMLreturn(x);
}
I hope it's correct now.
Original bug ID: 6516
Reporter: @stedolan
Assigned to: @lefessan
Status: closed (set by @xavierleroy on 2016-12-07T10:34:28Z)
Resolution: fixed
Priority: low
Severity: minor
Fixed in version: 4.03.0+dev / +beta1
Category: misc
Monitored by: @gasche
Bug description
tests / lib-dynlink-bytecode / stub1.c contains the following code:
This uses CAMLlocal1 incorrectly, without CAMLparam0 or CAMLreturn. I'm working on an experimental branch of the runtime with multicore support, where this test actually crashes. It seems to work on trunk, but I think this is just by coincidence.
Am I correct in thinking this code is broken? It seems to keep the address of an out-of-scope local.
Steps to reproduce
Bug doesn't trigger on trunk, but you can observe that caml_local_roots contains a dangling pointer to the out-of-scope local x after stub1() returns.
The text was updated successfully, but these errors were encountered: