Skip to Content.
Sympa Menu

svadev - Re: [svadev] safecode passes

svadev AT lists.siebelschool.illinois.edu

Subject: Svadev mailing list

List archive

Re: [svadev] safecode passes


Chronological Thread 
  • From: John Criswell <criswell AT illinois.edu>
  • To: Daniel Huang <dan.e.huang AT gmail.com>
  • Cc: "<svadev AT cs.illinois.edu>" <svadev AT cs.illinois.edu>
  • Subject: Re: [svadev] safecode passes
  • Date: Thu, 28 Feb 2013 12:44:25 -0600
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/svadev/>
  • List-id: <svadev.cs.uiuc.edu>
  • Organization: University of Illinois

On 2/27/13 10:02 PM, Daniel Huang wrote:
Hi Svadev,

I'm using a version of SAFECode where I have pool-allocation turned on. I've noticed that depending on the input C file, SAFECode sometimes does not write a bitcode file as specified in LTOCodeGenerator.cpp. Furthermore, whenever it does not write the bitcode file, it also does not run my pass (which I have bolded below). I add my pass in LTOCodeGenerator.cpp. 

// Add the automatic pool allocation passes
passes.add(new OptimizeSafeLoadStore());
passes.add(new PA::AllNodesHeuristic());
passes.add(new PoolAllocate());
extern Pass * createPHPass(void);
passes.add(createPHPass());

Some sample inputs where the above happen are (from the SAFECode test/mem_safety directory):
double_free-002.c
double_free-008.c
double_free-011.c

I've also noticed that for any input file, when I turn optimization on (-O1, -O2, -O3), SAFECode does not write the bitcode file. Furthermore, it does not run my pass. Do you have any idea why this behavior occurs or how to fix this so that the bitcode writing and my pass are always run?

I suspect the problem occurs because libLTO believes that there are no SAFECode run-time checks in the program and, as a consequence, it does not run the SAFECode and Poolalloc passes (nor the bitcode writing pass).  For example, double_free-002.c only has poolcheck_free() checks which the libLTO pass (erroneously) considers to not be a run-time check.

A quick fix for you is to modify libLTO so that the SAFECodeUsed flag is always set to true.  That way, even if all the checks are optimized away, you'll get poolalloc running.  I'll try to fix the poolcheck_free() issue today or tomorrow (I've got too many meetings today).

-- John T.


Thanks in advance,
Dan




_______________________________________________
svadev mailing list
svadev AT cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/svadev




Archive powered by MHonArc 2.6.16.

Top of Page