Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run the tool on other dataset #1033

Open
faysalhossain2007 opened this issue Aug 31, 2022 · 4 comments
Open

Run the tool on other dataset #1033

faysalhossain2007 opened this issue Aug 31, 2022 · 4 comments

Comments

@faysalhossain2007
Copy link

Thanks for sharing your great tool!

I want to run the tool on another C/C++ dataset (Tensorflow). Can you guide me on how to configure the tool for that, please?

Thanks!

@RyanGlScott
Copy link
Contributor

I don't know what exactly you are trying to do with Crux, so I can only offer general advice:

  • I must first warn you that if you are dealing with C++, you will likely face challenges that you wouldn't face with C code alone. Crux's support for C++ code is still experimental, and there are several rough edges that haven't been resolved, such as this one. That being said, if you are still brave enough to press on...
  • If you are using Crux on code that has external dependencies, then it won't suffice to run Crux on a bare .c file, since Crux doesn't know how to compile C code external libraries. Instead, you'll first need to compile your program to a single .bc file and then invoke crux-llvm --no-compile <my-program-here>.bc.
  • There are several approaches to obtaining a .bc file for a large program, but one relatively straightforward way is to run the extract-bc utility on a compiled executable (or archive, or object file, or some other build artifact).

@faysalhossain2007
Copy link
Author

Thanks, @RyanGlScott for the great suggestions!

In short, my goal is to use crux directly to find memory-related bugs in Tensorflow.

@faysalhossain2007
Copy link
Author

hi @RyanGlScott
I was able to generate .bc using the link that you provided.
Now when I try to build crux-llvm it give the following error:


(uccruxpy37) faysal-gpu@faysal-gpu:/crucible/crux-llvm$ cabal build crux-llvm
cabal: Ambiguous target 'crux-llvm'. It could be:
exe:crux-llvm (component)
lib:crux-llvm (component)

That's why I try with uc-crux-llvm instead of crux-llvm. But I am also not able to execute the code.

(uccruxpy37) faysal-gpu@faysal-gpu:/crucible/crux-llvm$ uc-crux-llvm --explore /whole-program-llvm/bullet-bin/src/LinearMath/libLinearMath.a.bc 
`clang` compilation failed.
*** Exit code: 1
*** Standard out:
*** Standard error:
   llvm-link: crux-build/libLinearMath.a.bc: error: Could not open input file: No such file or directory
   llvm-link: error loading file 'crux-build/libLinearMath.a.bc'

do you have any suggestions?

@RyanGlScott
Copy link
Contributor

Now when I try to build crux-llvm it give the following error:

Ah, I'm guessing that you are running cabal build crux-llvm from within the crux-llvm directory. If you run cabal build crux-llvm from the top-level crucible directory, it will build as expected.

cabal build has slightly different behavior when not run from the top-level directory, for better or worse. If you want to disambiguate, you can run:

$ cabal build exe:crux-llvm

Which specifically builds the crux-llvm executable. (We might want to consider using this command everywhere in the README to avoid confusion.)

That's why I try with uc-crux-llvm instead of crux-llvm. But I am also not able to execute the code.

Indeed, uc-crux-llvm is a separate tool entirely. While it shares a lot of characteristics in common with crux-llvm, it is not intended as a drop-in replacement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants