Skip to Content.
Sympa Menu

svadev - Re: [svadev] Errors compiling SAFECode from SVN (Jacob Katz)

svadev AT lists.siebelschool.illinois.edu

Subject: Svadev mailing list

List archive

Re: [svadev] Errors compiling SAFECode from SVN (Jacob Katz)


Chronological Thread 
  • From: Santosh Nagarakatte <santoshn AT cis.upenn.edu>
  • To: John Criswell <criswell AT illinois.edu>
  • Cc: Jacob Katz <jgkatz AT mit.edu>, svadev AT cs.uiuc.edu
  • Subject: Re: [svadev] Errors compiling SAFECode from SVN (Jacob Katz)
  • Date: Thu, 12 Apr 2012 13:18:09 -0400
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/svadev>
  • List-id: <svadev.cs.uiuc.edu>

John,

Send me the directions for compiling 32bit SafeCode on a 64-bit Linux installation.
I will update the User's guide in a couple of days and let you know.

Thanks,
Santosh

On 04/12/2012 01:12 PM, John Criswell wrote:
On 4/12/12 12:00 PM, Santosh Nagarakatte wrote:
Jake,

You can use SafeCode in 32bit mode.
John Criswell can probably comment more on it.

SAFECode should work both in 32-bit and 64-bit x86 machines.  If you want to compile 32-bit x86 executables on a 64-bit Linux installation, then there's some extra configure options and Makefile changes you need to do to make that work (I've successfully done this).  If you need 32-bit SAFECode on a 64-bit Linux install, let me know, and I'll email the directions out.


However, SoftBoundCETS which is another alternative design for enforcing memory safety is currently not supported on 32 bit.

As an FYI, the version of clang within the SAFECode project has options for two different memory safety approaches: SAFECode and SoftBound.

Santosh, are the SoftBound options documented in the User's Guide?  If not, could you add them?  Once they're added, I can update the docs on the SAFECode/SVA web page.

-- John T.


I am not able to reproduce the problem you describe below on my ubuntu 64-bit machine.
Anyways I have disabled inlining for few of the SoftBoundCETS headers which should fix your problem.

Update to revision154594.

Can you provide more details on your machine.(Linux version, kernel version, compiler version and environment)

Santosh




On 04/12/2012 12:39 PM, Jacob Katz wrote: Hi Santosh,

Just to clarify, does that mean without a 64-bit compilation I will not be able to do bounds or pointer checking? Or is there some alternative in the SAFECode runtime?

Still seem to be having some compilation issues with the updated svn version (see below).

Thanks again for the help.

Cheers,
Jake

llvm[2]: Compiling softboundcets-wrappers.c for Release+Asserts build
softboundcets-wrappers.c:1:1: warning: C++ style comments are not allowed in ISO C90
softboundcets-wrappers.c:1:1: warning: (this will be reported only once per input file)
In file included from softboundcets-wrappers.c:101:
softboundcets.h:1:1: warning: C++ style comments are not allowed in ISO C90
softboundcets.h:1:1: warning: (this will be reported only once per input file)
In file included from softboundcets-wrappers.c:101:
softboundcets.h: In function â__softboundcets_allocate_shadow_stack_spaceâ:
softboundcets.h:292: warning: format â%pâ expects type âvoid *â, but argument 2 has type âsize_t *â
softboundcets.h:292: warning: ISO C90 does not support the âzâ gnu_printf length modifier
softboundcets.h:292: warning: format â%pâ expects type âvoid *â, but argument 4 has type âsize_t *â
softboundcets.h:298: warning: format â%pâ expects type âvoid *â, but argument 2 has type âsize_t *â
softboundcets.h:302: warning: ISO C90 forbids mixed declarations and code
softboundcets.h: In function â__softboundcets_load_base_shadow_stackâ:
softboundcets.h:310: warning: ISO C90 forbids mixed declarations and code
softboundcets.h:314: warning: format â%pâ expects type âvoid *â, but argument 3 has type âsize_t *â
softboundcets.h: In function â__softboundcets_load_bound_shadow_stackâ:
softboundcets.h:322: warning: ISO C90 forbids mixed declarations and code
softboundcets.h:327: warning: format â%pâ expects type âvoid *â, but argument 3 has type âsize_t *â
softboundcets.h: In function â__softboundcets_load_key_shadow_stackâ:
softboundcets.h:335: warning: ISO C90 forbids mixed declarations and code
softboundcets.h:339: warning: ISO C90 does not support the âzâ gnu_printf length modifier
softboundcets.h:339: warning: format â%pâ expects type âvoid *â, but argument 3 has type âsize_t *â
softboundcets.h: In function â__softboundcets_load_lock_shadow_stackâ:
softboundcets.h:348: warning: ISO C90 forbids mixed declarations and code
softboundcets.h:352: warning: format â%pâ expects type âvoid *â, but argument 3 has type âsize_t *â
softboundcets.h: In function â__softboundcets_store_base_shadow_stackâ:
softboundcets.h:360: warning: ISO C90 forbids mixed declarations and code
softboundcets.h:365: warning: format â%pâ expects type âvoid *â, but argument 3 has type âvoid **â
softboundcets.h: In function â__softboundcets_store_bound_shadow_stackâ:
softboundcets.h:373: warning: ISO C90 forbids mixed declarations and code
softboundcets.h:378: warning: format â%pâ expects type âvoid *â, but argument 3 has type âvoid **â
softboundcets.h: In function â__softboundcets_store_key_shadow_stackâ:
softboundcets.h:384: warning: ISO C90 forbids mixed declarations and code
softboundcets.h:390: warning: ISO C90 does not support the âzâ gnu_printf length modifier
softboundcets.h:390: warning: format â%pâ expects type âvoid *â, but argument 3 has type âsize_t *â
softboundcets.h: In function â__softboundcets_store_lock_shadow_stackâ:
softboundcets.h:397: warning: ISO C90 forbids mixed declarations and code
softboundcets.h:402: warning: format â%pâ expects type âvoid *â, but argument 3 has type âvoid **â
softboundcets.h: In function â__softboundcets_deallocate_shadow_stack_spaceâ:
softboundcets.h:412: warning: comparison of unsigned _expression_ >= 0 is always true
softboundcets.h:414: warning: ISO C90 forbids mixed declarations and code
softboundcets.h:423: warning: format â%pâ expects type âvoid *â, but argument 2 has type âsize_t *â
softboundcets.h:423: warning: format â%pâ expects type âvoid *â, but argument 3 has type âsize_t *â
softboundcets.h: In function â__softboundcets_copy_metadataâ:
softboundcets.h:465: warning: ISO C90 forbids mixed declarations and code
softboundcets.h:487: warning: ISO C90 forbids mixed declarations and code
softboundcets.h:493: warning: ISO C90 forbids mixed declarations and code
In file included from softboundcets-wrappers.c:101:
softboundcets.h: In function â__softboundcets_memcopy_check_i64â:
softboundcets.h:583: warning: this decimal constant is unsigned only in ISO C90
softboundcets.h: In function â__softboundcets_memcopy_checkâ:
softboundcets.h:603: warning: this decimal constant is unsigned only in ISO C90
softboundcets.h: In function â__softboundcets_metadata_storeâ:
softboundcets.h:653: warning: ISO C90 forbids mixed declarations and code
softboundcets.h:672: warning: ISO C90 forbids mixed declarations and code
softboundcets.h: In function â__softboundcets_metadata_loadâ:
softboundcets.h:774: warning: ISO C90 forbids mixed declarations and code
softboundcets.h: In function â__softboundcets_temporal_load_dereference_checkâ:
softboundcets.h:829: warning: ISO C90 forbids mixed declarations and code
softboundcets.h: In function â__softboundcets_temporal_store_dereference_checkâ:
softboundcets.h:855: warning: ISO C90 forbids mixed declarations and code
softboundcets.h: In function â__softboundcets_allocation_secondary_trie_allocate_rangeâ:
softboundcets.h:933: warning: ISO C90 forbids mixed declarations and code
softboundcets.h: In function â__softboundcets_allocation_secondary_trie_allocateâ:
softboundcets.h:958: warning: ISO C90 forbids mixed declarations and code
softboundcets.h:969: warning: ISO C90 forbids mixed declarations and code
softboundcets.h: In function â__softboundcets_add_to_free_mapâ:
softboundcets.h:1031: warning: ISO C90 forbids mixed declarations and code
softboundcets.h: In function â__softboundcets_check_remove_from_free_mapâ:
softboundcets.h:1056: warning: ISO C90 forbids mixed declarations and code
softboundcets-wrappers.c: In function âsoftboundcets_getcwdâ:
softboundcets-wrappers.c:944: warning: ISO C90 forbids mixed declarations and code
softboundcets-wrappers.c: In function âsoftboundcets_getsâ:
softboundcets-wrappers.c:1131: warning: ISO C90 forbids mixed declarations and code
softboundcets-wrappers.c: In function âsoftboundcets___getdelimâ:
softboundcets-wrappers.c:1215: warning: ISO C90 forbids mixed declarations and code
softboundcets-wrappers.c:1298:12: warning: missing terminating " character
softboundcets-wrappers.c:1299:59: warning: missing terminating " character
softboundcets-wrappers.c: In function âsoftboundcets_strtokâ:
softboundcets-wrappers.c:1342: warning: integer constant is too large for âlongâ type
softboundcets-wrappers.c:1396:12: warning: missing terminating " character
softboundcets-wrappers.c:1397:45: warning: missing terminating " character
softboundcets-wrappers.c: In function âsoftboundcets_signalâ:
softboundcets-wrappers.c:1448: warning: ISO C forbids conversion of function pointer to object pointer type
softboundcets-wrappers.c:1448: warning: ISO C forbids conversion of function pointer to object pointer type
softboundcets-wrappers.c: In function âsoftboundcets_reallocâ:
softboundcets-wrappers.c:1470: warning: ISO C90 forbids mixed declarations and code
softboundcets-wrappers.c: In function âsoftboundcets_mallocâ:
softboundcets-wrappers.c:1547: warning: ISO C90 forbids mixed declarations and code
softboundcets-wrappers.c: In function âmy_qsortâ:
softboundcets.h:722: sorry, unimplemented: inlining failed in call to â__softboundcets_metadata_loadâ: function not inlinable
softboundcets-wrappers.c:1988: sorry, unimplemented: called from here
softboundcets.h:722: sorry, unimplemented: inlining failed in call to â__softboundcets_metadata_loadâ: function not inlinable
softboundcets-wrappers.c:1990: sorry, unimplemented: called from here
softboundcets.h:636: sorry, unimplemented: inlining failed in call to â__softboundcets_metadata_storeâ: function not inlinable
softboundcets-wrappers.c:1993: sorry, unimplemented: called from here
softboundcets.h:636: sorry, unimplemented: inlining failed in call to â__softboundcets_metadata_storeâ: function not inlinable
softboundcets-wrappers.c:1995: sorry, unimplemented: called from here
make[2]: *** [/home/jgkatz/llvm/projects/safecode/runtime/SoftBoundRuntime/Release+Asserts/softboundcets-wrappers.o] Error 1
make[2]: Leaving directory `/home/jgkatz/llvm/projects/safecode/runtime/SoftBoundRuntime'
make[1]: *** [SoftBoundRuntime/.makeall] Error 2
make[1]: Leaving directory `/home/jgkatz/llvm/projects/safecode/runtime'
make: *** [all] Error 1



On Wed, Apr 11, 2012 at 2:20 PM, Jacob Katz <jgkatz AT mit.edu> wrote:
Hi Santosh,

Do I need to do anything special to compile for a 32 bit target?  Right now I'm somewhat stuck using 32 bit.  I'll give the updates a check later today.

Thanks for the quick response!

Jake


On Wed, Apr 11, 2012 at 1:37 PM, Santosh Nagarakatte <santoshn AT cis.upenn.edu> wrote:
Jacob,

Thanks for reporting the errors. I have fixed the build in revision
154509 from the svn.
I noticed that you are building SafeCode and SoftBound in 32 bit mode.

Although SafeCode supports 32-bit mode execution, SoftBoundCETS does
not support 32-bit execution.

Let me know if anything is broken.

Thanks,
Santosh

> Message: 1
> Date: Tue, 10 Apr 2012 16:48:14 -0400
> From: Jacob Katz <jgkatz AT mit.edu>
> Subject: [svadev] Errors compiling SAFECode from SVN
> To: svadev AT cs.uiuc.edu
> Message-ID:
>        <CAEwmjPETwv+wttQkoteg8bcVUQGpWXX8aE5gEvcLV8xBKKyBjg AT mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Dear SAFECode Developers,
>
> This is my first time compiling LLVM and SAFECode, so I apologize if I am
> running into an obvious issue.  I am trying to build from SVN following the
> procedure in the install guide on the website (compiling on Ubuntu 10.04):
>
> cd where-you-want-llvm-to-live
> svn co http://llvm.org/svn/llvm-project/llvm/branches/release_30 llvm
> cd llvm/projects
> svn co http://llvm.org/svn/llvm-project/poolalloc/trunk poolalloc
> svn co http://llvm.org/svn/llvm-project/safecode/trunk safecode
>
> then
>
> cd LLVM-object-directory
> make tools-only ENABLE_ASSERTIONS=1 ENABLE_OPTIMIZED=1 (I assumed this
> since your tar package has a release+asserts build)
> cd projects/poolalloc
> make
>
> Up to here everything seems to go fine.  Then:
>
> cd ../safecode
> make
>
> At this point I get a bunch of warnings and errors when compiling
> safeboundcets.c (attached below).  Any advice would be much appreciated.
>
> I am very interested in using SAFECode for an online coding environment
> that is part of the Zero Robotics project (zerorobotics.mit.edu).  I have
> previously used gcc + MUDFLAP for array bounds checking, but the overhead
> is tremendous, and I've pretty much had to scrap it for more complicated
> code.  Your approach seems like it will be more efficient, so I'd love to
> give it a try with the system.
>
> Best regards,
> Jake Katz
>
> llvm[2]: Compiling softboundcets.c for Release+Asserts build
> softboundcets.c:1:1: warning: C++ style comments are not allowed in ISO C90
> softboundcets.c:1:1: warning: (this will be reported only once per input
> file)
> In file included from softboundcets.c:51:
> softboundcets.h:1:1: warning: C++ style comments are not allowed in ISO C90
> softboundcets.h:1:1: warning: (this will be reported only once per input
> file)
> In file included from softboundcets.c:51:
> softboundcets.h: In function ?__softboundcets_allocate_shadow_stack_space?:
> softboundcets.h:279: warning: format ?%p? expects type ?void *?, but
> argument 2 has type ?size_t *?
> softboundcets.h:279: warning: ISO C90 does not support the ?z? gnu_printf
> length modifier
> softboundcets.h:279: warning: format ?%p? expects type ?void *?, but
> argument 4 has type ?size_t *?
> softboundcets.h:285: warning: format ?%p? expects type ?void *?, but
> argument 2 has type ?size_t *?
> softboundcets.h:289: warning: ISO C90 forbids mixed declarations and code
> softboundcets.h: In function ?__softboundcets_load_base_shadow_stack?:
> softboundcets.h:297: warning: ISO C90 forbids mixed declarations and code
> softboundcets.h:301: warning: format ?%p? expects type ?void *?, but
> argument 3 has type ?size_t *?
> softboundcets.h: In function ?__softboundcets_load_bound_shadow_stack?:
> softboundcets.h:309: warning: ISO C90 forbids mixed declarations and code
> softboundcets.h:314: warning: format ?%p? expects type ?void *?, but
> argument 3 has type ?size_t *?
> softboundcets.h: In function ?__softboundcets_load_key_shadow_stack?:
> softboundcets.h:322: warning: ISO C90 forbids mixed declarations and code
> softboundcets.h:326: warning: ISO C90 does not support the ?z? gnu_printf
> length modifier
> softboundcets.h:326: warning: format ?%p? expects type ?void *?, but
> argument 3 has type ?size_t *?
> softboundcets.h: In function ?__softboundcets_load_lock_shadow_stack?:
> softboundcets.h:335: warning: ISO C90 forbids mixed declarations and code
> softboundcets.h:339: warning: format ?%p? expects type ?void *?, but
> argument 3 has type ?size_t *?
> softboundcets.h: In function ?__softboundcets_store_base_shadow_stack?:
> softboundcets.h:347: warning: ISO C90 forbids mixed declarations and code
> softboundcets.h:352: warning: format ?%p? expects type ?void *?, but
> argument 3 has type ?void **?
> softboundcets.h: In function ?__softboundcets_store_bound_shadow_stack?:
> softboundcets.h:360: warning: ISO C90 forbids mixed declarations and code
> softboundcets.h:365: warning: format ?%p? expects type ?void *?, but
> argument 3 has type ?void **?
> softboundcets.h: In function ?__softboundcets_store_key_shadow_stack?:
> softboundcets.h:371: warning: ISO C90 forbids mixed declarations and code
> softboundcets.h:377: warning: ISO C90 does not support the ?z? gnu_printf
> length modifier
> softboundcets.h:377: warning: format ?%p? expects type ?void *?, but
> argument 3 has type ?size_t *?
> softboundcets.h: In function ?__softboundcets_store_lock_shadow_stack?:
> softboundcets.h:384: warning: ISO C90 forbids mixed declarations and code
> softboundcets.h:389: warning: format ?%p? expects type ?void *?, but
> argument 3 has type ?void **?
> softboundcets.h: In function
> ?__softboundcets_deallocate_shadow_stack_space?:
> softboundcets.h:399: warning: comparison of unsigned _expression_ >= 0 is
> always true
> softboundcets.h:399: error: ?__SOFTBOUNDCETS_SHADOW_STACK_ENTRIES?
> undeclared (first use in this function)
> softboundcets.h:399: error: (Each undeclared identifier is reported only
> once
> softboundcets.h:399: error: for each function it appears in.)
> softboundcets.h:401: warning: ISO C90 forbids mixed declarations and code
> softboundcets.h:410: warning: format ?%p? expects type ?void *?, but
> argument 2 has type ?size_t *?
> softboundcets.h:410: warning: format ?%p? expects type ?void *?, but
> argument 3 has type ?size_t *?
> softboundcets.h: In function ?__softboundcets_trie_allocate?:
> softboundcets.h:417: error: ?__SOFTBOUNDCETS_TRIE_SECONDARY_TABLE_ENTRIES?
> undeclared (first use in this function)
> softboundcets.h: In function ?__softboundcets_copy_metadata?:
> softboundcets.h:452: warning: ISO C90 forbids mixed declarations and code
> softboundcets.h:474: warning: ISO C90 forbids mixed declarations and code
> softboundcets.h:477: error: ?__SOFTBOUNDCETS_TRIE_SECONDARY_TABLE_ENTRIES?
> undeclared (first use in this function)
> softboundcets.h:480: warning: ISO C90 forbids mixed declarations and code
> In file included from softboundcets.c:51:
> softboundcets.h: In function ?__softboundcets_memcopy_check_i64?:
> softboundcets.h:570: warning: this decimal constant is unsigned only in ISO
> C90
> softboundcets.h: In function ?__softboundcets_memcopy_check?:
> softboundcets.h:590: warning: this decimal constant is unsigned only in ISO
> C90
> softboundcets.h: In function ?__softboundcets_metadata_store?:
> softboundcets.h:640: warning: ISO C90 forbids mixed declarations and code
> softboundcets.h:659: warning: ISO C90 forbids mixed declarations and code
> softboundcets.h: In function ?__softboundcets_metadata_load?:
> softboundcets.h:761: warning: ISO C90 forbids mixed declarations and code
> softboundcets.h: In function
> ?__softboundcets_temporal_load_dereference_check?:
> softboundcets.h:816: warning: ISO C90 forbids mixed declarations and code
> softboundcets.h: In function
> ?__softboundcets_temporal_store_dereference_check?:
> softboundcets.h:842: warning: ISO C90 forbids mixed declarations and code
> softboundcets.h: In function
> ?__softboundcets_allocation_secondary_trie_allocate_range?:
> softboundcets.h:920: warning: ISO C90 forbids mixed declarations and code
> softboundcets.h: In function
> ?__softboundcets_allocation_secondary_trie_allocate?:
> softboundcets.h:945: warning: ISO C90 forbids mixed declarations and code
> softboundcets.h:956: warning: ISO C90 forbids mixed declarations and code
> softboundcets.h: In function ?__softboundcets_add_to_free_map?:
> softboundcets.h:1018: warning: ISO C90 forbids mixed declarations and code
> softboundcets.h:1020: error: ?__SOFTBOUNDCETS_N_FREE_MAP_ENTRIES?
> undeclared (first use in this function)
> softboundcets.h: In function ?__softboundcets_check_remove_from_free_map?:
> softboundcets.h:1043: warning: ISO C90 forbids mixed declarations and code
> softboundcets.h:1045: error: ?__SOFTBOUNDCETS_N_FREE_MAP_ENTRIES?
> undeclared (first use in this function)
> softboundcets.c: In function ?__softboundcets_abort?:
> softboundcets.c:87: warning: ISO C90 forbids mixed declarations and code
> softboundcets.c: In function ?__softboundcets_init?:
> softboundcets.c:131: warning: ISO C90 forbids mixed declarations and code
> softboundcets.c:139: error: ?__SOFTBOUNDCETS_N_STACK_TEMPORAL_ENTRIES?
> undeclared (first use in this function)
> softboundcets.c:139: warning: ISO C90 forbids mixed declarations and code
> softboundcets.c:145: error: ?__SOFTBOUNDCETS_N_GLOBAL_LOCK_SIZE? undeclared
> (first use in this function)
> softboundcets.c:145: warning: ISO C90 forbids mixed declarations and code
> softboundcets.c:153: error: ?__SOFTBOUNDCETS_SHADOW_STACK_ENTRIES?
> undeclared (first use in this function)
> softboundcets.c:153: warning: ISO C90 forbids mixed declarations and code
> softboundcets.c:158: warning: ISO C90 forbids mixed declarations and code
> softboundcets.c:162: warning: format ?%p? expects type ?void *?, but
> argument 2 has type ?size_t *?
> softboundcets.c:166: error: ?__SOFTBOUNDCETS_N_FREE_MAP_ENTRIES? undeclared
> (first use in this function)
> softboundcets.c:172: error: ?__SOFTBOUNDCETS_TRIE_PRIMARY_TABLE_ENTRIES?
> undeclared (first use in this function)
> softboundcets.c:177: warning: ISO C90 forbids mixed declarations and code
> make[2]: ***
> [/home/jgkatz/llvm/projects/safecode/runtime/SoftBoundRuntime/Release+Asserts/softboundcets.o]
> Error 1
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://lists.cs.uiuc.edu/pipermail/svadev/attachments/20120410/fe373d59/attachment-0001.html
>
> ------------------------------
>
> _______________________________________________
> svadev mailing list
> svadev AT cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/svadev
>
>
> End of svadev Digest, Vol 24, Issue 6
> *************************************



--
Santosh G Nagarakatte,
PhD Student,
Computer and Information Science Department
University of Pennsylvania,
Philadelphia-19104
http://www.cis.upenn.edu/~santoshn


--
Santosh G Nagarakatte,
PhD Student,
Computer and Information Science Department
University of Pennsylvania,
Philadelphia-19104
http://www.cis.upenn.edu/~santoshn





_______________________________________________
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