Skip to content

Instantly share code, notes, and snippets.

View zetok's full-sized avatar

zetok

  • tox:29AE62F95C56063D833024B1CB5C2140DC4AEB94A80FF4596CACC460D7BAA062E0A92C3424A0
View GitHub Profile
@zetok
zetok / Program.cs
Last active August 29, 2015 21:44 — forked from alexbakker/Program.cs
Bootstrapinfo example
using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
namespace BootstrapCheck
{
class Program
{
static int tries = 5;
cat ~/Documents/qtox-git.sh
sudo dnf group install -y "C Development Tools and Libraries"
sudo dnf install -y qt-devel qt-doc qt-creator qt5-qtsvg openal-soft-devel libXScrnSaver-devel qrencode-devel
sudo dnf install -y libtool autoconf automake check check-devel libsodium-devel
cd ~/Git;pwd
git clone https://github.com/irungentoo/filter_audio
( cd filter_audio && \
make && \
sudo make install )

Why so slow? Creating a flamegraph of your program with perf

Flamegraphs can help to optimize program a lot. So let's create one!

  • Install perf with use flag unwind enabled
  • Download flamegraph.pl and stackcolllapse-perf.pl
  • Run perf record -F 99 --call-graph dwarf -- ‹your program›
  • Do all the things that make your program slow
  • Close your program
  • Run perf script | stackcollapse-perf.pl > out.folded
@zetok
zetok / gist:ba4e3facddb74e68c398
Last active August 29, 2015 14:05
utox SIGSEGV 2014-08-14
send_data_packet failed
Program received signal SIGSEGV, Segmentation fault.
0x0000555555570416 in utf8_len_read (
data=0x6b69655420696573 <Address 0x6b69655420696573 out of bounds>,
ch=0x7fffffffd8dc) at util.c:164
164 util.c: No such file or directory.
(gdb) bt
#0 0x0000555555570416 in utf8_len_read (
data=0x6b69655420696573 <Address 0x6b69655420696573 out of bounds>,
@zetok
zetok / gist:d8177ca79220ac271066
Created August 8, 2014 08:06
toxic segfault 2014-08-08
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f681ecbe700 (LWP 22964)]
alcCaptureSamples (device=0x0, buffer=0x7f681ecb6230, samples=960)
at /var/tmp/portage/media-libs/openal-1.15.1-r2/work/openal-soft-1.15.1/Alc/ALc.c:3056
3056 /var/tmp/portage/media-libs/openal-1.15.1-r2/work/openal-soft-1.15.1/Alc/ALc.c: No such file or directory.
(gdb) bt
#0 alcCaptureSamples (device=0x0, buffer=0x7f681ecb6230, samples=960)
at /var/tmp/portage/media-libs/openal-1.15.1-r2/work/openal-soft-1.15.1/Alc/ALc.c:3056
#1 0x00007f6826d35d6f in thread_poll (arg=0x0) at ../src/device.c:427
#2 0x00007f6823b695cd in start_thread (arg=0x7f681ecbe700) at pthread_create.c:309
@zetok
zetok / gist:f413e35761c270c68758
Last active August 29, 2015 14:04
utox SIGSEGV 2014-08-04
Friend Userstatus (1): 0
Calling friend: 1
A/V Ringing (0)
video for this call: 0
[New Thread 0x7fffdf126700 (LWP 11308)]
A/V Starting (0)
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffdf126700 (LWP 11308)]
0x000055555557b7e1 in sourceplaybuffer (i=1, data=0x7fffdf121028, samples=960,
@zetok
zetok / gist:ae3fd0646606505dce3f
Last active August 29, 2015 14:04
qtox segfault 2014-07-31
tried to send a file:
chunkSize: 1371
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffde115700 (LWP 7958)]
QCoreApplication::notifyInternal (this=0x7fffffffdc20, receiver=0x530030,
event=event@entry=0x7fffde114ae0) at kernel/qcoreapplication.cpp:933
933 kernel/qcoreapplication.cpp: No such file or directory.
@zetok
zetok / gist:999fcd4f7244ddf37d5c
Created July 31, 2014 09:16
toxic segfault 2014-07-31
made call, then tried to send file
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff3bc4700 (LWP 4827)]
0x00007ffff51cb739 in __GI_fseek (fp=0x7fffec0b2f60, offset=2189487, whence=0)
at fseek.c:38
38 fseek.c: No such file or directory.
(gdb) bt
#0 0x00007ffff51cb739 in __GI_fseek (fp=0x7fffec0b2f60, offset=2189487, whence=0)
at fseek.c:38
@zetok
zetok / gist:37f899c3f6271bb4db65
Created July 31, 2014 08:36
toxic segfault 2014-07-31
https://gist.github.com/zetok/608727e6e971dd42f267
Friend Userstatus (26): 0
*** Error in `/usr/bin/utox': malloc(): smallbin double linked list corrupted: 0x00007fffec0969e0 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x7f641)[0x7ffff51cd641]
/lib64/libc.so.6(+0x85fbe)[0x7ffff51d3fbe]
/lib64/libc.so.6(+0x883da)[0x7ffff51d63da]
/lib64/libc.so.6(__libc_malloc+0x74)[0x7ffff51d77d4]
/lib64/libc.so.6(+0x74991)[0x7ffff51c2991]
@zetok
zetok / gist:608727e6e971dd42f267
Last active August 29, 2015 14:04
µtox segfault 2014-07-29
dropped audio frame
dropped audio frame
dropped audio frame
Friend Online/Offline (26): 0
A/V PeerTimeout (0)
Friend Online/Offline (26): 1
File Control
Friend Name (26): audiobotze
Friend Status Message (26): Call me :3 – if nothing is being played, just send something :)
Friend Userstatus (26): 0