Changes between Version 3 and Version 4 of Tools/Memory Checker
- Timestamp:
- Jan 30, 2009, 4:36:19 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Tools/Memory Checker
v3 v4 5 5 == Overview == 6 6 7 The Memory checker is able to perform several analysis on memory accesses performed by the running software to track software bugs. Access to uninitialized or freed data and stack overflow are examples of reported behaviors. It acts as the [http://valgrind.org/ valgrind] memory checker tool found on some unix.7 The Memory checker is able to perform several analysis on memory accesses performed by the running software to track software bugs. Access to uninitialized or freed data and stack overflow are examples of reported behaviors. It acts as the [http://valgrind.org/ valgrind] memory checker tool found on some UNIX. 8 8 9 9 == Implementation == 10 10 11 Like the GdbServer, the Memory checker contains no processor specific code and can be used to manage any Soclib processor model using the generic Iss interface. It is implemented as an Iss wrapper class. When the Memory checker is in use, it intercepts all events between the processor Iss model and the Soclib platform. The running operating system must be instrumented slightly to let the Memory checker be aware of valid stack ranges and allocation ranges. The [http://www.mutek.fr MutekH] operating system is working with the Memory checker. 11 Like the [Tools/GdbServer Gdb Server], the Memory checker contains no processor-specific code and can be used to manage any Soclib processor model using the generic [Component/Iss2Api Iss2 interface]. It is implemented as an Iss wrapper class. 12 13 When the Memory checker is in use, it traces all events between the processor Iss model and the SoCLib platform. The running operating system must be instrumented slightly to let the Memory checker be aware of valid stack ranges and allocation ranges. The [http://www.mutek.fr/ MutekH] operating system is working with the Memory checker. 12 14 13 15 === What is being checked === … … 22 24 * The stack memory is marked as non-initialized when a new execution context is created. 23 25 * The stack memory is always considered as non-initialized below the stack pointer. 24 * Memory r/w accesses can not occur below the stack pointer.26 * Memory r/w accesses in stack can not occur below the stack pointer. 25 27 26 28 Memory allocation and region checks: 27 * Write accesses can not occur in read 29 * Write accesses can not occur in read-only preloaded sections. 28 30 * Preloaded sections are marked as uninitialized when appropriate. 29 31 * Memory is marked as uninitialized on `malloc()` invocation. … … 36 38 Suspicious memory accesses produce a message on simulator `stdout` stream. This simulation is not stopped though. 37 39 38 An exception can be reported to an optional GdbServer module to stop processors execution when a suspicious memory access happened. This enables further analysis of buggy software. When using the Memory checker with the GdbServer, the Memory checker must wrap the processor directly and must be wrapped in the GdbServer.40 An exception can be reported to an optional `GdbServer` module to stop processor execution when a suspicious memory access happened. This enables further analysis of buggy software. When using the Memory checker with the `GdbServer`, the Memory checker must wrap the processor directly and must be wrapped in the GdbServer. 39 41 40 42 == Usage == … … 56 58 // With Memory checker 57 59 soclib::common::Memchecker<soclib::common::Mips32ElIss>::init(maptab, loader); 58 soclib::caba::VciXcacheWrapper<soclib::common:: Memchecker<soclib::common::Mips32ElIss> > cpu0("cpu0", 0, maptab, IntTab(0), 1,8,4, 1,8,4);60 soclib::caba::VciXcacheWrapper<soclib::common::IssMemchecker<soclib::common::Mips32ElIss> > cpu0("cpu0", 0, maptab, IntTab(0), 1,8,4, 1,8,4); 59 61 }}} 60 62 … … 62 64 63 65 {{{ 64 Uses(' iss_wrapper', iss_t = 'common:memchecker_iss', memchecker_iss_t = 'common:mips32el'),66 Uses('vci_xcache_wrapper', iss_t = 'common:iss_memchecker', iss_memchecker_t = 'common:mips32el'), 65 67 }}} 66 68 67 69 === Using an instrumented operating system === 68 70 69 The running operating system must communicate with the Memory checker to report information about context creation , stack range and allocator operations. This is done through read/write accesses tospecific memory locations which are intercepted by the Memory checker and not forwarded to the rest of the platform.71 The running operating system must communicate with the Memory checker to report information about context creation (stack range), and memory-allocator operations. This is done through read/write operations in specific memory locations which are intercepted by the Memory checker and not forwarded to the rest of the platform. 70 72 71 Currently the only known supported operating system is [http://www.mutek.fr MutekH] with Mips processor. Other processors are partially supported, only memory allocation checks are performed. To use the memory checker with MutekH, simply add the `CONFIG_SOCLIB_MEMCHECK` configuration token to your configuration file.73 Currently the only known supported operating system is [http://www.mutek.fr MutekH] with Mips32 processor. Other processors are partially supported, only memory allocation checks are performed. To use the memory checker with MutekH, simply add the `CONFIG_SOCLIB_MEMCHECK` configuration token to your configuration file. 72 74 73 75 Note: