Skip to content

Instantly share code, notes, and snippets.

@vi
Created February 2, 2011 17:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vi/808077 to your computer and use it in GitHub Desktop.
Save vi/808077 to your computer and use it in GitHub Desktop.
vi@vi-notebook:~/_$ git clone -b valgrind-failure git://github.com/vi/tcplim.git
Cloning into tcplim...
...
vi@vi-notebook:~/_$ cd tcplim/
vi@vi-notebook:~/_/tcplim$ make
gcc -O2 tcplim.c -o tcplim
vi@vi-notebook:~/_/tcplim$ socat tcp-l:9998,reuseaddr,fork file:/dev/zero&
[1] 11525
vi@vi-notebook:~/_/tcplim$ valgrind ./tcplim 127.0.0.1 9999 127.0.0.1 9998 10000000 10000000 1000000000 1000000000 50 2> log&
[2] 11550
vi@vi-notebook:~/_/tcplim$ nc 127.0.0.1 9999 | pv > /dev/null
48kB 0:00:00 [1.01MB/s] [ <=> ]
vi@vi-notebook:~/_/tcplim$ grep impossible log
Memcheck: the 'impossible' happened:
[1]+ Stopped socat tcp-l:9998,reuseaddr,fork file:/dev/zero
[2]- Exit 1 valgrind ./tcplim 127.0.0.1 9999 127.0.0.1 9998 10000000 10000000 1000000000 1000000000 50 2> log
@vi
Copy link
Author

vi commented Feb 2, 2011

Considering "impossible happened" like "internal compiler error" - the bug present not matter whether the code being checked is valid or invalid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment