Git Product home page Git Product logo

Comments (12)

deian avatar deian commented on June 3, 2024 1

In our experience the parsing stage is kind of gross and slow. Yes the block and loop bound matter too. I'm not sure there is a bug here. You're asking good questions, but some of these I think you can take a stab at answering them and we'd be happy to incorporate documentation/findings

from sys.

mlfbrown avatar mlfbrown commented on June 3, 2024 1

Aha! This is related to #4 --- @deian is right that we do the dumbest thing right now. If you bring down the block bound it should help, I'm guessing the loop bound should already be low. I can fix this in about three weeks (sorry! have been meaning to for a while!), otherwise what will help is (1) reducing the number of paths that static flags (2) reducing the block bound.

from sys.

marcinguy avatar marcinguy commented on June 3, 2024

Maybe related:
#20

from sys.

marcinguy avatar marcinguy commented on June 3, 2024

Wondering if:

https://github.com/PLSysSec/sys/blob/821c4d7cf924e68838c128cbe824be46c9955416/src/Static/CheckerConfigDef.hs


      cfgBlockBound          :: Int,
                             -- ^ How many blocks should we explore
      cfgLoopBound           :: Int,
                             -- ^ How many times through loops?

Impact RAM usage and what is the balance, balanced value here for each Checker? Are defaults good for big projects?

from sys.

marcinguy avatar marcinguy commented on June 3, 2024

If this helps, there are my LL file sizes and occurences:

https://github.com/marcinguy/public/blob/master/files-occurences-sizes.txt

from sys.

marcinguy avatar marcinguy commented on June 3, 2024

I get results for files under < 1 MB (ll files) on modern laptop (Core i5, 20 GB Ram), with bigger files I seem to get OOMs

from sys.

marcinguy avatar marcinguy commented on June 3, 2024

Thanks. Would love to. Pity I never did anything in Haskell. Seems like stack exec sys +RTS -N1 -- -c heapoob -e ll -d /folder helps a little bit here, untill OOM happens later on P.S Total Haskell beginner

from sys.

marcinguy avatar marcinguy commented on June 3, 2024

@deian Can you give a hint how to run in on several cores only? Limited resources? So that it does not OOM that quickly?

from sys.

marcinguy avatar marcinguy commented on June 3, 2024

Thanks @mlfbrown @deian

Reduced the block bound to 1, not sure how to do (1) paths that static flags and where is it defined, but it still OOMs.

The destination machine I work on have many cores/CPUs, trying to cap it to several cores (docker run --cpuset-cpus="0-N"), than I hope to have more RAM per cores used. Not sure if this will help, how the threading works in Haskell and Sys. Will update later.

Does Sys, Haskell starts one thread per core based on amount of cores? Memory should be shared between threads, but I guess with more cores, you will need more memory??? Speed will be faster with more cores, but you need more Memory. So I want to sacrifice speed for completeness (no OOMs). Is this assumption correct?

from sys.

marcinguy avatar marcinguy commented on June 3, 2024

Capping CPUs/cores in Docker seem to work, but Sys starts so many Threads as cores .... will see how this will work. Will update.

from sys.

marcinguy avatar marcinguy commented on June 3, 2024

Trying this ... will see if this helps.

import Control.Concurrent(setNumCapabilities)

fork :: Checker a b () -> Checker a b ()
fork act = do
  s0 <- get
  void $ liftIO $ do
    setNumCapabilities 1
    forkIO (curTGroup s0) $ evalChecker act s0

Can make a PR to add this as an option to set number of threads vs getting cores amount.

Not sure how to get it from command line parameter and pass it on.

Here is my PR:

#22

from sys.

marcinguy avatar marcinguy commented on June 3, 2024

Nah ... running it now with Bash to skip files when it OOMs and continue where it left off.

On my side the issue is closed. Feel free to close if you wish.

Thanks for your help. Looking forward to future improvements.

#!/bin/bash
export LOG_LEVEL=debug

find /local/ -depth -name "*.done" -exec sh -c 'mv "$1" "${1%.ll.done}.ll"' _ {} \;

while IFS= read -r -d '' -u 9
do
        stack exec sys -- -c uninit -e ll -d "$REPLY" >> /local/uninit_results.txt
        mv "$REPLY" "$REPLY".done
done 9< <( find /local/ -type f -name "*.ll" -exec printf '%s\0' {} + )

find /local/ -depth -name "*.done" -exec sh -c 'mv "$1" "${1%.ll.done}.ll"' _ {} \;

while IFS= read -r -d '' -u 9
do
        stack exec sys -- -c heapoob -e ll -d "$REPLY" >> /local/heapoob_results.txt
        mv "$REPLY" "$REPLY".done
done 9< <( find /local/ -type f -name "*.ll" -exec printf '%s\0' {} + )

find /local/ -depth -name "*.done" -exec sh -c 'mv "$1" "${1%.ll.done}.ll"' _ {} \;

while IFS= read -r -d '' -u 9
do
        stack exec sys -- -c concroob -e ll -d "$REPLY" >> /local/concroob_results.txt
        mv "$REPLY" "$REPLY".done
done 9< <( find /local/ -type f -name "*.ll" -exec printf '%s\0' {} + )

find /local/ -depth -name "*.done" -exec sh -c 'mv "$1" "${1%.ll.done}.ll"' _ {} \;

while IFS= read -r -d '' -u 9
do
        stack exec sys -- -c userinput -e ll -d "$REPLY" >> /local/userinput_results.txt
        mv "$REPLY" "$REPLY".done
done 9< <( find /local/ -type f -name "*.ll" -exec printf '%s\0' {} + )

find /local/ -depth -name "*.done" -exec sh -c 'mv "$1" "${1%.ll.done}.ll"' _ {} \;

while IFS= read -r -d '' -u 9
do
        stack exec sys -- -c uaf  -e ll -d "$REPLY" >> /local/uaf_results.txt
        mv "$REPLY" "$REPLY".done
done 9< <( find /local/ -type f -name "*.ll" -exec printf '%s\0' {} + )

from sys.

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.