Skip to content

Instantly share code, notes, and snippets.

View faern's full-sized avatar
🦀
impl Programmer for Faern {}

Linus Färnstrand faern

🦀
impl Programmer for Faern {}
View GitHub Profile
---- [debuginfo-both] debuginfo/empty-string.rs stdout ---- [4/1820]
NOTE: compiletest thinks it is using GDB with native rust support
NOTE: compiletest thinks it is using GDB version 7012000
error: line not found in debugger output: $2 = ""
status: exit code: 0
command: "/usr/bin/gdb" "-quiet" "-batch" "-nx" "-command=/build/rust/build/x86_64-unknown-linux-gnu/test/debuginfo/empty-string/empty-string.debugger.script"
stdout:
------------------------------------------
GNU gdb (Debian 7.12-6) 7.12.0.20161007-git
use parking_lot::{Mutex, Condvar}; // 0.7.1
use std::{thread, sync::Arc, time::Duration};
fn main() {
let locks = Arc::new((Mutex::new(()), Condvar::new()));
for i in 0..4 {
let locks = locks.clone();
let t = thread::spawn(move || {
let mut guard = locks.0.lock();
Data ownership: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=551269db7f2d8136b59b801737572135
Strings: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=fb882ef6662007305b0fcbc28228c80d
Traits: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=302f8c647a75f9841e77f9f518f7a094
Error handling: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=c9920fa0478c922a3419a3cfd9f26337
@faern
faern / nft-rule-add.c
Created February 15, 2018 13:08
Adding an invalid rule to nftables that makes nft segfault
/*
* (C) 2012 by Pablo Neira Ayuso <pablo@netfilter.org>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This software has been sponsored by Sophos Astaro <http://www.sophos.com>
*/
@faern
faern / gist:3e4c1e7dff7977a83a85
Created March 17, 2015 20:09
RLIMIT_* constants on OS X 10.10.2
/*
* Possible values of the first parameter to getrlimit()/setrlimit(), to
* indicate for which resource the operation is being performed.
*/
#define RLIMIT_CPU 0 /* cpu time per process */
#define RLIMIT_FSIZE 1 /* file size */
#define RLIMIT_DATA 2 /* data segment size */
#define RLIMIT_STACK 3 /* stack size */
#define RLIMIT_CORE 4 /* core file size */
#define RLIMIT_AS 5 /* address space (resident set size) */