Skip to content

Instantly share code, notes, and snippets.

@gjasny
gjasny / Verbose test output
Created October 8, 2023 11:23
c-ares GetHostByNameParallelLookups failure
$ strace -f -ttt -e trace=network -o trace.txt ./test/arestest --gtest_filter=AddressFamilies/MockUDPMaxQueriesTest.GetHostByNameParallelLookups/0 -v
Note: Google Test filter = AddressFamilies/MockUDPMaxQueriesTest.GetHostByNameParallelLookups/0
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from AddressFamilies/MockUDPMaxQueriesTest
[ RUN ] AddressFamilies/MockUDPMaxQueriesTest.GetHostByNameParallelLookups/0
Configured IPv4 mock server with TCP socket 3 on port 43561 and UDP socket 4 on port 44954
Configured library with servers: 127.0.0.1:44954
SocketConnectCallback(5) invoked
SocketConnectCallback(6) invoked
@gjasny
gjasny / ProxygenTestCase.cpp
Created May 27, 2021 12:29
MSVS miscompile
#include <memory>
#include <string>
#include <functional>
#include <type_traits>
// 1 parameter
template <class IUser, class Param1> class Command_1p {
public:
typedef void (IUser::* MemberFunctionType)(Param1);
Command_1p(MemberFunctionType pMemberFunction, Param1 p1)
@gjasny
gjasny / reproducer.txt
Created February 26, 2021 11:18
Ubuntu Hirsute bug
$ docker run -ti ubuntu:hirsute bash
root@008ec583a743:/# apt update
root@008ec583a743:/# sh -c 'if [ -x /usr/bin/true ]; then echo yes; else echo no; fi'
yes
root@008ec583a743:/# apt install -y nano # or any other package
root@008ec583a743:/# sh -c 'if [ -x /usr/bin/true ]; then echo yes; else echo no; fi'
no
root@008ec583a743:/# if [ -x /usr/bin/true ]; then echo yes; else echo no; fi
yes
@gjasny
gjasny / Dockerfile
Created March 20, 2020 09:52
Debug link issue in prometheus-cpp c06e0ef4e46a4770faa10210d41974df1fa12941
FROM ubuntu:18.04
RUN apt-get update
RUN apt-get install -y build-essential git libssl-dev libcurl4-openssl-dev curl tar zlib1g-dev
RUN curl -SLO https://cmake.org/files/v3.12/cmake-3.12.3-Linux-x86_64.tar.gz
RUN tar zxvf cmake-3.12.3-Linux-x86_64.tar.gz
RUN git clone https://github.com/jupp0r/prometheus-cpp.git
RUN cd prometheus-cpp && git submodule update --init
@gjasny
gjasny / node.csv
Last active January 16, 2018 11:55
Supporting files to debug hanging Yarn
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 3.
"5:45:50.3818990 AM","node.exe","4948","Process Profiling","","SUCCESS","User Time: 13.1250000 seconds, Kernel Time: 5.2187500 seconds, Private Bytes: 48,963,584, Working Set: 32,174,080"
"5:45:50.4116636 AM","node.exe","4948","CreateFile","C:\Users\bambooagent\.cache\yarn\v1\npm-npm-5.6.0-b11e72cd5167df48b06c43474e9331fe848cb05e\node_modules\pacote\node_modules\make-fetch-happen\node_modules\http-proxy-agent\node_modules\agent-base\node_modules\es6-promisify\node_modules\es6-promise\dist\es6-promise.auto.min.map","DELETE PENDING","Desired Access: Read Attributes, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Open Reparse Point, Disallow Exclusive, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a"
"5:45:50.4118505 AM","node.exe","4948","QueryOpen","C:\Users\bambooagent\.cache\yarn\v1\npm-npm-5.6.0-b11e72cd5167df48b06c43474e9331fe848cb05e\node_modules\pacote\node_modules\make-fetch-happen\node_modules\http-proxy-agent\node_modules\agent-base\node_modules\es6-promisify\n
@gjasny
gjasny / testcase.bat
Last active January 4, 2018 13:50
cl.exe long file name issues
@ECHO OFF
SET WORKDIR=C:\Temp
::SET DIR=short
:: 64 + 64 + 64 + 64
SET DIR=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
CD /D %WORKDIR%
MKDIR %DIR%
@gjasny
gjasny / build-boost-for-android.sh
Created September 7, 2017 14:00 — forked from enh/build-boost-for-android.sh
Shell script to build boost for Android
#!/bin/bash
version=1.64.0
echo "Building boost $version..."
set -eu
toolchain=$PWD/toolchain
if [ ! -d "$toolchain" ]; then
echo "Building toolchain..."
@gjasny
gjasny / OpenWithSublimeText3.bat
Created September 4, 2017 07:33 — forked from roundand/OpenWithSublimeText3.bat
Open folders and files with Sublime Text 3 from windows explorer context menu (tested in Windows 7)
@echo off
SET st3Path=C:\Program Files\Sublime Text 3\sublime_text.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st3Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st3Path% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@gjasny
gjasny / gist:04463e481d9b14e81c08d0fa3b9071af
Last active August 20, 2017 18:58
reSIProcate OpenSSL 1.1 interdiff
diff --git a/reflow/dtls_wrapper/bf_dwrap.c b/reflow/dtls_wrapper/bf_dwrap.c
index 7bcad1ff2..d79c19137 100644
--- a/reflow/dtls_wrapper/bf_dwrap.c
+++ b/reflow/dtls_wrapper/bf_dwrap.c
@@ -7,9 +7,38 @@
#include <stdio.h>
#include <errno.h>
#include <openssl/bio.h>
+#include <openssl/opensslv.h>
#include "rutil/ResipAssert.h"
@gjasny
gjasny / testcase.cpp
Created January 22, 2014 07:12
Intel Compiler Crash
#include <iostream>
struct InterfaceA {
virtual void foo() = 0;
};
struct InterfaceB {
virtual void bar() = 0;
};