mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-30 08:03:59 +00:00
parent
5569d2ddc2
commit
9c8e76b190
1
repos/base/recipes/pkg/test-sanitizer/README
Normal file
1
repos/base/recipes/pkg/test-sanitizer/README
Normal file
@ -0,0 +1 @@
|
||||
Test for sanitizer runtime error detection
|
3
repos/base/recipes/pkg/test-sanitizer/archives
Normal file
3
repos/base/recipes/pkg/test-sanitizer/archives
Normal file
@ -0,0 +1,3 @@
|
||||
_/src/init
|
||||
_/src/sanitizer
|
||||
_/src/test-sanitizer
|
1
repos/base/recipes/pkg/test-sanitizer/hash
Normal file
1
repos/base/recipes/pkg/test-sanitizer/hash
Normal file
@ -0,0 +1 @@
|
||||
2018-12-06-t c5ea39e824451955b77f5a1e832ee639a52497bf
|
33
repos/base/recipes/pkg/test-sanitizer/runtime
Normal file
33
repos/base/recipes/pkg/test-sanitizer/runtime
Normal file
@ -0,0 +1,33 @@
|
||||
<runtime ram="32M" caps="1000" binary="init">
|
||||
|
||||
<events>
|
||||
<timeout meaning="failed" sec="10" />
|
||||
<log meaning="succeeded">
|
||||
[init -> test-sanitizer]*runtime error: *index 2 out of bounds*
|
||||
[init -> test-sanitizer]*runtime error: *store to null pointer
|
||||
</log>
|
||||
</events>
|
||||
|
||||
<content>
|
||||
<rom label="ld.lib.so"/>
|
||||
<rom label="libsanitizer_common.lib.so"/>
|
||||
<rom label="libubsan.lib.so"/>
|
||||
<rom label="test-sanitizer"/>
|
||||
</content>
|
||||
|
||||
<config>
|
||||
<parent-provides>
|
||||
<service name="CPU"/>
|
||||
<service name="LOG"/>
|
||||
<service name="PD"/>
|
||||
<service name="ROM"/>
|
||||
</parent-provides>
|
||||
<default-route>
|
||||
<any-service> <any-child/> <parent/> </any-service>
|
||||
</default-route>
|
||||
<default caps="100"/>
|
||||
<start name="test-sanitizer">
|
||||
<resource name="RAM" quantum="16M"/>
|
||||
</start>
|
||||
</config>
|
||||
</runtime>
|
2
repos/base/recipes/src/test-sanitizer/content.mk
Normal file
2
repos/base/recipes/src/test-sanitizer/content.mk
Normal file
@ -0,0 +1,2 @@
|
||||
SRC_DIR = src/test/sanitizer
|
||||
include $(GENODE_DIR)/repos/base/recipes/src/content.inc
|
1
repos/base/recipes/src/test-sanitizer/hash
Normal file
1
repos/base/recipes/src/test-sanitizer/hash
Normal file
@ -0,0 +1 @@
|
||||
2018-11-27 4280725b29c79fbd31df0f9f96028206055d9142
|
2
repos/base/recipes/src/test-sanitizer/used_apis
Normal file
2
repos/base/recipes/src/test-sanitizer/used_apis
Normal file
@ -0,0 +1,2 @@
|
||||
base
|
||||
sanitizer
|
34
repos/base/src/test/sanitizer/main.cc
Normal file
34
repos/base/src/test/sanitizer/main.cc
Normal file
@ -0,0 +1,34 @@
|
||||
/*
|
||||
* \brief Sanitizer test
|
||||
* \author Christian Prochaska
|
||||
* \date 2018-12-06
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2018 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
#include <base/component.h>
|
||||
#include <base/log.h>
|
||||
|
||||
extern void sanitizer_init(Genode::Env &);
|
||||
|
||||
void Component::construct(Genode::Env &env)
|
||||
{
|
||||
env.exec_static_constructors();
|
||||
sanitizer_init(env);
|
||||
|
||||
/* test array out-of-bounds access detection */
|
||||
|
||||
int array[1];
|
||||
int volatile i = 2;
|
||||
Genode::log("array[", i, "] = ", array[i]);
|
||||
|
||||
/* test null pointer access detection */
|
||||
|
||||
int * volatile ptr = nullptr;
|
||||
*ptr = 0x55;
|
||||
}
|
4
repos/base/src/test/sanitizer/target.mk
Normal file
4
repos/base/src/test/sanitizer/target.mk
Normal file
@ -0,0 +1,4 @@
|
||||
TARGET = test-sanitizer
|
||||
SRC_CC = main.cc
|
||||
LIBS = base
|
||||
SANITIZE_UNDEFINED = yes
|
@ -603,6 +603,7 @@ set default_test_pkgs {
|
||||
test-rom_blk
|
||||
test-rom_filter
|
||||
test-rust
|
||||
test-sanitizer
|
||||
test-sequence
|
||||
test-signal
|
||||
test-slab
|
||||
|
Loading…
x
Reference in New Issue
Block a user