Skip to content

Instantly share code, notes, and snippets.

View rurban's full-sized avatar
💭
Broke my right shoulder, cannot type much

Reini Urban rurban

💭
Broke my right shoulder, cannot type much
View GitHub Profile
@rurban
rurban / id:000119,sig:11,src:000000,op:havoc,rep:8
Last active August 29, 2015 14:12
afl-fuzz parrot => SEGV
install afl: http://lcamtuf.coredump.cx/afl/
perl Configure --cc=afl-gcc --disable-shared
mkdir afl-out afl-testcase
cp t/op/literal.t testcase/
afl-fuzz -C -o afl-out -i afl-testcase -m4000 -- parrot_old -r @@
for f in afl-out/crashes/*; do ./parrot_old $f >/dev/null 2>/dev/null || echo $f $?; done
$ cat afl-out/crashes/id:000119,sig:11,src:000000,op:havoc,rep:8
@rurban
rurban / gcc-try.pl
Last active August 29, 2015 14:12
bisect-alike src-code change fuzzer
#!/usr/bin/perl
=pod
Change every single occurence of PARROT_CANNOT_RETURN_NULL in all .c files (not .h, as
those declarations are autogenerated by make headerizer) to the opposite
PARROT_CAN_RETURN_NULL declaration.
One by one.
Should find two gcc problems in parrot, as of commit 3a3d785:
@rurban
rurban / smoke-all.sh
Last active August 29, 2015 14:10
smoke parrot
#!/bin/sh
set -x
export TEST_JOBS=4
perl Configure.pl --silent --debugging --cage && make -j4 -s && \
make -j4 -s fulltest
for args in --debugging --m=32 --optimize; do
for cc in g++-4.4 g++-4.5 g++-4.6 g++-4.7 g++-4.8 g++-4.9 \
gcc-4.4 gcc-4.5 gcc-4.6 gcc-4.7 gcc-4.8 gcc-4.9 \
@rurban
rurban / gist:f1a28dd98241a294e47c
Last active August 29, 2015 14:09
rakudo spectest
rakudo spectest
nom=acea0c1678c0fd74435a2abb15c0025354dae298
nqp version 2014.10-8-g92f6783 built on parrot 6.9.0 revision RELEASE_6_9_0-70-g95560a6
$ perl Configure.pl --gen-parrot=smoke-me/gcdebug-gh110
Test Summary Report
-------------------
t/spec/S04-statement-modifiers/for.rakudo.parrot (Wstat: 0 Tests: 24 Failed: 0)
TODO passed: 24
diff --git lib/Parrot/Pmc2c/Method.pm lib/Parrot/Pmc2c/Method.pm
index edd5f75..a99a5da 100644
--- lib/Parrot/Pmc2c/Method.pm
+++ lib/Parrot/Pmc2c/Method.pm
@@ -337,9 +337,10 @@ sub decl {
}
my $interp = $self->interp_unused ? 'SHIM_INTERP' : 'PARROT_INTERP';
my $pmcarg = $self->pmc_unused ? 'SHIM(PMC *_self)' : 'ARGMOD(PMC *_self)';
+ my $static = $pmcname eq 'CallContext' ? "" : "static";
From cb4f723b4b5ec38c82cad4c85dd87f2f42da517b Mon Sep 17 00:00:00 2001
From: Reini Urban <[email protected]>
Date: Mon, 14 Jul 2014 13:07:58 -0500
Subject: [PATCH] [pcc] inline pcc_add_invocant and its attr accessor
This is a hot path, and we skip the GETATTR_CallContext_arg_flags checks.
call_obj is always a CallContext object.
Unfortunately the vtable methods are not exported so we need to call them
indirectly.
---
rakudo Gdansk-82-gb764567
nqp 2014.06-24-gba3354c
moar (version 2014.06-55-g55187a1)
Test Summary Report
-------------------
t/spec/S06-advanced/wrap.rakudo.moar (Wstat: 0 Tests: 85 Failed: 4)
Failed tests: 71-72, 77, 85
t/spec/S17-promise/allof.t (Wstat: 0 Tests: 10 Failed: 1)
@rurban
rurban / 0001-fix-parrot-error-with-label-in-MapIter.reify.patch
Created July 1, 2014 19:50
0001-fix-parrot-error-with-label-in-MapIter.reify.patch
From 7ea3218a768651b7f7820f9b80a953152dfb75a2 Mon Sep 17 00:00:00 2001
From: Reini Urban <[email protected]>
Date: Tue, 1 Jul 2014 14:47:15 -0500
Subject: [PATCH] fix parrot error with $!label in MapIter.reify
seperating the !$label into its own PIR blocks seperated the handler
pmc from the method call. 196b4ff55 broke rakudo-p with
nqp/install/bin/parrot -o CORE.setting.pbc src/gen/p-CORE.setting.pir
error:imcc:syntax error, unexpected DOT, expecting '(' ('.')
@rurban
rurban / 0001-pmc2c-fixup-Chirags-code-a-bit.patch
Created June 27, 2014 17:08
0001-pmc2c-fixup-Chirags-code-a-bit.patch
From cde13dbfa3caea108bdec5ccd71efbe10ea3a2e4 Mon Sep 17 00:00:00 2001
From: Reini Urban <[email protected]>
Date: Fri, 27 Jun 2014 12:00:08 -0500
Subject: [PATCH] [pmc2c] fixup Chirags code a bit
fallback to old slow code with unknown arg adverbs.
fix indices and whitespace and more codingstd with Chirags code.
add helper function convert_pcc_sigtype for args and return sigs.
---
lib/Parrot/Pmc2c/PCCMETHOD.pm | 118 ++++++++++++++++++++----------------------
my $sigtype = {'P' => 'pmc',
'S' => 'string',
'I' => 'integer',
'N' => 'number'};
my $arg_index = 0;
my @sig_vals = split(//, $params_signature);
my @params_vararg_list = split(/, &/,substr($params_varargs, 1));
foreach my $sig (@sig_vals) {
if ($sigtype{$sig}) {