Skip to content

Instantly share code, notes, and snippets.

View mertyildiran's full-sized avatar
:octocat:
Doing some octopus work

M. Mert Yildiran mertyildiran

:octocat:
Doing some octopus work
View GitHub Profile
@mertyildiran
mertyildiran / valgrind.out
Created October 9, 2020 08:24
Uninitialised value longjmp
==645472== Use of uninitialised value of size 8
==645472== at 0x11F59E: callFunction (function.c:250)
==645472== by 0x12496A: eval_node (interpreter.c:1208)
==645472== by 0x12116D: interpret (interpreter.c:35)
==645472== by 0x10E53E: yyparse (parser.y:204)
==645472== by 0x11A902: initParser (parser.c:120)
==645472== by 0x117D82: main (parser.y:854)
==645472== Uninitialised value was created by a stack allocation
==645472== at 0x490CF37: __longjmp (__longjmp.S:107)
==645472==
@mertyildiran
mertyildiran / parser.c
Created October 9, 2020 08:14
absorbError()
void absorbError() {
ast_interactive_cursor = ast_node_cursor;
phase = INIT_PROGRAM;
disable_complex_mode = false;
freeComplexModeStack();
freeLeftRightBracketStackSymbols();
resetFunctionParametersMode();
#if defined(__linux__) || defined(__APPLE__) || defined(__MACH__)
@mertyildiran
mertyildiran / parser.c
Created October 9, 2020 08:13
InteractiveShellErrorAbsorber
if (is_interactive) {
if (setjmp(InteractiveShellErrorAbsorber)) {
absorbError();
}
}
@mertyildiran
mertyildiran / function_fail2.kaos
Created October 9, 2020 08:01
Chaos error recovery test case
void def f()
bool f = true
return f
end
f()
@mertyildiran
mertyildiran / dota2_morphling_bug.txt
Created June 30, 2020 13:49
Dota 2 v7.27 - Morphling Ulti on Despawned Hero Causes a Crash
Jun 30 16:03:51 Corsair steam.desktop[19212]: ERROR: ld.so: object '/home/mertyildiran/.local/share/Steam/ubuntu12_64/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
Jun 30 16:03:51 Corsair steam.desktop[19213]: crash_20200630160159_1.dmp[19213]: Uploading dump (out-of-process)
Jun 30 16:03:51 Corsair steam.desktop[19213]: /tmp/dumps/crash_20200630160159_1.dmp
Jun 30 16:03:51 Corsair crash_20200630160159_1.dmp[19213]: Uploading dump (out-of-process)#012/tmp/dumps/crash_20200630160159_1.dmp
Jun 30 16:03:51 Corsair kernel: [13999.147639] dota2[18935]: segfault at 330 ip 00007f795b300ef0 sp 00007fffd8fbee18 error 4 in libserver.so[7f7957810000+3f42000]
Jun 30 16:03:51 Corsair kernel: [13999.147648] Code: 20 c8 74 1c 55 48 89 e5 53 89 f3 48 83 ec 08 48 8b 07 ff 50 58 3b 18 0f 9c c0 48 83 c4 08 5b 5d c3 90 90 90 90 90 90 90 90 90 <48> 8b bf 30 03 00 00 48 85 ff 74 24 55 48 8b 07 48 89 e5 ff 50 58
Jun 30 16:03:51 Corsair steam.desktop[17204]: >>> Adding process 19
@mertyildiran
mertyildiran / build.bat
Last active April 4, 2020 22:42
Mingw-w64 C dynamic linking with circular calls (without two way linkage)
gcc -Wl,--export-all-symbols main.c -o prog.exe
gcc -shared -fPIC lib.c -o lib.o
gcc -c -DBUILDING_LIB lib.c
gcc -shared -o lib.dll lib.o -Wl,--out-implib,lib.a
@mertyildiran
mertyildiran / C_tips_and_tricks.md
Last active December 25, 2019 23:44
Curated List of C Tips & Tricks

How to debug a segmentation fault?

Add -ggdb option to GCC like gcc -o chaos chaos.tab.c lex.yy.c -ggdb then:

mertyildiran@Corsair:~/Documents/chaos$ gdb
GNU gdb (Ubuntu 8.1-0ubuntu3.2) 8.1.0.20180409-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
@mertyildiran
mertyildiran / History|-1081b28b|entries.json
Last active May 12, 2022 22:26
Visual Studio Code Settings Sync Gist
{"version":1,"resource":"file:///home/mertyildiran/Documents/up9/mizu/cli/apiserver/provider.go","entries":[{"id":"0ieb.go","source":"searchReplace.source","timestamp":1651055136119}]}
@mertyildiran
mertyildiran / .tmux.conf
Last active April 10, 2019 10:28
tmux configuration
# cat << EOF > /dev/null
# https://github.com/gpakosz/.tmux
# (‑●‑●)> dual licensed under the WTFPL v2 license and the MIT license,
# without any warranty.
# Copyright 2012— Gregory Pakosz (@gpakosz).
# /!\ do not edit this file
# instead, override settings in ~/.tmux.conf.local, see README.md
# -- general -------------------------------------------------------------------
@mertyildiran
mertyildiran / init.toml
Last active September 30, 2022 12:46
SpaceVim settings ~/.SpaceVim.d/init.toml
#=============================================================================
# dark_powered.toml --- dark powered configuration example for SpaceVim
# Copyright (c) 2016-2017 Wang Shidong & Contributors
# Author: Wang Shidong < wsdjeg at 163.com >
# URL: https://spacevim.org
# License: GPLv3
#=============================================================================
# All SpaceVim option below [option] section
[options]