Skip to content

Instantly share code, notes, and snippets.

View zzeroo's full-sized avatar
💤
zzeroo...

zzeroo zzeroo

💤
zzeroo...
View GitHub Profile
@zzeroo
zzeroo / log.do_compile
Created February 14, 2017 10:26
backtrace-sys crosscompile errror log
DEBUG: Executing shell function do_compile
NOTE: which rustc: /home/smueller/.cargo/bin/rustc
NOTE: rustc --version rustc 1.17.0-nightly (c49d10207 2017-02-07)
NOTE: which cargo: /home/smueller/.cargo/bin/cargo
NOTE: cargo --version cargo-0.18.0-nightly (de2919f 2017-02-06)
NOTE: cargo build --verbose --manifest-path /mnt/src/poky/build/tmp/work/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/xmz-mod-touch-server/0.21.4-r9/git/Cargo.toml --target=armv7-unknown-linux-gnueabihf --release
Updating registry `https://github.com/rust-lang/crates.io-index`
Updating git repository `https://github.com/zzeroo/libmodbus-rs.git`
Downloading rand v0.3.15
Downloading sysfs_gpio v0.4.4
@zzeroo
zzeroo / print_macro_in_loop.rs
Created March 17, 2017 10:51
Why does print!() not work in a loop?
fn main() {
loop {
print!(".");
::std::thread::sleep(::std::time::Duration::from_millis(1000));
}
}
@zzeroo
zzeroo / radiobutton.rs
Created April 16, 2017 11:35
gtk-rs RadioButton example
//! # RadioButton Sample
//!
//! This sample demonstrates how to create ToggleButton's and how the first parameter works
#![crate_type = "bin"]
extern crate gtk;
use gtk::prelude::*;
@zzeroo
zzeroo / bindings.rs
Created May 8, 2017 14:28
libmodbus-rs bindungs.rs
/* automatically generated by rust-bindgen */
#[repr(C)]
pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
impl <T> __BindgenUnionField<T> {
#[inline]
pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) }
#[inline]
pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) }
#[inline]
@zzeroo
zzeroo / gdb.log
Created May 8, 2017 16:15
gdb output segfault
Starting program: /var/src/Rust/libmodbus-rs/target/debug/examples/test-receive-segfault
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Program received signal SIGABRT, Aborted.
0x00007ffff701da10 in raise () from /usr/lib/libc.so.6
#0 0x00007ffff701da10 in raise () from /usr/lib/libc.so.6
#1 0x00007ffff701f13a in abort () from /usr/lib/libc.so.6
#2 0x00007ffff705c2b0 in __libc_message () from /usr/lib/libc.so.6
#3 0x00007ffff70e7407 in __fortify_fail () from /usr/lib/libc.so.6
@zzeroo
zzeroo / rust-backtrace-receive-segfault.log
Created May 8, 2017 16:26
rust backtrace libmodbus receive segfault
*** buffer overflow detected ***: target/debug/examples/test-receive-segfault terminated
======= Backtrace: =========
/usr/lib/libc.so.6(+0x722ab)[0x7f8698ef22ab]
/usr/lib/libc.so.6(__fortify_fail+0x37)[0x7f8698f7d407]
/usr/lib/libc.so.6(+0xfb330)[0x7f8698f7b330]
/usr/lib/libc.so.6(+0xfd34a)[0x7f8698f7d34a]
/usr/lib/libmodbus.so.5(_modbus_receive_msg+0x6b)[0x7f8699a691fb]
target/debug/examples/test-receive-segfault(+0xa9ea)[0x5637f3ace9ea]
target/debug/examples/test-receive-segfault(+0x96d7)[0x5637f3acd6d7]
target/debug/examples/test-receive-segfault(+0x2e61b)[0x5637f3af261b]
/// 256 u16 values
pub const SIMMULATION_STATIC: &[u16] = &[0, 14, 0, 247, 0, 0, 0, 0, 0, 0, 1, 923, 0, 30, 920, 564, 0, 20, 1, 0, 2, 107, 0, 300, 112, 760, 0, 270, 1, 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, 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, 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, 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, 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, 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, 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, 0, 0, 0];
#[derive(Debug,PartialEq,Eq)]
pub struct ModbusData {
@zzeroo
zzeroo / log.do_compile
Created May 16, 2017 20:33
error: could not execute process `rustc -vV` (never executed)
DEBUG: Executing shell function do_compile
NOTE: which rustc:
NOTE: rustc --version
NOTE: which cargo: /var/src/poky/build/tmp/work/armv7ahf-neon-vfpv4-poky-linux-gnueabi/hello-world-rs/1.0+gitAUTOINC+12dae1d3e6-r4/recipe-sysroot-native/usr/bin/cargo
NOTE: cargo --version cargo-0.17.0-nightly (f9e5481 2017-03-03)
NOTE: cargo build --verbose --manifest-path /var/src/poky/build/tmp/work/armv7ahf-neon-vfpv4-poky-linux-gnueabi/hello-world-rs/1.0+gitAUTOINC+12dae1d3e6-r4/git/Cargo.toml --target=armv7-unknown-linux-gnueabihf --release
which: no rustc in (/var/src/poky/build/tmp/sysroots-uninative/x86_64-linux/usr/bin:/home/smueller/src/poky/scripts:/var/src/poky/build/tmp/work/armv7ahf-neon-vfpv4-poky-linux-gnueabi/hello-world-rs/1.0+gitAUTOINC+12dae1d3e6-r4/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi:/var/src/poky/build/tmp/work/armv7ahf-neon-vfpv4-poky-linux-gnueabi/hello-world-rs/1.0+gitAUTOINC+12dae1d3e6-r4/recipe-sysroot/usr/bin/crossscripts:/var/src/poky/build/tmp/work/armv7ahf-neon-vfpv4-poky-linux-
@zzeroo
zzeroo / linux-yocto-bananapro_4.6.bb
Created May 17, 2017 05:40
kgit-s2q: command not found
inherit kernel
require recipes-kernel/linux/linux-yocto.inc
# Override SRC_URI in a copy of this recipe to point at a different source
# tree if you do not want to build from Linus' tree.
SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git;protocol=git;name=machine"
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI += "file://defconfig"
SRC_URI += "file://0001-lcd.patch"
SRC_URI += "file://0002-led.patch"
ERROR: sizeof(size_t) doesn't match GLIB_SIZEOF_SIZE_T.
You probably need to set PKG_CONFIG_LIBDIR
to point to the right pkg-config files for your
build target