Skip to content

Instantly share code, notes, and snippets.

View dicej's full-sized avatar

Joel Dice dicej

  • Denver, Colorado
View GitHub Profile
@dicej
dicej / gist:7c11c8f27b3a34ffc3ad
Created June 30, 2014 15:03
attempt to use CaptureStackBackTrace for lightweight crash reporting
diff --git a/src/system/windows/signal.cpp b/src/system/windows/signal.cpp
index 23d57b9..0114474 100644
--- a/src/system/windows/signal.cpp
+++ b/src/system/windows/signal.cpp
@@ -90,6 +90,24 @@ struct MINIDUMP_EXCEPTION_INFORMATION {
LPEXCEPTION_POINTERS exception;
BOOL exceptionInCurrentAddressSpace;
};
+
+struct SYMBOL_INFO {
#!/bin/sh
# remove all current rules
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
# drop all incoming traffic by default
iptables -P INPUT DROP
@dicej
dicej / resource.rs
Last active January 12, 2023 09:49
use futures::{
future::{Future, IntoFuture},
sync::oneshot,
};
use std::{
collections::VecDeque,
sync::{Arc, Mutex},
};
struct Inner<T> {
@dicej
dicej / type-systems.txt
Last active March 30, 2024 07:34
Type system learning notes
Classes
* Keith Devlin - Introduction to Mathematical Thinking - https://www.coursera.org/learn/mathematical-thinking
* Michael Genesereth - Introduction to Logic - https://www.coursera.org/learn/logic-introduction
* Robert Harper - Homotopy Type Theory - http://www.cs.cmu.edu/~rwh/courses/hott/
Books and Articles
* Benjamin C. Pierce - Types and Programming Languages - https://www.cis.upenn.edu/~bcpierce/tapl/
* x775 - Introduction to Datalog - https://x775.net/2019/03/18/Introduction-to-Datalog.html
* Bartosz Milewski - Category Theory For Programmers - https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers-the-preface/
* Benjamin C. Pierce et al. - Software Foundations - https://softwarefoundations.cis.upenn.edu/
@dicej
dicej / log.txt
Created June 12, 2024 16:40
bash build.sh clr.aot+libs -c Debug -a wasm -os wasi 2>&1 |tee log.txt
Determining projects to restore...
Tool 'coverlet.console' (version '6.0.0') was restored. Available commands: coverlet
Tool 'dotnet-reportgenerator-globaltool' (version '5.3.0') was restored. Available commands: reportgenerator
Tool 'microsoft.dotnet.xharness.cli' (version '9.0.0-prerelease.24266.1') was restored. Available commands: xharness
Tool 'microsoft.visualstudio.slngen.tool' (version '11.1.0') was restored. Available commands: slngen
Restore was successful.
Restored /home/dicej/.nuget/packages/microsoft.dotnet.arcade.sdk/9.0.0-beta.24266.1/tools/Tools.proj (in 99 ms).
Determining projects to restore...
Restored /home/dicej/p/runtimelab/src/native/managed/compile-native.proj (in 101 ms).
@dicej
dicej / log.txt
Created June 26, 2024 16:19
System.Net.Http.Functional.Tests.wasm output
$ WASMTIME_BACKTRACE_DETAILS=1 wasmtime run -S http /home/dicej/p/runtimelab/artifacts/bin/System.Net.Http.Functional.Tests/Release/net9.0-wasi/publish/System.Net.Http.Functional.Tests.wasm
Using threadless Xunit runner
Unhandled exception. System.IO.FileNotFoundException: Cannot load assembly 'System.Net.Http.Functional, Version=0.0.0.0'. No metadata found for this assembly.
Error: failed to run main module `/home/dicej/p/runtimelab/artifacts/bin/System.Net.Http.Functional.Tests/Release/net9.0-wasi/publish/System.Net.Http.Functional.Tests.wasm`
Caused by:
0: failed to invoke `run` function
1: error while executing at wasm backtrace:
0: 0x2389e53 - abort
@dicej
dicej / log.txt
Created June 26, 2024 17:56
more .net output
$ (cd ~/p/runtimelab/src/libraries/System.Net.Http/tests/FunctionalTests/ && dotnet build System.Net.Http.Functional.Tests.csproj /p:TestNativeAot=true /p:TargetArchitecture=wasm /p:TargetOS=wasi -c Release -f net9.0-wasi) && WASMTIME_BACKTRACE_DETAILS=1 wasmtime run -S http /home/dicej/p/runtimelab/artifacts/bin/System.Net.Http.Functional.Tests/Release/net9.0-wasi/publish/System.Net.Http.Functional.Tests.wasm
Determining projects to restore...
Restored /home/dicej/p/runtimelab/src/tools/illink/src/linker/ref/Mono.Linker.csproj (in 110 ms).
Restored /home/dicej/p/runtimelab/src/coreclr/tools/aot/ILCompiler.DependencyAnalysisFramework/ILCompiler.DependencyAnalysisFramework.csproj (in 114 ms).
Restored /home/dicej/p/runtimelab/src/libraries/System.DirectoryServices.Protocols/ref/System.DirectoryServices.Protocols.csproj (in 110 ms).
Restored /home/dicej/p/runtimelab/src/libraries/Common/tests/StreamConformanceTests/StreamConformanceTests.csproj (in 3 ms).
Restored /home/dicej/p/runtimelab/src/tool
@dicej
dicej / log.txt
Last active June 27, 2024 16:25
System.Net.Http functional tests on WASI: backtrace
#0 0x0000fffe0591a948 in S_P_CoreLib_System_Runtime_EH__RhpThrowEx (exception=...)
#1 0x0000fffdfcbe662c in S_P_CoreLib_System_Reflection_Runtime_Assemblies_RuntimeAssemblyInfo__GetRuntimeAssembly (
assemblyRefName=...)
#2 0x0000fffe060785f0 in S_P_CoreLib_System_Reflection_Runtime_General_ReflectionCoreCallbacksImplementation__Load (
this=..., assemblyRef=..., throwOnFileNotFound=<optimized out>)
#3 0x0000fffe05a1d4c4 in S_P_CoreLib_System_Reflection_Assembly__Load (assemblyRef=...)
#4 0x0000fffdfc25e910 in xunit_execution_dotnet_Xunit_Sdk_ReflectionAssemblyInfo___ctor_0 (this=...,
assemblyFileName=...)
#5 0x0000fffdfc10f7fc in Internal_CompilerGenerated__Module___<DynamicInvoke>None<S_P_CoreLib_System_Void__Object> (
var0=<optimized out>, var1=<optimized out>, var2=<optimized out>, var3=<optimized out>, var4=<optimized out>)
@dicej
dicej / log.txt
Created June 27, 2024 22:59
infinite wait in `System.Net.Http.Functional.Tests` on WASI
#0 0x0000fffe0b05764c in S_P_CoreLib_Interop_Sys__LowLevelMonitor_Wait (var0=<optimized out>, var1=<optimized out>) at .tmp8dNCCP.wasm:14100932
#1 0x0000fffe14464950 in S_P_CoreLib_System_Threading_LowLevelMonitor__WaitCore (this=<error reading variable: Cannot access memory at address 0x20e84>)
#2 0x0000fffe0c342a40 in S_P_CoreLib_System_Threading_LowLevelMonitor__Wait (this=<error reading variable: Cannot access memory at address 0x20e84>)
#3 0x0000fffe140e4b48 in S_P_CoreLib_System_Threading_WaitSubsystem_ThreadWaitInfo__Wait (this=<error reading variable: Cannot access memory at address 0x20e84>,
timeoutMilliseconds=<error reading variable: Cannot access memory at address 0x20e84>, interruptible=<error reading variable: Cannot access memory at address 0x20e84>,
isSleep=<error reading variable: Cannot access memory at address 0x20e84>, lockHolder=<error reading variable: Cannot access memory at address 0x20e84>)
#4 0x0000fffe0d7bf2ec in S_P_CoreLib_System_Threading_WaitSubsystem_WaitableObject