svadev AT lists.siebelschool.illinois.edu
Subject: Svadev mailing list
List archive
- From: Umesh Kalappa <umesh.kalappa0 AT gmail.com>
- To: Fábio Resner <fabiusks AT gmail.com>
- Cc: svadev AT cs.uiuc.edu
- Subject: Re: [svadev] Safecode driving me crazy :( :( :(
- Date: Thu, 3 May 2012 17:55:34 +0530
- List-archive: <http://lists.cs.uiuc.edu/pipermail/svadev>
- List-id: <svadev.cs.uiuc.edu>
Hi Resener,
While running the instrumented executable i.e ./test 10 and i see following output in the console and which is not proper i.e
=======+++++++ SAFECODE RUNTIME ALERT +++++++=======
= Error type : Uninitialized/NULL Pointer Error
= Faulting pointer : 0xc0000001
= Program counter : 0x8
= Fault PC Source : <unknown>:0
SAFECode: Fault!
SAFECode:Violation Type 0x9 when accessing 0xc0000001 at IP=0x8
=======+++++++ SAFECODE RUNTIME ALERT +++++++=======
= Error type : Uninitialized/NULL Pointer Error
= Faulting pointer : 0xc0000001
= Program counter : 0x8
= Fault PC Source : <unknown>:0
SAFECode: Fault!
SAFECode:Violation Type 0x9 when accessing 0xc0000001 at IP=0x8
=======+++++++ SAFECODE RUNTIME ALERT +++++++=======
= Error type : Uninitialized/NULL Pointer Error
= Faulting pointer : 0xc0000001
= Program counter : 0x8
= Fault PC Source : <unknown>:0
SAFECode: Fault!
SAFECode:Violation Type 0x9 when accessing 0xc0000001 at IP=0x8
From the above output,i could not make out either any conclusion about the issue (Uninitialized/NULL Pointer Error) that was pointed by runtime information nor i see that the output was not so informative for me .
FYI and i tried below sample too
int *ptr = (void*)0;
void func()
{
int a =10;
*ptr = &a;
}
int main()
{
return *ptr;
}
[root@localhost lib]#clang -g -fmemsafety -o test1 test1.c -lsc_dbg_rt -lpoolalloc_bitmap -lstdc++
[root@localhost lib]# ./test
=======+++++++ SAFECODE RUNTIME ALERT +++++++=======
= Error type : Load/Store Error
= Faulting pointer : 0
= Program counter : 0x415ab0
= Fault PC Source : <unknown>:0
SAFECode: Fault!
SAFECode:Violation Type 0x6 when accessing 0 at IP=0x415ab0
=======+++++++ SAFECODE RUNTIME ALERT +++++++=======
= Error type : Load/Store Error
= Faulting pointer : 0
= Program counter : 0x415ab0
= Fault PC Source : <unknown>:0
SAFECode: Fault!
SAFECode:Violation Type 0x6 when accessing 0 at IP=0x415ab0
=======+++++++ SAFECODE RUNTIME ALERT +++++++=======
= Error type : Load/Store Error
= Faulting pointer : 0
= Program counter : 0x415ab0
= Fault PC Source : <unknown>:0
SAFECode: Fault!
SAFECode:Violation Type 0x6 when accessing 0 at IP=0x415ab0
=======+++++++ SAFECODE RUNTIME ALERT +++++++=======
= Error type : Load/Store Error
= Faulting pointer : 0
= Program counter : 0x415ab0
^C= Fault PC Source : <unknown>:0
Again safecode output not so informative :(
~Umesh
On Thu, May 3, 2012 at 5:35 PM, Fábio Resner <fabiusks AT gmail.com> wrote:
Sorry if I'm saying something stupid but, what exactly is your problem?Isn't that supposed to happen?test.c is a bug program for you to compile and confirm that the runtime checks are being inserted by safeCode and that theprogram execution is being properly aborted.On Thu, May 3, 2012 at 9:00 AM, Umesh Kalappa <umesh.kalappa0 AT gmail.com> wrote:
_______________________________________________Hello Everybody ,I'm new to the safecode list and myself used valgrind extensively to detect the memory leaks at runtime and came to know about the safecode project from LLVM IRC,so thought of using the same for runtime checks and here is the steps followed to compile and install the safecode1)Downloaded the latest safecode source from http://safecode.cs.illinois.edu/releases/sc-main.tar.gz2)Compiled the source asa)tar -xvf sc-main.tar.gzb)mkdir buildc)cd buildd)../llvm/configuree)cd projects/poolallocf)makeg) cd ../safecodeh)make3)Installed the respective binaries and libs asa)cd buildb)make installc)cd projects/poolallocd)make installe)cd ../safecodef)make installThen,used the attached test.c to test the installation.but the clang(safecode) drives me crazy with below output$clang -g -fmemsafety -o test test.c -lsc_dbg_rt -lpoolalloc_bitmap -lstdc++$./test 10=======+++++++ SAFECODE RUNTIME ALERT +++++++======== Error type : Uninitialized/NULL Pointer Error= Faulting pointer : 0xc0000001= Program counter : 0x8= Fault PC Source : <unknown>:0SAFECode: Fault!SAFECode:Violation Type 0x9 when accessing 0xc0000001 at IP=0x8=======+++++++ SAFECODE RUNTIME ALERT +++++++======== Error type : Uninitialized/NULL Pointer Error= Faulting pointer : 0xc0000001= Program counter : 0x8= Fault PC Source : <unknown>:0SAFECode: Fault!SAFECode:Violation Type 0x9 when accessing 0xc0000001 at IP=0x8=======+++++++ SAFECODE RUNTIME ALERT +++++++======== Error type : Uninitialized/NULL Pointer Error= Faulting pointer : 0xc0000001= Program counter : 0x8= Fault PC Source : <unknown>:0SAFECode: Fault!SAFECode:Violation Type 0x9 when accessing 0xc0000001 at IP=0x8< Running infinite>for reference[root@localhost simple_player]# clang --versionclang version 3.0 (: http://llvm.org/svn/llvm-project/safecode/trunk/tools/clang)Target: x86_64-unknown-linux-gnuThread model: posixPlease let me know ,if i'm doing something wrong here ,which drives the runtime checks crazy orif not any lights on the above issue will help me a lot and appreciate the same .In turn it will help me to get output as mentioned in the website for the same test.c sample like=======+++++++ SAFECODE RUNTIME ALERT +++++++======== Error type : Load/Store Error= Faulting pointer : 0x100100679= Program counter : 0x100002493= Fault PC Source : /Users/criswell/tmp/safecode/test/test.c:7== Object allocated at PC : 0x100002ad6= Allocated in Source File : /Users/criswell/tmp/safecode/test/test.c:17= Object allocation sequence number : 3= Object start : 0x100100670= Object length : 0x9Thanks in Advance~Umesh
svadev mailing list
svadev AT cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/svadev
--
Fabio Resner.
- [svadev] Safecode driving me crazy :( :( :(, Umesh Kalappa, 05/03/2012
- Re: [svadev] Safecode driving me crazy :( :( :(, Fábio Resner, 05/03/2012
- Re: [svadev] Safecode driving me crazy :( :( :(, Umesh Kalappa, 05/03/2012
- Re: [svadev] Safecode driving me crazy :( :( :(, John Criswell, 05/03/2012
- Re: [svadev] Safecode driving me crazy :( :( :(, Fábio Resner, 05/03/2012
Archive powered by MHonArc 2.6.16.