Skip to content

Instantly share code, notes, and snippets.

=================================================================
==15827==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 183297 byte(s) in 162 object(s) allocated from:
#0 0x7fdac2803b50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
#1 0x565206b0ffa4 in _PyObject_Malloc Objects/obmalloc.c:1579
Direct leak of 576 byte(s) in 12 object(s) allocated from:
#0 0x7fdac2803b50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
=================================================================
==14557==ERROR: AddressSanitizer: heap-use-after-free on address 0x613000006cc4 at pc 0x55fa31c4f804 bp 0x7ffde1901690 sp 0x7ffde1901680
READ of size 4 at 0x613000006cc4 thread T0
#0 0x55fa31c4f803 in dict_unref /home/who/Workspace/tmp/vim/8.1.1008_lua/src/dict.c:162
#1 0x55fa3219eea2 in luaV_funcref_gc /home/who/Workspace/tmp/vim/8.1.1008_lua/src/if_lua.c:1075
#2 0x7f9f2f6fa208 (/usr/local/share/anyenv/envs/luaenv/versions/luajit-2.0.5/lib/libluajit-5.1.so.2+0x9208)
#3 0x7f9f2f706029 (/usr/local/share/anyenv/envs/luaenv/versions/luajit-2.0.5/lib/libluajit-5.1.so.2+0x15029)
#4 0x7f9f2f723305 (/usr/local/share/anyenv/envs/luaenv/versions/luajit-2.0.5/lib/libluajit-5.1.so.2+0x32305)
#5 0x7f9f2f72343e (/usr/local/share/anyenv/envs/luaenv/versions/luajit-2.0.5/lib/libluajit-5.1.so.2+0x3243e)
#6 0x7f9f2f723903 (/usr/local/share/anyenv/envs/luaenv/versions/luajit-2.0.5/lib/libluajit-5.1.so.2+0x32903)
@ichizok
ichizok / fillpid
Last active January 21, 2022 09:49
fill pid for given command
#!/usr/bin/env bash
if [[ $# -eq 0 ]]; then
args=(echo {})
else
args=("$@")
fi
filter=(${FILLPID_FILTER:-fzf})
@ichizok
ichizok / watch-rss.bash
Last active March 19, 2021 03:06
Watch VmRSS
#!/bin/bash
usage_exit() {
echo >&2 "Usage: ${0##*/} [-n interval] pid"
exit $1
}
interval=1
while getopts 'hn:' OPT; do
@ichizok
ichizok / travis-log
Last active March 11, 2020 16:48
view travis-ci log
#!/bin/bash -e
usage_exit() {
cat >&2 <<EOT
Usage: ${0##*/} [-n] [-v viewer_cmd] travis-build-url
or: ${0##*/} [-n] [-v viewer_cmd] travis-job-url
or: ${0##*/} [-n] [-v viewer_cmd] [-d (com|org)] -b travis-build-id
or: ${0##*/} [-n] [-v viewer_cmd] [-d (com|org)] -j travis-job-id
EOT
exit ${1:-0}
@ichizok
ichizok / elapsed_time.vim
Last active January 24, 2019 06:14
measure elapsed time
function s:estimate(n, t)
let start = reltime()
for _ in range(a:n)
execute 'sleep' a:t
endfor
let elapsed = reltimefloat(reltime(start))
let calibrator = (a:n * a:t * (a:t =~# 'm$' ? 1 : 1000)) / (elapsed * 1000)
echo printf('%dx sleep %s', a:n, a:t)
echo printf('Elapsed = %f', elapsed)
echo printf('Calibration = %f', calibrator)
@ichizok
ichizok / termdebug.diff
Created November 27, 2018 21:27
termdebug
--- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
+++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
@@ -73,6 +73,10 @@ let s:pc_id = 12
let s:break_id = 13 " breakpoint number is added to this
let s:stopped = 1
+function s:NR(id, subid)
+ return s:break_id + a:id * 1000 + a:subid
+endfunction
+
=================================================================
==11624==ERROR: AddressSanitizer: heap-use-after-free on address 0x6230001b21f8 at pc 0x55c7bcd562c4 bp 0x7ffefb0a3ce0 sp 0x7ffefb0a3cd0
READ of size 4 at 0x6230001b21f8 thread T0
#0 0x55c7bcd562c3 in curs_rows /home/who/trunk/vim/src/shadow/move.c:673
#1 0x55c7bcd58135 in curs_columns /home/who/trunk/vim/src/shadow/move.c:945
#2 0x55c7bcd56272 in validate_cursor /home/who/trunk/vim/src/shadow/move.c:636
#3 0x55c7bd079ce2 in main_loop /home/who/trunk/vim/src/shadow/main.c:1235
#4 0x55c7bd079540 in vim_main2 /home/who/trunk/vim/src/shadow/main.c:919
#5 0x55c7bd078b70 in main /home/who/trunk/vim/src/shadow/main.c:443
#6 0x7ff80d5d0b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
@ichizok
ichizok / chan.log
Last active March 21, 2018 17:07
test_popup.vim
==== start log session ====
0.000316 : Starting job: /tmp/vim/src/vim --clean /tmp/popup.txt
0.000569 on 0: Created channel
0.000580 on 0: using pty /dev/ttys011 on fd 5
0.001023 on 0: writing out to buffer '!/tmp/vim/src/vim --clean /tmp/popup.txt'
0.001058 on 0: writing err to buffer '!/tmp/vim/src/vim --clean /tmp/popup.txt'
0.001091 : ioctl(TIOCSWINSZ) success
0.001186 SEND on 0: ':'
0.001200 SEND on 0: 's'
0.001210 SEND on 0: 'o'
@ichizok
ichizok / anyenv.zsh
Last active February 22, 2018 02:03
anyenv
# anyenv initialization
function() {
local anyenv_root=/usr/local/share/anyenv
if [[ -d "${anyenv_root}" ]]; then
export ANYENV_ROOT=${anyenv_root}
path=(${anyenv_root}/bin $path)
local anyenv_init=${TMPDIR:-/tmp}/anyenv-init.zsh
if [[ -e "${anyenv_init}" ]]; then
source "${anyenv_init}"