Skip to Content.
Sympa Menu

svadev - Re: [svadev] Using freed pointer

svadev AT lists.siebelschool.illinois.edu

Subject: Svadev mailing list

List archive

Re: [svadev] Using freed pointer


Chronological Thread 
  • From: John Criswell <criswell AT illinois.edu>
  • To: Thomas Sanchez <thomas.sanchz AT gmail.com>
  • Cc: svadev AT cs.uiuc.edu
  • Subject: Re: [svadev] Using freed pointer
  • Date: Thu, 18 Aug 2011 13:43:18 -0500
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/svadev>
  • List-id: <svadev.cs.uiuc.edu>
  • Organization: University of Illinois

On 8/18/11 11:33 AM, Thomas Sanchez wrote:
Hi,
I just read the mail on the clang mailing list talking about SAFE.
I'am pretty interested in this tool but the first test I did was not a
full success:

int main(int ac, char** av)
{

char* ptr = new char;
*ptr = 9;
delete ptr;
return *ptr;
}

$> ./bin/clang++ -g -fmemsafety test.cpp -Llib -lsc_dbg_rt
-lpoolalloc_bitmap -lstdc++
$> ./a.out
$> echo $?
9

Should'nt this code trigger some errors during the execution ?

Unfortunately, I'm still working on getting all of the memory safety checks updated to mainline LLVM and integrated into Clang (technically, Clang and libLTO). Clang+SAFECode is currently able to catch array bounds violations (if you try to read/write data using the out-of-bounds pointer; comparing out-of-bounds pointers is considered okay), but it cannot catch arbitrary load/store violations at present.

That said, I've done some work updating the code that makes the load/store checks work, but I haven't tested it yet. There's a chance that it'll work as it is. If you're feeling adventurous, you can get SAFECode out of SVN ånd try out the new libLTO library. This version of libLTO should run the pass (called CompleteChecks) that will make load/store checks work (I can explain what this pass does if you like, but I'll omit such an explanation here for brevity).

-- John T.

I'm on Mac OS X 10.7.


Thank you !






Archive powered by MHonArc 2.6.16.

Top of Page