Skip to content

Instantly share code, notes, and snippets.

View mszabo-wikia's full-sized avatar

Máté Szabó mszabo-wikia

View GitHub Profile
(gdb) info threads
Id Target Id Frame
* 1 Thread 0x7f7b4cce1e00 (LWP 211878) "mcrouter" syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
2 Thread 0x7f7b43fff6c0 (LWP 211882) "mcr-cpuaux-0" syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
3 Thread 0x7f7b49e0a6c0 (LWP 211879) "IOThreadPool0" syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
(gdb) thread 1
[Switching to thread 1 (Thread 0x7f7b4cce1e00 (LWP 211878))]
#0 syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
38 cmpq $-4095, %rax /* Check %rax for error. */
(gdb) bt
@mszabo-wikia
mszabo-wikia / ExcimerPyroscopeIntegration.php
Last active February 4, 2024 14:43
Proof-of-concept Excimer integration with Pyroscope
<?php
/**
* Copyright 2024 Máté Szabó
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
/usr/src/php/Zend/zend_alloc.c:1255:31: runtime error: member access within misaligned address 0x7f49b9cd523f for type 'struct zend_mm_free_slot', which requires 8 byte alignment
0x7f49b9cd523f: note: pointer points here
00 00 00 00 00 70 52 cd b9 49 7f 00 00 01 00 00 00 08 03 00 00 2d 01 00 00 00 00 00 00 00 7e 02
^
/usr/src/php/Zend/zend_string.h:146:2: runtime error: member access within misaligned address 0x7f49b9cd523f for type 'struct zend_string', which requires 8 byte alignment
0x7f49b9cd523f: note: pointer points here
00 00 00 00 00 70 52 cd b9 49 7f 00 00 01 00 00 00 08 03 00 00 2d 01 00 00 00 00 00 00 00 7e 02
^
/usr/src/php/Zend/zend_types.h:1155:14: runtime error: member access within misaligned address 0x7f49b9cd523f for type 'struct zend_refcounted_h', which requires 4 byte alignment
0x7f49b9cd523f: note: pointer points here
(gdb) bt
#0 zend_mm_alloc_small (bin_num=3, heap=0x7f8213800040) at /usr/src/php/Zend/zend_alloc.c:1255
#1 zend_mm_alloc_heap (size=<optimized out>, heap=0x7f8213800040) at /usr/src/php/Zend/zend_alloc.c:1326
#2 _emalloc (size=<optimized out>) at /usr/src/php/Zend/zend_alloc.c:2540
#3 0x000056315a2b0188 in zend_string_alloc (persistent=false, len=6) at /usr/src/php/Zend/zend_string.h:144
#4 zend_string_init (persistent=false, len=6, str=0x7f81e1ff1fb7 "Jeroen\\") at /usr/src/php/Zend/zend_string.h:166
#5 php_trim_int (mode=2, what_len=<optimized out>, what=<optimized out>, str=<optimized out>)
at /usr/src/php/ext/standard/string.c:824
#6 php_do_trim (mode=2, return_value=0x7f8213814bf0, execute_data=<optimized out>) at /usr/src/php/ext/standard/string.c:855
#7 zif_rtrim (execute_data=<optimized out>, return_value=0x7f8213814bf0) at /usr/src/php/ext/standard/string.c:869
@mszabo-wikia
mszabo-wikia / gist:0024c91b0b3661117b61eca8977532b1
Created November 1, 2022 22:22
how to normalize jitted PHP stack traces
sed -E 's/TRACE-[0-9]+\$([^\$]+)\$[0-9]+/\1/g'
@mszabo-wikia
mszabo-wikia / day6.rs
Created December 7, 2021 02:40
AoC 2021 Day 6
use std::io;
use std::str::FromStr;
const FISH_REPRODUCTION_CYCLE: usize = 7;
const FISH_INCUBATION_PERIOD: usize = 9;
fn calc_fish_pop(fish_pop: &Vec<u32>, max_days: usize) {
let mut fish_by_day: [u64; FISH_REPRODUCTION_CYCLE] = [0; FISH_REPRODUCTION_CYCLE];
let mut total_fish_count: u64 = 0;
@mszabo-wikia
mszabo-wikia / baseline_twemproxy.txt
Last active September 24, 2020 17:59
mcrouter initial benchmarks
echo 'GET http://finalfantasy.sandbox-sres1.fandom.com/wiki/Special:RecentChanges?hidebots=1&limit=500&days=90&enhanced=1&urlversion=2' | vegeta attack -rate=1/s -proxy-header=border.service.sjc.consul:80 -duration=200s | vegeta report
Requests [total, rate, throughput] 200, 1.01, 1.00
Duration [total, attack, wait] 3m20s, 3m19s, 817.895ms
Latencies [min, mean, 50, 90, 95, 99, max] 131.724ms, 1.33s, 148.657ms, 4.263s, 5.103s, 5.523s, 5.592s
Bytes In [total, mean] 323323544, 1616617.72
Bytes Out [total, mean] 0, 0.00
Success [ratio] 100.00%
Status Codes [code:count] 200:200
Error Set:
@mszabo-wikia
mszabo-wikia / smw_test_notices.txt
Created September 19, 2019 22:27
Stacktrace of all PHP Notices in SMW tests on PHP 7.4
This file has been truncated, but you can view the full file.
SMW\Tests\DIPropertyTest::testCanConstruct with data set #0 (0)
Trying to access array offset on value of type int
/usr/src/myapp/extensions/SemanticMediaWiki/includes/dataitems/SMW_DI_Property.php:88
/usr/src/myapp/extensions/SemanticMediaWiki/tests/phpunit/includes/dataitems/DIPropertyTest.php:37
/usr/src/myapp/maintenance/doMaintenance.php:99
SMW\Tests\DIPropertyTest::testCanConstruct with data set #1 (243.35353000000001)
Trying to access array offset on value of type float
/usr/src/myapp/extensions/SemanticMediaWiki/includes/dataitems/SMW_DI_Property.php:88
UnexpectedValueException from line 282 of /workspace/src/includes/db/MWLBFactory.php: $wgDBprefix is set to 'unittest_' but the database type is 'postgres'. MediaWiki does not support using a table prefix with this RDBMS type.
23:54:10 Backtrace:
23:54:10 #0 /workspace/src/includes/db/MWLBFactory.php(267): MWLBFactory::reportIfPrefixSet(string, string)
23:54:10 #1 /workspace/src/includes/db/MWLBFactory.php(156): MWLBFactory::assertValidServerConfigs(array, string, string)
23:54:10 #2 /workspace/src/includes/ServiceWiring.php(190): MWLBFactory::applyDefaultConfig(array, MediaWiki\Config\ServiceOptions, ConfiguredReadOnlyMode, APCUBagOStuff, HashBagOStuff, WANObjectCache)
23:54:10 #3 /workspace/src/includes/libs/services/ServiceContainer.php(442): Wikimedia\Services\ServiceContainer->{closure}(MediaWiki\MediaWikiServices)
23:54:10 #4 /workspace/src/includes/libs/services/ServiceContainer.php(421): Wikimedia\Services\ServiceContainer->createService(string)
23:54:10 #5 /workspace/src/includes/MediaWikiServices.ph
@mszabo-wikia
mszabo-wikia / kubekurwa.sh
Last active February 2, 2021 02:32
like gitkurwa, but for k8s ☸️
#!/bin/bash
if [[ -z "$1" ]] || [[ -z "$2" ]]; then
echo "usage: kubekurwa [context] [command] [...arguments]"
exit 1
fi
CONTEXT=kube-$1
COMMAND=$2