Skip to content

Instantly share code, notes, and snippets.

@pdp7
Created May 31, 2019 05:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pdp7/f12ecd9c4d84d8c7693dd4409020797d to your computer and use it in GitHub Desktop.
Save pdp7/f12ecd9c4d84d8c7693dd4409020797d to your computer and use it in GitHub Desktop.
getEngineStatus

getEngineStatus

Install and compile

wget http://downloads.yoctoproject.org/mirror/sources/i2c-tools-3.1.2.tar.bz2
tar -xvf i2c-tools-3.1.2.tar.bz2 
cd watchdog/driver/
gcc -I/home/debian/i2c-tools-3.1.2/ -o getEngineStatus ./getEngineStatus.c

Run

debian@beaglebone:~/watchdog/driver$ ./getEngineStatus 
Segmentation fault
debian@beaglebone:~/watchdog/driver$ sudo strace -f -F ./getEngineStatus 
execve("./getEngineStatus", ["./getEngineStatus"], [/* 15 vars */]) = 0
brk(NULL)                               = 0x11ec000
uname({sysname="Linux", nodename="beaglebone", ...}) = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6fc8000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=28601, ...}) = 0
mmap2(NULL, 28601, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb6fc1000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/arm-linux-gnueabihf/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\3\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\331e\1\0004\0\0\0"..., 512) = 512
lseek(3, 900076, SEEK_SET)              = 900076
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2920) = 2920
lseek(3, 896524, SEEK_SET)              = 896524
read(3, "A4\0\0\0aeabi\0\1*\0\0\0\0057-A\0\6\n\7A\10\1\t\2\n\3\f"..., 53) = 53
fstat64(3, {st_mode=S_IFREG|0755, st_size=902996, ...}) = 0
mmap2(NULL, 972112, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb6eb5000
mprotect(0xb6f8e000, 61440, PROT_NONE)  = 0
mmap2(0xb6f9d000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xd8000) = 0xb6f9d000
mmap2(0xb6fa0000, 9552, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb6fa0000
close(3)                                = 0
set_tls(0xb6fc8d70, 0xb6fc9448, 0xb6fcb050, 0xb6fc8d70, 0xb6fcb050) = 0
mprotect(0xb6f9d000, 8192, PROT_READ)   = 0
mprotect(0x472000, 4096, PROT_READ)     = 0
mprotect(0xb6fca000, 4096, PROT_READ)   = 0
munmap(0xb6fc1000, 28601)               = 0
open("/dev/i2c-0", O_RDWR)              = 3
ioctl(3, _IOC(0, 0x07, 0x03, 0x00), 0x9) = 0
ioctl(3, _IOC(0, 0x07, 0x20, 0x00), 0xbef0560c) = -1 EREMOTEIO (Remote I/O error)
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0xfffffff8} ---
+++ killed by SIGSEGV +++
Segmentation fault
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment