Coder Social home page Coder Social logo

Comments (5)

yuleisui avatar yuleisui commented on August 25, 2024

Hi Kim,

This is not a bug in SVF.

You may wish to check your g++/clang++ options when compiling the source code of LLVM-3.8.0. If you use std=c++11 to compile llvm-3.8.0, but use std=c++98 to compile SVF, or the other way around, then you may see this error. This error occurs when you use "autoconf" to build SVF, you have to manually correct it to make the options consistent.

"autoconf" will be deprecated soon in later versions of LLVM. I suggest you use cmake (https://github.com/unsw-corg/SVF/wiki/Setup-Guide-(CMake)) to build SVF.

The error will disappear when you use cmake build.

Thanks

from svf.

dtzWill avatar dtzWill commented on August 25, 2024

Hmm, I'm seeing this issue

  • I'm using CMake
  • I've built LLVM-3.8 and SVF with same compiler and same flags, and tried GCC 5.4, 6, clang_4

This issue happens 100% of the time when using #18, however I don't know that it's caused by those changes--it seems it just gets less lucky with the underlying bug.

@rockysui can you verify that running wpa -anders -svfg -dump-svfg on the tutorial's input works correctly and that running it under valgrind reports no errors?

For me, on the current master (using LLVM 3.8) as well as the LLVM 4 changes valgrind reports errors resulting from accessing MemSSA bits that have been deleted. Looking at the code it's easy to see why--indeed they /have/ been deleted. I'm not sure why this happens less on master, and AFAICT has little to do with the C++ standard used to compile the code.

I have patched this issue in my fork which fixes the crash on LLVM 4 and the valgrind errors in both versions.

If indeed this is a problem, perhaps you should be less quick to close bugs (at least wait for the OP to confirm they're resolved)?

from svf.

yuleisui avatar yuleisui commented on August 25, 2024

Hi WIll,

Thanks for confirming this issue and your attempts to fix it!

The aim of building MemSSA is to create SVFG, so MemSSA is an intermediate data structure and will be discarded later. When creating a SVFG, a local instance of memSSA is created (Please take a look at here). This might be the issue when any of its fields is referred later (e.g., dumpSVFG).

I don't know whether we can have a quick workaround fix by simply allocating the MemSSA instance on the heap.

@jcarlson23
Sorry that I am pretty busy with a paper deadline these two weeks, and will try to get a complete fix for this issue and Jared's pull request asap.

from svf.

dtzWill avatar dtzWill commented on August 25, 2024

I've implemented a quickfix here: dtzWill@49a0464

One implication is the mssa is preserved for the lifetime of the SVFG, which for this use case is desired but I don't know about what other clients might want.

For convenience and lack of familiarity with the codebase I just used unique_ptr, anyway it seems to work for me so I thought I'd share in case it's useful to someone else. 👍

from svf.

yuleisui avatar yuleisui commented on August 25, 2024

Thanks, Will! A very good fix using unique_ptr.

The C++11 style is not consistent with SVF. I have committed a quick fix by allocating the "mssa' on the heap instead of a local instance, and also I have kept a "ReleaseMemory" function to be called by users (see f752075).

Anyway, SVF folks could make their own choices to use any of the fixes.

from svf.

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.