Skip to Content.
Sympa Menu

svadev - Re: [svadev] safecode

svadev AT lists.siebelschool.illinois.edu

Subject: Svadev mailing list

List archive

Re: [svadev] safecode


Chronological Thread 
  • From: Daniel Huang <dehuang AT fas.harvard.edu>
  • To: John Criswell <criswell AT illinois.edu>
  • Cc: svadev AT cs.illinois.edu
  • Subject: Re: [svadev] safecode
  • Date: Fri, 25 May 2012 16:39:44 -0400
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/svadev>
  • List-id: <svadev.cs.uiuc.edu>

The file shows up but is empty. 

On Fri, May 25, 2012 at 2:50 PM, John Criswell <criswell AT illinois.edu> wrote:
On 5/25/12 1:35 PM, Daniel Huang wrote:
Ahh, ok. Thanks for all the help! Really appreciate it.

It's morning somewhere, right?
:)

Sorry that I forgot to do this in the morning.  I've committed the change; if you svn up and try it again, you should get the bitcode in /tmp/pafile.bc.

If you need to test things in parallel, let me know; I could probably make the output filename configurable via an environment variable.

-- John T.




On Fri, May 25, 2012 at 12:33 AM, John Criswell <criswell AT illinois.edu> wrote:
On 5/24/12 11:04 PM, Daniel Huang wrote:
Ahh, forgot to reinstall the libLTO stuff, thanks. After reinstalling, I've tried running these 3 command line combinations ...

1) clang -flto -fmemsafety test.c -S -o test.ll
Compiles, but no pools.

2) clang -flto -fmemsafety -emit-llvm test.c -S -o test.ll
clang: warning: argument unused during compilation: '-flto'
Compiles, but no pools.

The above two commands do not invoke the linker which is why you don't get any pool allocation.



3) clang -flto -fmemsafety test.c -o test.o
Pool allocating 6 global nodes!
[main] 5 nodes pool allocatable

So it looks like the 3rd one works, but its not in a human readable form ... Is there any way to get safecode to output the pools in a human-readable form?

I think the only way to do that is to add a BitcodeWriter pass after the pool allocation pass to write the output to a file.  I can add that first thing tomorrow morning.

-- John T.



Thanks!

On Thu, May 24, 2012 at 7:04 PM, John Criswell <criswell AT illinois.edu> wrote:
On 5/24/12 5:56 PM, Daniel Huang wrote:
I added -DPOOLALLOC but still haven't been able to get any programs to emit poolalloc or poolinit instructions. Perhaps I misunderstood you, but I modified safecode's Makefile.common SC_FLAGS with -DPOOLALLOC.

Did you recompile the code?  Did you reinstall the SAFECode libLTO after the recompile?  Are you giving clang the proper command-line arguments to make it use libLTO?

Poolalloc is performed by libLTO.  If you aren't using libLTO (or if you've installed it incorrectly), then the automatic pool allocation transform won't be run.  You need to use the SAFECode libLTO; directions can be found in the SAFECode Install Guide and User's Guide on the SAFECode web page.



Also, do you have an example program which will cause the tool to emit these instructions?

With the SAFECode heuristic, pretty much any code with memory allocations will generate pool functions.  You might want to try using code examples from the SAFECode or Poolalloc papers.


I'm really curious to see where pools are created and destroyed. For example, can they be created in the middle of the function, or are they only ever created at the beginning of a function and destroyed at the end.

I believe dynamically allocated pools are always created a function entry and destroyed at function exit.

-- John T.









Archive powered by MHonArc 2.6.16.

Top of Page