Coder Social home page Coder Social logo

Segmentation fault? about libcspm HOT 5 CLOSED

annonymouse avatar annonymouse commented on July 30, 2024
Segmentation fault?

from libcspm.

Comments (5)

PhilArmstrong avatar PhilArmstrong commented on July 30, 2024

Looks like calculating Set({1..N}) could be a bit stricter, but even so the powerset of a 25 element set will have 225 subsets. I doubt this will fit in the memory of your machine.

from libcspm.

PhilArmstrong avatar PhilArmstrong commented on July 30, 2024

(A quick back of the envelope calculation suggests that you might fit the resultant set in 3Gb or so of memory, given the likely Haskell representation. I could be out by a factor of two or more quite easily though.)

from libcspm.

tomgr avatar tomgr commented on July 30, 2024

@annonymouse how exactly were you using it when it produced the error? For example, were you using Set in a datatype/channel declaration etc?

As Phil says, a set of size 2^25 is going to use a lot of memory so it's probably inadvisable to do that.

Thanks for letting us know though - we can certainly try and improve the situation.

from libcspm.

annonymouse avatar annonymouse commented on July 30, 2024

@PhilArmstrong cheers for the sanity :) I can only blame the time of the night. In some sense it's better that it failed early or I would have been scratching my head a bit as to why things were taking so long. My approach here was bit flawed but I've changed it slightly anyway.

@tomgr For that error specifically I was using it in the interpreter, github slightly borked my copy/paste job there. I managed to reduce it to a Set({1..19}).

Welcome to FDR 3.0.0 (521b22cd118f0a02ade8a95ac96b294148a7c122)
Type :help for help
>  Set({1..19})
panic: the program has detected an inconsistent internal state.
This means that there is a bug in libcspm, not a bug in your input script.
Please report this bug using the contact link at https://www.cs.ox.ac.uk/projects/fdr/.
In particular, please include the input script that caused this error and a brief
description of how to reproduce the problem. Please also include the following message:
    stack overflow

Given the error tells me to report the bug, I felt guilty not doing so :) This is on a 4 core i7 with 16GB of memory - although I suspect the segmentation fault won't depend on that as it occurs very quickly and the FDR process doesn't seem to be consuming many resources when it does this (although I haven't actually traced it to confirm). As you say, this is a strange thing to be doing so I wouldn't worry too much.

Specifically I was using it in a comprehension to generate sets of events up front rather than generating them on the fly - which may have been flawed given that the size of the problem increases a lot very quickly 😄

I'm happy to close this issue - but let me know if you wanted to know any more.

from libcspm.

tomgr avatar tomgr commented on July 30, 2024

Ahh ok thanks. Certainly trying to print that set might cause problems (I think there are a few space leaks in the pretty printer), but you should be able to use the set in iterations such as { x | x <- Set({...}) } etc. You will need an unfortunate quantity of RAM mind you!

Thanks for letting us know anyhow.

from libcspm.

Related Issues (4)

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.