Skip to content

Instantly share code, notes, and snippets.

View amurzeau's full-sized avatar

Alexis Murzeau amurzeau

View GitHub Profile
@amurzeau
amurzeau / CMakeLists.txt
Created September 18, 2023 19:10
Iterate all XKB keyboard layouts and test Qt with them
cmake_minimum_required(VERSION 3.16)
project(xlibdump LANGUAGES CXX C)
add_executable(xkbdump main.cpp)
target_link_libraries(xkbdump xkbcommon xkbregistry xkbfile X11 Qt::Core Qt::XcbQpaPrivate)
@amurzeau
amurzeau / container_conversion.cpp.197t.uninit1.cpp
Created April 23, 2019 22:27
GCC maybe-uninitialized in range-v3
See line 150 for assign2.
;; Function ranges::v3::bad_variant_access::~bad_variant_access (_ZN6ranges2v318bad_variant_accessD2Ev, funcdef_no=6211, decl_uid=90493, cgraph_uid=1586, symbol_order=1718)
ranges::v3::bad_variant_access::~bad_variant_access (struct bad_variant_access * const this)
{
struct logic_error * _1;
<bb 2> [local count: 1073741825]:
@amurzeau
amurzeau / container_conversion.cpp.196t.crited1.py
Created April 22, 2019 22:18
GCC gimple dump before uninit phase (uninitialized use of .MEM_335 which is cnt_ inside counted_iterator, L325) (debian bug #926218)
;; Function ranges::v3::bad_variant_access::~bad_variant_access (_ZN6ranges2v318bad_variant_accessD2Ev, funcdef_no=6211, decl_uid=90493, cgraph_uid=1586, symbol_order=1718)
ranges::v3::bad_variant_access::~bad_variant_access (struct bad_variant_access * const this)
{
struct logic_error * _1;
<bb 2> [local count: 1073741825]:
[../include/range/v3/detail/variant.hpp:72:16] # .MEM_4 = VDEF <.MEM_2(D)>
this_3(D)->D.90508.D.26048._vptr.exception = [../include/range/v3/detail/variant.hpp:72:16] &MEM[(void *)&_ZTVN6ranges2v318bad_variant_accessE + 16B];
@amurzeau
amurzeau / gdb_stacktrace.txt
Created March 31, 2019 20:33
TLS deadlock between dl_close and __tls_get_addr
(gdb) thr a a bt
Thread 3 (Thread 0x7ff4067a4700 (LWP 1140)):
#0 __lll_lock_wait () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:103
#1 0x00007ff4071747c1 in __GI___pthread_mutex_lock (mutex=0x7ff4071ce968 <_rtld_global+2312>) at ../nptl/pthread_mutex_lock.c:115
#2 0x00007ff4071b79bf in tls_get_addr_tail (dtv=0x7ff4000015e0, the_map=0x7ff400000f90, ti=<optimized out>, ti=<optimized out>) at ../elf/dl-tls.c:761
#3 0x00007ff4071bd278 in __tls_get_addr () at ../sysdeps/x86_64/tls_get_addr.S:55
#4 0x00007ff4071a216b in thread_that_use_tls_after_sleep (arg=0x0) at test_compiler_tls_lib.c:13
#5 0x00007ff407171fa3 in start_thread (arg=<optimized out>) at pthread_create.c:486
#6 0x00007ff4070a27ef in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
@amurzeau
amurzeau / windbg.log
Created December 28, 2018 01:37
Windbg debug pending IRP on synchronous audio router at process cleanup
Microsoft (R) Windows Debugger Version 10.0.17763.1 AMD64
Copyright (c) Microsoft Corporation. All rights reserved.
Loading Dump File [C:\WINDOWS\livekd.dmp]
Kernel Complete Dump File: Full address space is available
Comment: 'LiveKD live system view'
************* Path validation summary **************
@amurzeau
amurzeau / test_compiler_tls.c
Created August 15, 2018 14:47
Test openblas use of compiler's TLS to not deadlock on dl_close
/* Build with gcc test_compiler_tls.c -o test_compiler_tls -ldl -g -pthread */
#include <dlfcn.h>
#include <stdio.h>
#include <pthread.h>
#include <time.h>
#include <sys/time.h>
#include <stdint.h>
pthread_cond_t cond;
@amurzeau
amurzeau / gimp-gdb.txt
Created August 7, 2018 22:18
gimp 2.10.2 and openblas 3.2 and glibc 2.27 deadblock
(gdb) thr a a bt
Thread 4 (Thread 0x7f727a990700 (LWP 26238)):
#0 0x00007f7283ad711c in __lll_lock_wait () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:135
#1 0x00007f7283ad06c6 in __GI___pthread_mutex_lock (mutex=0x7f7287775968 <_rtld_global+2312>) at ../nptl/pthread_mutex_lock.c:113
#2 0x00007f728775e5b7 in tls_get_addr_tail (ti=0x7f7278c2fc70, dtv=0x55edf85706b0, the_map=0x55edf8567980) at ../elf/dl-tls.c:761
#3 0x00007f7287764288 in __tls_get_addr () at ../sysdeps/x86_64/tls_get_addr.S:55
#4 0x00007f7276d86400 in get_memory_table () at memory.c:1147
#5 0x00007f7276d86400 in blas_memory_alloc (procpos=procpos@entry=2) at memory.c:1147
#6 0x00007f7276d86bbb in blas_thread_server (arg=0x2) at blas_server.c:297
import requests
from xml.etree import ElementTree
import sys
from urllib.parse import urlparse
import os
# Input is a HTTP Smooth streaming manifest URL (root XML tag is SmoothStreamingMedia)
# This script takes a XML manifest as input and output to stdout audio stream raw data
# Use like this: python3 parse_hss_audio.py http://host.com/stream.isml/Manifest
#!/bin/sh
set -x
test_program=${1:-"streamlink"}
cd ${AUTOPKGTEST_TMP:-"."}
# This test does:
# - Generate a AES-128 encrypted HLS fake stream from /dev/urandom to playlist.m3u8 and
@amurzeau
amurzeau / client.c
Created February 3, 2016 00:05
synchronous client & server to test fastpath feature
#include <winsock2.h>
#include <ws2tcpip.h>
#include <mstcpip.h>
#include <stdio.h>
#ifndef SIO_LOOPBACK_FAST_PATH
# define SIO_LOOPBACK_FAST_PATH 0x98000010
#endif
#define assertp(_Expression) \