Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006760OCamlruntime system and C interfacepublic2015-01-25 20:142016-12-07 11:47
Reporterwhitequark 
Assigned Towhitequark 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version4.03.0+dev / +beta1 
Summary0006760: Closure marshalling in toplevel is broken since at least 4.00
DescriptionTo reproduce, do in toplevel:

    Marshal.to_string (fun () -> ()) [Marshal.Closures]
    Exception: Invalid_argument "output_value: abstract value (outside heap)".
Tagspatch
Attached Filespatch file icon extern.patch [^] (4,070 bytes) 2015-01-25 21:07 [Show Content]

- Relationships
related to 0006468closedwhitequark Backtraces in toplevel 

-  Notes
(0013181)
whitequark (developer)
2015-01-25 20:22

@gasche: I've attached a patch.
(0013183)
gasche (administrator)
2015-01-25 21:46

I find it rather suspicious that caml_ext_table_remove would take the responsibility to caml_stat_free the data to remove. Does this really correspond to the ownership disciplines of all users of caml_ext_table_add?

Also, I'm not familiar with this part of the code, but isn't abort()ing in caml_static_release_bytecode a bit overconfident? I would be more comfortable with at least an error message.
(0013184)
whitequark (developer)
2015-01-25 21:49

It does; caml_ext_table_free performs caml_stat_free on the data, which is why I wrote _remove that way.

I don't think so; in the impossible case (mismatched reify/release) that it happens, the backtrace provides more than enough context to debug this.
(0013225)
jacques-henri.jourdan (manager)
2015-02-04 18:10

gashe : here is what I think. It seems fine to me, except for the abort(), that does not fit the discipline of the rest of the runtime. You should instead use CAMLassert.
(0013254)
gasche (administrator)
2015-02-08 15:10

Merged -- in trunk only -- with the change suggested by Jacques-Henri:

  if (!cf) {
      /* [cf] Not matched with a caml_reify_bytecode call; impossible. */
      Assert (0);
  } else {
      caml_ext_table_remove(&caml_code_fragments_table, cf);
  }

- Issue History
Date Modified Username Field Change
2015-01-25 20:14 whitequark New Issue
2015-01-25 20:14 whitequark Relationship added related to 0006468
2015-01-25 20:14 whitequark Assigned To => whitequark
2015-01-25 20:14 whitequark Status new => assigned
2015-01-25 20:21 whitequark Tag Attached: patch
2015-01-25 20:21 whitequark File Added: extern.patch
2015-01-25 20:22 whitequark Note Added: 0013181
2015-01-25 21:03 whitequark File Deleted: extern.patch
2015-01-25 21:03 whitequark File Added: extern.patch
2015-01-25 21:07 whitequark File Deleted: extern.patch
2015-01-25 21:07 whitequark File Added: extern.patch
2015-01-25 21:46 gasche Note Added: 0013183
2015-01-25 21:49 whitequark Note Added: 0013184
2015-02-04 18:10 jacques-henri.jourdan Note Added: 0013225
2015-02-08 15:10 gasche Note Added: 0013254
2015-02-08 15:10 gasche Status assigned => resolved
2015-02-08 15:10 gasche Fixed in Version => 4.03.0+dev / +beta1
2015-02-08 15:10 gasche Resolution open => fixed
2016-12-07 11:47 xleroy Status resolved => closed
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