Giter Site home page Giter Site logo

Comments (4)

gasche avatar gasche commented on June 8, 2024

This is very likely to be an issue to fix in the program/library, rather than an issue to fix in the OCaml distribution. Please open an issue there.

It looks like the GC is encountered a value that is malformed -- it should be a block but accessing its header segfaults.

There are several ways this could happen, but one possibility would be that some FFI code uses "naked pointers" (OCaml values that are raw pointers to non-OCaml values outside the OCaml heap), which used to accepted for OCaml 4, were deprecated in OCaml 4.11 (2020), and are now illegal in OCaml 5. One would need to look at the FFI code to tell if it is using naked pointers to rule this possibility out. See the reference manual on this topic.

from ocaml.

Octachron avatar Octachron commented on June 8, 2024

Here is an example of naked pointer in the odiff code for reading tiff files: https://github.com/dmtrKovalenko/odiff/blob/c79541749f0debaf34b698e592dce6da9fb87e9d/io/tiff/ReadTiff.c#L52 . This is most likely the source of the illegal naked pointer in the test.

from ocaml.

gasche avatar gasche commented on June 8, 2024

There you go:

https://github.com/dmtrKovalenko/odiff/blob/c79541749f0debaf34b698e592dce6da9fb87e9d/io/jpg/ReadJpg.c#L75

I think that you could change the code (also in ReadPng) to use a "managed" bigarray where the memory is malloced by the OCaml runtime when creating the bigarray, and deallocated when it gets collected. Alternatively, you can just set the last bit of the pointer when storing it as an OCaml value, this is the "valid representation as an OCaml tagged integer" approach mentioned last in the reference manual.

from ocaml.

cometkim avatar cometkim commented on June 8, 2024

Oh I see, thank for explanation :)

from ocaml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.