Skip to content

Instantly share code, notes, and snippets.

@db7
db7 / .work.log
Created March 25, 2025 12:44
work log when building presenterm on macOS
[*] cc -arch arm64 /var/folders/rf/26wr04kd51q32kpr18dn6fd00000gn/T/rustcwHXQDn/symbols.o /usr/local/pkgsrc/wip/presenterm/work/presenterm-0.12.0/target/release/build/proc-macro2-797aa2d62d54a68a/build_script_build-797aa2d62d54a68a.build_script_build.d94884a6ee4412e6-cgu.0.rcgu.o /usr/local/pkgsrc/wip/presenterm/work/presenterm-0.12.0/target/release/build/proc-macro2-797aa2d62d54a68a/build_script_build-797aa2d62d54a68a.build_script_build.d94884a6ee4412e6-cgu.1.rcgu.o /usr/local/pkgsrc/wip/presenterm/work/presenterm-0.12.0/target/release/build/proc-macro2-797aa2d62d54a68a/build_script_build-797aa2d62d54a68a.ascfr1v8ivryw0x7zg1y4q6bj.rcgu.o -L /usr/local/pkgsrc/wip/presenterm/work/presenterm-0.12.0/target/release/deps -L /opt/pkg/lib/rustlib/aarch64-apple-darwin/lib /opt/pkg/lib/rustlib/aarch64-apple-darwin/lib/libstd-6384b6267029754f.rlib /opt/pkg/lib/rustlib/aarch64-apple-darwin/lib/libpanic_unwind-8e5d830d012f222c.rlib /opt/pkg/lib/rustlib/aarch64-apple-darwin/lib/libobject-d6c795abaf79e8b6.rlib /opt/pkg/lib
@db7
db7 / error.log
Created March 25, 2025 12:38
Error: missing sixel library
Compiling hex v0.4.3
error: linking with `cc` failed: exit status: 1
|
= note: env -u IPHONEOS_DEPLOYMENT_TARGET -u TVOS_DEPLOYMENT_TARGET -u XROS_DEPLOYMENT_TARGET LC_ALL="C" PATH="/opt/pkg/lib/rustlib/aarch64-apple-darwin/bin:/opt/pkg/lib/rustlib/aarch64-apple-darwin/bin:/opt/pkg/lib/rustlib/aarch64-apple-darwin/bin:/usr/local/pkgsrc/wip/presenterm/work/.cwrapper/bin:/usr/local/pkgsrc/wip/presenterm/work/.buildlink/bin:/usr/local/pkgsrc/wip/presenterm/work/.tools/bin:/opt/pkg/bin:/bin:/Users/diogo/go/bin:/Users/diogo/Dots/scripts:/Users/diogo/.local/bin:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/bin:/opt/pkg/bin:/opt/pkg/sbin:/opt/pkg/go118/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/pkg/sbin:/opt/pkg/bin:/Users/diogo/go/bin:/Users/
@db7
db7 / ck_sequence_test.c
Created February 10, 2022 14:11
genmc -imm crashes with segfaul.
/*
* Copyright 2011-2015 Samy Al Bahra.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
@db7
db7 / buf_ring_test.c
Created February 7, 2022 20:26
Bugs in GenMC with FreeBSD buf_ring
/*******************************************************************************
* Tests with FreeBSD 8.0.0 buf_ring.h
* The buf_ring has been slightly modified, this is only for testing GenMC.
* See problems below.
******************************************************************************/
#include <pthread.h>
#include <assert.h>
#include <stdint.h>
#include <stdlib.h>
#include <genmc.h>
@db7
db7 / mcslock.c
Last active February 1, 2022 09:31
await-while cases
#include <pthread.h>
#include <stddef.h>
#include <stdbool.h>
#include <assert.h>
#include <lkmm.h>
#include <genmc.h>
#if 1
// genmc -mo -lkmm -check-liveness mcslock.c
#define await_while while
@db7
db7 / genmc-lkmm-race.c
Last active January 24, 2022 12:48
Is this a false positive?
// run: genmc -mo -lkmm genmc-lkmm-race.c
#include <pthread.h>
#include <lkmm.h>
int spin;
int lock;
void* run1(void *arg)
{
spin = 0;
@db7
db7 / mcs-check.c
Last active December 9, 2021 12:04
GenMC issue with mcs_spinlock.h from Linux 5.14
/*******************************************************************************
Step 1 -- Download mcs_spinlock.h, version 5.14 (and do 2 small changes):
curl -o mcs_spinlock.h https://raw.githubusercontent.com/torvalds/linux/v5.14/kernel/locking/mcs_spinlock.h
sed -i 's/#include/\/\/#include/g' mcs_spinlock.h
sed -i 's/\twhile/\tawait_while/g' mcs_spinlock.h
Step 2 -- Reproduce problem:
@db7
db7 / tso-test.c
Last active May 28, 2021 06:20
Test if TSO is correctly enabled with TSOEnabler
/*******************************************************************************
* Compile and run:
* gcc -DTSO=1 -o tso-test tso-test.c -lpthread && ./tso-test
* gcc -DTSO=0 -o tso-test tso-test.c -lpthread && ./tso-test
*
* With TSO=0 the assertion should fail.
*
* Requires TSOEnabler: https://github.com/saagarjha/TSOEnabler
******************************************************************************/
#include <stdatomic.h>
@db7
db7 / main.go
Created June 20, 2019 10:44
Use view to initialize and update a data structure.
package main
import (
"context"
"log"
"sync"
"time"
"github.com/lovoo/goka"
"github.com/lovoo/goka/codec"