Skip to Content.
Sympa Menu

svadev - Re: [svadev] Safecode driving me crazy :( :( :(

svadev AT lists.siebelschool.illinois.edu

Subject: Svadev mailing list

List archive

Re: [svadev] Safecode driving me crazy :( :( :(


Chronological Thread 
  • 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 :(


Hope i'm clear now and thanks 
~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 the
program 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 safecode 

1)Downloaded the latest safecode source from http://safecode.cs.illinois.edu/releases/sc-main.tar.gz 
2)Compiled the source as 
                            a)tar -xvf sc-main.tar.gz
                            b)mkdir build
                            c)cd build 
                            d)../llvm/configure
                            e)cd projects/poolalloc
                            f)make
                            g) cd ../safecode
                            h)make
3)Installed  the respective  binaries and  libs as 
                            a)cd build 
                            b)make install
                            c)cd projects/poolalloc
                            d)make install
                            e)cd ../safecode
                            f)make install

Then,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>: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

< Running infinite>

for reference 
                [root@localhost simple_player]# clang --version
                 clang version 3.0 (: http://llvm.org/svn/llvm-project/safecode/trunk/tools/clang)
                 Target: x86_64-unknown-linux-gnu
                 Thread model: posix


Please let me know  ,if i'm doing something wrong here  ,which drives the runtime checks crazy or 
if 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                         : 0x9

Thanks in Advance 
~Umesh 




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




--
Fabio Resner.




Archive powered by MHonArc 2.6.16.

Top of Page