go-amqp/fuzz_test.go

566 строки
19 KiB
Go
Исходник Обычный вид История

2017-04-24 06:24:12 +03:00
package amqp
import (
"context"
2017-04-27 06:35:29 +03:00
"os"
"path/filepath"
2017-04-24 06:24:12 +03:00
"strconv"
"testing"
"time"
2017-04-27 06:35:29 +03:00
"github.com/Azure/go-amqp/internal/buffer"
"github.com/Azure/go-amqp/internal/encoding"
"github.com/Azure/go-amqp/internal/frames"
"github.com/Azure/go-amqp/internal/testconn"
"github.com/fortytw2/leaktest"
"github.com/stretchr/testify/require"
2017-04-24 06:24:12 +03:00
)
func fuzzConn(data []byte) int {
// Receive
ctx, cancel := context.WithTimeout(context.Background(), 20*time.Millisecond)
client, err := NewConn(ctx, testconn.New(data), &ConnOptions{
IdleTimeout: 20 * time.Millisecond,
SASLType: SASLTypePlain("listen", "3aCXZYFcuZA89xe6lZkfYJvOPnTGipA3ap7NvPruBhI="),
})
cancel()
if err != nil {
return 0
}
defer client.Close()
s, err := client.NewSession(context.Background(), nil)
if err != nil {
return 0
}
r, err := s.NewReceiver(context.Background(), "source", &ReceiverOptions{
Merge flowcontrol branch into main (#260) * Replace messages channel with a queue (#244) * Replace messages channel with a queue The Receiver.messages channel placed an arbitrary restriction on the amount of link credit that could be issued to a Receiver. Once the Receiver has been created, it can never be issued credit that exceeds the size of the channel. In addition, if the Receiver were to receive messages that exceeds the size of the channel, due to flow control bugs or other, the writes to the channel could block leading to hangs. The channel has been replaced with a segmented FIFO queue. While this in theory could allow for unbounded growth, the reality is that the total size can never be greater than that of the Session's incoming window. * use Ring from standard library * switch to require.Same for pointer comparisons fixed issue in last seg check and added another test * refine and add another test * size message queue to the incoming window * add Holder[T] to abstract syncronized access * Remove concept of "max credit" from Receivers (#251) * Remove concept of "max credit" from Receivers This exposed an implementation detail of how Receivers worked. With the removal of the Message channel, this is no longer required and never really made sense anyways. The MaxCredit and ManualCredits options have been consolidated into a single Credit option. This is used to set the total credit for a Receiver in auto-flow mode, or to disable auto-flow. Disposition batching needed some slight refactoring. Now you can directly specify the batch size instead of it being tied to link credit. Received messages that are sender-settled now correctly count towards a Receiver's credit and must be settled to reclaim it. * fix linter * back out double-buffering change for now * refine threshold logic * switch to mutex instead of channel for better perf * add back fix to remove double buffering * rename local var for clarity * revert cosmetic change * Replace incoming frame channels with queues (#253) * Replace incoming frame channels with queues The rx channel in Session and link has been replaced with a queue. This ensures that parents enqueueing frames to their children is always a non blocking operation and removes the need to "pump the mux". Consolidated some link creation code into newLink(). Links echoing a flow frame now correctly include session info. Reverted workaround for sending disposition frames from senders as we can now send directly from muxHandleFrame. * minor cleanup from review * Remove configuration of session window (#257) The values weren't actually honored which is ok per spec, so remove them from the public surface area. Cleaned up handling of sender link credit. Since we don't use availableCredit, it's been removed. * Improve handling of sender-settled messages (#258) Reclaim credit for sender-settled messages when Prefetch or Receive are called. This removes the need to explicitly settle the message.
2023-03-15 22:51:36 +03:00
Credit: 2,
})
if err != nil {
return 0
}
msg, err := r.Receive(context.Background(), nil)
if err != nil {
return 0
}
if err = r.AcceptMessage(context.Background(), msg); err != nil {
return 0
}
ctx, close := context.WithTimeout(context.Background(), 10*time.Millisecond)
defer close()
r.Close(ctx)
s.Close(ctx)
// Send
ctx, cancel = context.WithTimeout(context.Background(), time.Second)
client, err = NewConn(ctx, testconn.New(data), &ConnOptions{
IdleTimeout: 10 * time.Millisecond,
SASLType: SASLTypePlain("listen", "3aCXZYFcuZA89xe6lZkfYJvOPnTGipA3ap7NvPruBhI="),
})
cancel()
if err != nil {
return 0
}
defer client.Close()
s, err = client.NewSession(context.Background(), nil)
if err != nil {
return 0
}
sender, err := s.NewSender(context.Background(), "source", nil)
if err != nil {
return 0
}
err = sender.Send(context.Background(), NewMessage(data), nil)
if err != nil {
return 0
}
ctx, close = context.WithTimeout(context.Background(), 10*time.Millisecond)
defer close()
r.Close(ctx)
s.Close(ctx)
return 1
}
func fuzzUnmarshal(data []byte) int {
types := []any{
new(frames.PerformAttach),
new(*frames.PerformAttach),
new(frames.PerformBegin),
new(*frames.PerformBegin),
new(frames.PerformClose),
new(*frames.PerformClose),
new(frames.PerformDetach),
new(*frames.PerformDetach),
new(frames.PerformDisposition),
new(*frames.PerformDisposition),
new(frames.PerformEnd),
new(*frames.PerformEnd),
new(frames.PerformFlow),
new(*frames.PerformFlow),
new(frames.PerformOpen),
new(*frames.PerformOpen),
new(frames.PerformTransfer),
new(*frames.PerformTransfer),
new(frames.Source),
new(*frames.Source),
new(frames.Target),
new(*frames.Target),
new(encoding.SASLCode),
new(*encoding.SASLCode),
new(frames.SASLMechanisms),
new(*frames.SASLMechanisms),
new(frames.SASLChallenge),
new(*frames.SASLChallenge),
new(frames.SASLResponse),
new(*frames.SASLResponse),
new(frames.SASLOutcome),
new(*frames.SASLOutcome),
new(Message),
new(*Message),
new(MessageHeader),
new(*MessageHeader),
new(MessageProperties),
new(*MessageProperties),
}
for _, t := range types {
_ = encoding.Unmarshal(buffer.New(data), t)
_, _ = encoding.ReadAny(buffer.New(data))
}
return 0
}
func TestFuzzConnCrashers(t *testing.T) {
2017-04-24 06:24:12 +03:00
tests := []string{
0: "\x00\x00\x00\x010000",
1: "\x00\x00\x00?\x02\x01\x00\x00\x00S@\xc02\x01\xe0/\x04\xb3\x00\x00\x00\aMSSBCBS\x00\x00\x00\x05PLAIN\x00\x00\x00\tANONYMOUS\x00\x00\x00\bEXTERNAL",
2: "AMQP\x03\x01\x00\x00\x00\x00\x00\x1a0000\x00SD\xc00\x02P0\xa0\x0000000000",
3: "AMQP\x00\x01\x00\x00\x00\x00\x00\x01\x00\x00\x00S@\xc0108412541625644849\xe0",
4: "\x00\x00\x00\x1a0000\x00SD\xc000P0\xa0\x0000000000",
5: "AMQP\x03\x01\x00\x00\x00\x00\x00?\x02\x01\x00\x00\x00S@\xc0" +
"2\x01\xe0/\x04\xb3\x00\x00\x00\aMSSBCBS\x00\x00\x00" +
"\x05PLAIN\x00\x00\x00\tANONYMOUS\x00" +
"\x00\x00\bEXTERNAL\x00\x00\x00\x1a\x02\x01\x00\x00\x00" +
"SD\xc0\r\x02P\x00\xa0\bWelcome!AMQ" +
"P\x00\x01\x00\x00\x00\x00\x00G\x02\x00\x00\x00\x00S\x10\xc0:\n\xa1" +
"$83a29bedd884468ba2e" +
"37f3017eeab1d_G29@p\x00" +
"\x00\x02\x00`\x00\x01p\x00\x03\xa9\x80@@@@@\x00\x00\x00\x1f" +
"\x02\x00\x00\x00\x00S\x11\xc0\x12\b`\x00\x00R\x01p\x00\x00\x13\x88" +
"R\x01R\xff@@@\x00\x00\x00d\x02\x00\x00\x00\x00S\x12\xc0W" +
"\x0e\xa1(oJnNPGsiuzytMOJPa" +
"twtPilfsfykSBGplhxtx" +
"VSGCB@P\x01\x00S(\xc0\x12\v\xa1\x05/tes" +
"t@@@@@@@@@@@@@C\x80\x00\x00\x00\x00" +
"\x00\x04\x10\x00@@@\x00\x00\x01y\x02\x00\x00\x00\x00S\x14\xc0\x1d" +
"\vCC\xa0\x10F>\xc6\\\x06&\xfaE\x9c\x03\xa8\x8e\xe7\x83\xe3" +
";C@B@@@@A\x00Sp\xc0\n\x05@@pH\x19" +
"\b\x00@C\x00Sr\xc1\\\x06\xa3\x13x-opt-en" +
"queued-time\x83\x00\x00\x01[\x9c_)\xd1" +
"\xa3\x15x-opt-sequence-num" +
"ber\x81\x00\x00\x00\x00\x00\x00\x03x\xa3\x12x-opt-" +
"locked-until\x83\x00\x00\x01[\x9c_\x9f" +
"\x11\x00Ss\xc0H\r\xa1$5e84053f-81" +
"c9-49fc-ae42-ff0ab35" +
"3d998@@\xa1\x14Service Bus" +
" Explorer@@@@@@@@@\x00S" +
"t\xc18\x04\xa1\vMachineName\xa1\x0fW" +
"IN-37U7RVPH3B1\xa1\bUser" +
"Name\xa1\rAdministrator\x00" +
"Su\xa0P<?xml version=\"1" +
".0\" encoding=\"utf-8\"" +
"?>\r\n<message>Hi mate" +
", how are you?</mess" +
"age>",
6: "AMQP\x03\x01\x00\x00\x00\x00\x00?\x02\x01\x00\x00\x00S@\xc0" +
"2\x01\xe0/\x04\xb3\xf8\x00\x00\aMSSBCBm\x00\x00\x00" +
"\x05PLA\xff\x00\x00\x00\x00\tANONYMOUS\x00" +
"\x00\x00\b\x14\nEXTERNAL",
7: "AMQP\x03\x01\x00\x00\x00\x00\x00?\x02\x01\x00\x00\x00S@\xc0" +
"2\x01\xe0/\x04\xb3\x00\x00\x00\aMSSBCBS\x00\x00\x00" +
"\x05PLAIN\x00\x00\x00\tANONYMOUS\x00" +
"\x00\x00\bEXTERNAL\x00\x00\x00\x1a\x02\x01\x00\x00\x00" +
"SD\xc0\r\x02P\x00\xa0\bWelcome!AMQ" +
"P\x00\x01\x00\x00\x00\x00\x00G\x02\x00\x00\x00\x00S\x10\xc0:\n\xa1" +
"$83a29bedd884468ba2e" +
"37f3017eeab1d_G29@p\x00" +
"\x00\x02\x00`\x00\x01p\x00\x03\xa9\x80@@@@@\x02",
8: "AMQP\x03\x01\x00\x00\x00\x00\x00?\x02\x01\x00\x00\x00S@\xc0" +
"2\x01\xe0/\x04\xb3\x00\x00\x00\aMSS \x00\x00\x00\x00\x00\x00" +
"\x05PLAIN<49>^<5E>~\x00\x00\x00\tAN" +
"\xcfNYMOUS\x00\x00\x00\bEXT\xf1\xf1I\xdf\xed",
9: "AMQP\x03\x01\x00\x00\x00\x00\x00?\x02\x01\x00\x00\x00S@\xc0" +
"2\x01\xe0/\x04\xb3\x00\x00\x00\aMSSBCBS\x00\x00\x00" +
"\x05PLAIN\x00\x00\x00\tANONYMOUS\x00" +
"\x00\x00\bEXTERNAL\x00\x00\x00\x1a\x02\x01\x00\x00\x00" +
"SD\xc0\r\x02P\x00\xa0\bWelcome!AMQ" +
"P\x00\x01\x00\x00\x00\x00\x00G\x02\x00\x00\x00\x00S\x10\xc0:\n\xa1" +
"$83a29bedd884468ba2e" +
"37f3017eeab1d_G29@p\x00" +
"\x00\x02\x00`\x00\x01p\x00\x03\xa9\x80@@@@@\x00\x00\x00\x1f" +
"\x02\x00\x00\x00\x00S\x11\xc0\x12\b`\x00\x00R\x01p\x00\x00\x13\x88" +
"R\x01R\xff@@@\x00\x00\x02\x00S\x12\xa1JNPuzy" +
"MPawtPilffySBhxtxVGC" +
"B@\x00\xc0\x05/ts@@@@C\x80\x00\x00\x04@\x00\x00" +
"\x01y\x02\x00\x14\xc0CC\x10>\xc6\\\x9c\xa8\xe7\x83;@@@" +
"@pHC\x00S\xc1\\\xa3\x13xopenqud-t" +
"me\x83\x00\x01\xa3\x15-o-equneubr\x00\x00" +
"\x00\x00\x03xxp-lced-util\x83\x00\x01\x9c" +
"\x9f\r\xa1$5e0589-f-4fb339@" +
"@\xa1\x14ervuExplor@@@@@\xc1a" +
"cNIN3VP\xa1UserN\xa1Amitao" +
"u?m n=\". cin=\"ut-?>m" +
"ssagHimae arey/mess>",
10: "AMQP\x03\x01\x00\x00\x00\x00\x00?\x02\x01\x00\x00\x00S@\xc0" +
"2\x01\xe0/\x04\xb3\xa9\x80@@@@@\x00\x00\x00\x1f\x02\x00\x00" +
"\x00\x00S\x11\xc0\x12\b`\x00\x00R\x01p\x00\x00\x13\x88R\x01R" +
"\xff@@@\x00\x00\x00d\x00\x00S\x12\xc0",
11: "AMQP\x03\x01\x00\x00\x00\x00\x00?\x02\x01\x00\x00\x00S@\xc0" +
"2\x01\xe0/\x04\xb3\x00\x00\x00\aMSSBCBS\x00\x00\x00" +
"\x05PLAIN\x00\x00\x00\tANONYMOUS\x00" +
"\x00\x00\bEXTERNAL\x00\x00\x00\x1a\x02\x01\x00\x00\x00" +
"SD\xc0\r\x02P\x00\xa0\bWelcome!AMQ" +
"P\x00\x01\x00\x00\x00\x00\x00G\x02\x00\x00\x00\x00S\x10\xc0:\n\xa1" +
"$83a29bedd884468ba2e" +
"37f3017eeab1d_G29@p\x00" +
"\x00\x02\x00`\x00\x01p\x00\x03\xa9\x80@@@@@\x00\x00\x00\x1f" +
"\x02\x00\x00\x00\x00S\x11\xc0\x12\b`\x00\x00R\x01p\x00\x00\x13\x88" +
"R\x01R\xff@@@\x00\x00S(oJNPsiMPf" +
"sfkSGlxxVGCB@P\x01\x00\xc0\x12\xa1\x05" +
"/st@@@@\x80\x00\x00\x10\x00@@\x00\x00\x00S\x14\xc0" +
"\x1d\vC\xa0\x10>\\\xfa\xa8\x8eC@@A\x00\xc0\n@\b@" +
"\x00\x06\xa3x-oenqe-ti\x00\x01[_ѣx" +
"-p-senenue\x00\x00\x00\x00\x03x\xa3\x12pt" +
"-lked-tl\x83\x00\x01\x9c\x11\x00Ss\xc05e8" +
"41c9-4c-e42-fab3d\xa1\x14e" +
"rvsEpr@@@@@@\x00t\xc1\x04\xa1Mhi" +
"n\xa1\x0fN3RB\bUsNminrato\xa0<" +
"?m vro=\"10ncodig\"utf" +
"?\r<ea mateho re o?<m" +
"ssag>",
12: "AMQP\x03\x01\x00\x00\x00\x00\x00?\x02\x01\x00\x00\x00S@\xc0" +
"2\x01\xe0/\x04\xb3\x00\x00\x00\aMSSBCBS\x00\x00\x00" +
"\x05PLAINlf<6C>\t<><74>s\x00" +
"?\x02\x00\x00\x00\x00ShxtxVSGCB@P\x01\x00" +
"Q",
13: "AMQP\x03\x01\x00\x00\x00\x00\x00?\x02\x01\x00\x04\x00S@\xc0" +
"1\x01\xe0/\x04\xb3\x00\x00\x00\aMSSBCB\xff\x00\x00\x00" +
"\x05PLAIN\xfa\x00\x00\tAN\xcfNYMOUS\x00" +
"\x00\x00\bE\xef\xbf\x02\x00\fU ",
14: "AMQP\x03\x01\x00\x00\x00\x00\x00?\x02\x01\x00\x00\x00S@\xc0" +
"2\x01\xe0/\x04\xb3\x00\x00\x00\aMSSBCBS\x00\x00\x00" +
"\x05PLAIN\x00\x00\x00\tANONYMOUR\xff" +
"\xff\xed\bEXTERNAL\x00\x00\x00\x1a\x02\x01\x00\x00\x00" +
"SD\xc0\r\x02P\x00\xa0\bWelcome!AMQ" +
"P\x00\x01\x00\x00\x00\x00\x00G\x02\x00\x00\x00\x00S\x10\xc0:\n\xa1" +
"$83a29bedd884468ba2e" +
"37f3017eeab1d_G29@p\x00" +
"\x00\x02\x00`\x00\x01p\x00\x03\xa9\x80@@@@@\x00\x00\x00\x1f" +
"\x02\x00\x00\x00\x00S\x11\xc0\x12\b`\x00\x00R\x01p\x00\x00\x13\x88" +
"R\x01R\xff@@@\x00\x00\x00d\x02\x00\x00\x00\x00S\x12\xc0W" +
"\x0e\xa1(oJnNPGsiuzytMOJPa" +
"twtPilfsfykSBGplhxtx" +
"VSGCB@P\x01\x00S(\xc0\x12\v\xa1\x05/tes" +
"t@@@@@@@@@@@C\x80\x00\x00\x00\x00\x00\x04" +
"\x10\x00@@@\x00\x00\x01y\x02\x00\x00\x00\x00S\x14\xc0\x1d\vC" +
"C\xa0\x10F>\xc6\\\x06&\xfaE\x9c\x03\xa8\x8e\xe7\x83\xe3;C" +
"@B@@@@A\x00Sp\xc0\n\x05@@pH\x19\b\x00" +
"@C\x00Sr\xc1\\\x06\xa3\x13x-opt-enqu" +
"eued-time\x83\x00\x00\x01[\x9c_)ѣ\x15" +
"x-opt-sequence-numbe" +
"r\x81\x00\x00\x00\x00\x00\x00\x03x\xa3\x12x-opt-lo" +
"cked-until\x83\x00\x00\x01[\x9c_\x9f\x11\x00" +
"Ss\xc0H\r\xa1$5e84053f-81c9" +
"-49fc-ae42-ff0ab353d" +
"998@@\xa1\x14Service Bus E" +
"xplorer@@@@@@@@@\x00St\xc1" +
"8\x04\xa1\vMachineNam",
2017-04-27 06:35:29 +03:00
15: "AMQP\x03\x01\x00\x00\x00\x00\x00?\x02\x01\x00\x00\x00S@\xc0" +
"2\x01\xe0/\x04\xb3\x00\x00\x00\aMSSBCBS\x00\x00\x00" +
"\x05PLAIN\x00\x00\x00\tANONYMOUS\x00" +
"\x00\x00\bEXTERNAL\x00\x00\x00\x1a\x02\x01\x00\x00\x00" +
"SD\xc0\r\x02P\x00\xa0\bWelcome!A2Q" +
"P\x00\x01\x00\x00\x00\x00\x00G\x02\x00\x00\x00\x00S\x10\xc0:\n\xa1" +
"$83a29bedd884468ba2e" +
"37f3017eeab1d_G29@p\x00" +
"\x00\x02\x00`\x00\x01p\x00\x03\xa9\x80@@@@@\x00\x00\x00\x1f" +
"\x02\x00\x00\x00\x00S\x11\xc0\x12\b`\x00\x00R\x01p\x00\x00\x13\x88" +
"R\x01R\xff@@@\x00\x00\x00d\x02\x00\x00\x00\x00S\x12\xc0W" +
"\x0e\xa1(oJnNPGsiuzytMOJPa" +
"twtPilfsfykSBGplhxtx" +
"VSGCB@P\x01\x00S(\xc0\"\xd9\aTERNA" +
"L\x00\x00t@@@@@@@\x17\r\r\x1a@@@@@" +
"@C\x80\x00\x00\x01[\x9c\x00\x00\x00\x00\x04\x10\x00@-@\x00\x00" +
"\x01y\x02\x00\x00\x00\x00S\x14\xc0\x1d\vCC\xa0\x10F>\xc6\\" +
"\x06&\xfaE\x9c\x03\xa8\x8e\xe7\x83\xe3;C@B@@@A\x00" +
"Sp\xc0\n\x05@@pH\x19\b\x00@C\x00r\xc1\\\xa3\x13" +
"xop-enqueed-im\x83\x00\x00\x01[\x9c" +
"_-ѣ\x15x-opt-squnce-nu" +
"mber\x81\x00\x00\x00\x00\x00\x00\x03x\xa3\x12x@opt" +
"-locked-until\x83\x00\x00\x01[\x9c_" +
"\x9f\x11\x00Ss\xc0\r\xa1$58405f-81c9" +
"-4fc-ae42-ff0ab353d9" +
"98@@\xa1\x14Servie ",
16: "\x00\x00\x0000000\x00S\x17\xc00\x01000000" +
"00000000000000000000" +
"00000000000000000000" +
"000",
17: "AMQP\x03\x01\x00\x00\x00\x00\x00?\x02\x01\x00\x00\x00S@\xc0" +
"2\x01\xe0/\x04\xb3\x00\x00\x00\aMSSBCBS\x00\x00\x00" +
"\x05PLAIN\x00\x00\x00\tANONYMOUS\x00" +
"\x00\x00\bEXTERNAL\x00\x00\x00\x1a\x02\x01\x00\x00\x00" +
"SD\xc0\r\x02P\x00\xa0\bWelcome!AMQ" +
"P\x00\x01\x00\x00\x00\x00\x00G\x02\x00\x00\x00\x00S\x10\xc0:\n\xa1" +
"$83a29bedd884468ba2e" +
"37f301\"eeab1d_G29@p\x00" +
"\x00\x00\x00`\x00\x01p\x00\x03\xa9\x80@@@@@\x00\x00\x00\x1f" +
"\x02\x00\x00\x00\x00S\x11\xc0\x12\b`\x00\x00R\x01p\x00\x00\x13\x88" +
"R\x01R\xff@@@\x00\x00\x00d\x02\x00\x00\x00\x00S\x12\xc0W" +
"\x0e\xa1(oJnNPGsiuzytMOJPa" +
"twtPilfsfykSBGplhxtx" +
"VSGCB@P\x01\x00S(\xc0\x12\v\xa1\x05/tes" +
"t@@@@@@@@@@@@@C\x80\x00\x00\x00\x00" +
"\x00\x04\x10\x00@@@\x00\x00\x01y\x00\x00\x00\x00S\x14\xc0\x1dC" +
"C\xa0\x10F>\xc6\\\x06&\xfaE\x9c\x03\xa8\x8e\xe7\x83\xe3C@" +
"B@@@@\x00Sp\xc0\n\x05@@p\x19\b\x00@C\x00" +
"Sr\xc1\\\x06\xa3\x13x-opt-enqueue" +
"d-time\x83\x00\x00\x01[\x9c)ѣ\x15x-op" +
"t-equence-nmbe\x81\x00\x00\x00\x00\x00" +
"\x03x\xa3\x12x-opt-\xe6ocke-unti" +
"l\x83\x00\x00\x01\x9c_\x9f\x11\x00SsH\r\xa1$5e84" +
"053f-81c9-49fc-ae42-" +
"ff0b353d998@\xa1\x14Servic" +
" Bus Explrer@@@@@@@@" +
"@\x00St\xc18\x04\xa1\vMachineName" +
"\xa1\x0fWIN-37U7RVPH3B1\xa1Us" +
"erName\xa1Administrator" +
"\x00Su\xa0P<?xml verion=\"",
18: "\x00\x00\x00\x1f0000\x00S\x13\xc00\b`00000" +
"00000000000",
19: "AMQP\x03\x01\x00\x00\x00\x00\x00?\x02\x01\x00\x00\x00S@\xc0" +
"2\x01\xe0/\x04\xb3\x00\x00\x00\aMSSBCBS\x00\x00\x00" +
"\x05PLAIN\x00\x00\x00\tANONYMOUS\x00" +
"\x00\x00\bEXTERNAL\x00\x00\x00\x1a\x02\x01\x00\x00\x00" +
"SD\xc0\r\x02P\x00\xa0\bWelcome!AMQ" +
"P\x00\x01\x00\x00\x00\x00\x00G\x02\x00\x00\x00\x00S\x10\xc0:\x00\x01" +
"$8ֽ\xbf\xefѿソソ\xef\xef\xbf\xd5\xef\xcd" +
"\xbd<62><64>e\x85a\xe8\x03d_\xe629@p\x00" +
"\x00\x02\x00`\x00\x01p\x00\x03\xa9\x802dcfbb599" +
"75f217c445f95634d7c0" +
"250afe7d8316a70c47db" +
"a99ff94167ab74349729" +
"ce1d2bd5d161df27a6a6" +
"e7cba1e63924fcd03134" +
"abdad4952c3c409060d7" +
"ca2ee4e5f4c647c3edee" +
"7ad5aa1cbbd341a8a372" +
"ed4f4db1e469ee250a4e" +
"fcc46de1aa52a7e22685" +
"d0915b7aae075defbff1" +
"529d40a04f250a2d4a04" +
"6c36c8ca18631cb05533" +
"4625c4919072a8ee5258" +
"efb4e6205525455f428f" +
"63aeb62c68de9f758ee4" +
"b8c50a7d669ae00f8942" +
"5868f73e894c53ce9b96" +
"4dff34f42b9dc2bb0351" +
"9fbc169a397d25197cae" +
"5bc50742f3808f474f2a" +
"dd8d1a0281359043e0a3" +
"95705fbc0a89293fa2a5" +
"ddfe6ae5416e65c0a5b4" +
"eb83320585b33b26072b" +
"c99c9c1948a6a271d645" +
"17a433728974d0ff4586" +
"a42109d6268f9961a590" +
"8d6f2d198875b02ae786" +
"6fff3a9361b41842a35d" +
"c9477ec32da542b706f8" +
"478457649ddfda5dfab1" +
"d45aa10efe12c3065566" +
"541ebdc2d1db6814826f" +
"0cc9e3642e813408df3e" +
"baa3896bb2777e757dc3" +
"dbc1d28994a454fcb8d7" +
"6bc5914f29cfc05dc89f" +
"8c734315def58d4d6b0b" +
"0136ccd3c05178155e30" +
"fcb9f68df9104dc96e06" +
"58fa899c0058818da5ec" +
"88a723558ae3a6f2f8f5" +
"23e5af1a73a82ab16198" +
"c7ba8341568399d8013f" +
"c499e6e7ef61cb8654b4" +
"8b88aa2a931dc2cdcf24" +
"5686eed9c8355d620d5e" +
"91c1e878a9c7da655e3f" +
"29d9b7c3f44ad1c70890" +
"eb5f27ca28efff76420c" +
"d4e3cebd5c788536ddd3" +
"65f7ad1dbb91588d5861" +
"2e43b0460de9260d5f78" +
"0a245bc8e1a83166df1f" +
"3a3506d742c268ab4fc1" +
"0c6e04bca40295da0ff5" +
"420a199dd2fb36045215" +
"138c4a2a539ceccc382c" +
"8d349a81e13e84870894" +
"7c4a9e85d861811e75d3" +
"23896f6da3b2fa807f22" +
"bcfc57477e487602cf8e" +
"973bc925b1a19732b00d" +
"15d38675313a283bbaa7" +
"5e6793b5af11fe2514bd" +
"a3abe96cc19b0e58ddbe" +
"55e381ec58c31670fec1" +
"184d38bbf2d7cde0fcd2" +
"9e907e780d30130b98e0" +
"c9eec44bcb1d0ed18dfd" +
"a2a64adb523da3102eaf" +
"e2bd3051353d8148491a" +
"290308ed4ec3fa5da578" +
"4b481e861360c3b670e2" +
"56539f96a4c4c4360d0d" +
"40260049035f1cfdacb2" +
"75e7fa847e0df531b466" +
"141ac9a3a16e78659475" +
"72e4ab732daec23aac6e" +
"ed1256d796c4d58bf699" +
"f20aa4bbae461a16abbe" +
"9c1e9@@@@@",
20: "\x00\x00\x0000000\x00S\x18\xc00\x01000000" +
"00000000000000000000" +
"00000000000000000000" +
"000",
21: "",
22: "SSSBCB\x00\x00\x00S\x12\xc0W\x0e\xa1(pqa\xbd" +
"\xbfソ\xef\x17\x1a\r\r\x15Xhؿ\xbdJ\xf0\xbf\xbd\xef" +
"ǽDpHYjxeUBrVfdwCB@P" +
"\x01\x00S(\xc0\x1a\v\xa1\x05/test@@@@@@" +
"BS\x00\x00\x00\x05PL@@@@@@@C\x80\x00\x00\x00" +
"\x00\x00\x04\x10\x00@@@",
23: "\x00\x00\x00d\x02\x00#\x00\x00S\x12\xc0W\x0e\xa1crypt" +
"o/des: invalid key s" +
"ize (pqa\xbd\xdb\xf1\xbd\xbf\xef%\xbd\xdbQ\xbd\xbf" +
"\xef%\xbf\xbdJ\xf0\xbf\xbf\xf1\xbd\xbd\xdb\xf1\xbf\xf1\xba\xbf\xf1\xbd\xbd" +
"\xdb\xf1\xbd\xbfwCB@P\x01\x00S(\xc0\x1a\v\xa1\x05/t" +
"est@@@@@@@@@@@@@C\x80\x00\x00" +
"\x00\x80\x00\x04\x10\x00@@@",
24: "\x00\x00\x00d\x02\x00\x00\x00\x00S\x12\xc0\x00\x0e\xa1(p\xbd\xbf\xef" +
"\xbd\xdf\uf03d\xbfソソソ\xef\xff\xff\xff\x80" +
"\xbd\xbfソソ\x00\x02BrXfdw`@CB" +
"@P\x01\x00`S(\xc0\x12\v\xa1\x05./est`@@" +
"@`\x80@@@@@\x00P\xff\x00\x00\x00@@@`@\x00",
2017-04-24 06:24:12 +03:00
}
for i, tt := range tests {
t.Run(strconv.Itoa(i), func(t *testing.T) {
end := leaktest.Check(t)
require.Zero(t, fuzzConn([]byte(tt)))
end()
})
}
}
2017-04-27 06:35:29 +03:00
func TestFuzzMarshalCrashers(t *testing.T) {
tests := []string{
0: "\xc1\x000\xa0\x00S0",
1: "\xf0S\x13\xc0\x12\v@`@@`\v@```@@@",
2: "\xe000\xb0",
3: "\xc1\x000\xe000R",
4: "\xe000S",
5: "\x00\xe000R",
6: "\xe000\x83",
7: "\x00\x00\xe000S",
8: "\xe000R",
9: "\x00\xe000S",
10: "\xc1\x000\xe000S",
11: "\xc1\x000\x00\xe000S",
12: "\xc1\x000\x00\xe000R",
13: "\x00\x00\xe000R",
14: "\xe000\xb1",
15: "\xc1\x00%\xd0\x00\x00\x00M\xe2\x00\x00\x01\x00S\x1d\xd0\x00\x00\x00A" +
"\x00\x00\x00\x03\xa3\x10amqp:link:stol" +
"en\xa1\x0foo\xb1\xdefoo descript" +
"ion\xc1\x18\x04\xa1\x05other\xa1\x04info\xa1" +
"\x03andq\x00\x00\x03k",
16: "\xd1\x00\x00\x00M\x00S\x1d\xd0\x00S\x1d\xd0\x00\x00\x00A\x00\x80\x00" +
"\x03\xa3\x10amqp:link:stolen\xa1" +
"\x19foo description\xc1\x18\x04\xa1" +
"\x05other\xa1\x04info\xa1\x03andU\x00\x00" +
"\x03k",
Additional encoding/decoding optimization * Replace reader/writer interfaces with concrete `buffer` type. * Avoid intermediate buffer during map encoding. * Avoid `milliseconds` marshal allocation. * Remove `errNull`/`isNull` from marshal and avoid defer in hot path. * Cleanup of decoding code. * Minimize bounds checks by adding hints. * Check interface types last in type switches. * Add fastpath in unmarshal for `**uint32`. ``` name old time/op new time/op delta FrameMarshal/transfer-8 420ns ± 4% 197ns ± 5% -53.04% (p=0.000 n=10+10) FrameUnmarshal/transfer-8 1.84µs ± 0% 0.61µs ± 5% -66.64% (p=0.000 n=8+10) Marshal/*amqp.performOpen-8 787ns ± 3% 293ns ± 5% -62.83% (p=0.000 n=10+10) Marshal/*amqp.performBegin-8 621ns ± 1% 216ns ± 3% -65.27% (p=0.000 n=10+9) Marshal/*amqp.performAttach-8 2.45µs ± 1% 1.12µs ± 3% -54.13% (p=0.000 n=10+10) Marshal/amqp.role-8 30.5ns ± 2% 20.5ns ± 2% -32.75% (p=0.000 n=10+10) Marshal/*amqp.unsettled-8 258ns ± 8% 100ns ± 3% -61.10% (p=0.000 n=10+9) Marshal/*amqp.source-8 900ns ± 1% 401ns ± 5% -55.43% (p=0.000 n=10+10) Marshal/*amqp.target-8 516ns ± 1% 244ns ± 3% -52.79% (p=0.000 n=10+10) Marshal/*amqp.performFlow-8 576ns ± 1% 193ns ± 4% -66.42% (p=0.000 n=10+10) Marshal/*amqp.performTransfer-8 404ns ± 6% 184ns ± 2% -54.35% (p=0.000 n=10+10) Marshal/*amqp.performDisposition-8 215ns ± 5% 102ns ± 4% -52.54% (p=0.000 n=10+10) Marshal/*amqp.performDetach-8 612ns ± 2% 279ns ± 0% -54.37% (p=0.000 n=10+6) Marshal/*amqp.performDetach#01-8 1.23µs ± 8% 0.42µs ± 4% -65.71% (p=0.000 n=9+10) Marshal/amqp.ErrorCondition-8 69.9ns ± 1% 27.3ns ± 4% -60.96% (p=0.000 n=10+10) Marshal/*amqp.Error-8 493ns ± 1% 221ns ± 5% -55.12% (p=0.000 n=10+10) Marshal/*amqp.performEnd-8 595ns ± 1% 264ns ± 3% -55.69% (p=0.000 n=8+10) Marshal/*amqp.performClose-8 601ns ± 2% 263ns ± 4% -56.29% (p=0.000 n=10+10) Marshal/*amqp.Message-8 1.83µs ± 0% 0.80µs ± 4% -56.33% (p=0.000 n=8+10) Marshal/*amqp.MessageHeader-8 194ns ± 2% 82ns ± 3% -57.39% (p=0.000 n=10+10) Marshal/*amqp.MessageProperties-8 546ns ± 3% 264ns ± 5% -51.56% (p=0.000 n=8+10) Marshal/*amqp.stateReceived-8 137ns ± 3% 48ns ± 2% -65.10% (p=0.000 n=9+10) Marshal/*amqp.stateAccepted-8 30.1ns ± 2% 21.4ns ± 4% -28.80% (p=0.000 n=8+10) Marshal/*amqp.stateRejected-8 608ns ± 1% 261ns ± 3% -57.04% (p=0.000 n=10+9) Marshal/*amqp.stateReleased-8 30.6ns ± 5% 22.2ns ± 3% -27.30% (p=0.000 n=8+10) Marshal/*amqp.stateModified-8 352ns ± 4% 145ns ± 6% -58.84% (p=0.000 n=10+10) Marshal/amqp.lifetimePolicy-8 29.9ns ± 3% 19.8ns ± 3% -33.73% (p=0.000 n=10+10) Marshal/amqp.SenderSettleMode-8 35.1ns ± 3% 23.7ns ± 3% -32.44% (p=0.000 n=9+9) Marshal/amqp.ReceiverSettleMode-8 36.3ns ±13% 23.6ns ± 4% -35.07% (p=0.000 n=10+10) Marshal/*amqp.saslInit-8 160ns ± 5% 90ns ± 4% -43.69% (p=0.000 n=8+10) Marshal/*amqp.saslMechanisms-8 235ns ± 1% 74ns ± 7% -68.69% (p=0.000 n=10+10) Marshal/*amqp.saslOutcome-8 169ns ± 1% 71ns ± 9% -57.88% (p=0.000 n=10+10) Marshal/amqp.milliseconds-8 60.2ns ± 2% 19.0ns ± 5% -68.40% (p=0.000 n=10+10) Marshal/amqp.symbol-8 29.0ns ± 5% 25.1ns ± 5% -13.40% (p=0.000 n=10+10) Marshal/map[amqp.symbol]interface_{}-8 242ns ± 9% 81ns ± 2% -66.57% (p=0.000 n=10+9) Marshal/amqp.UUID-8 46.4ns ± 2% 19.2ns ± 6% -58.73% (p=0.000 n=9+10) Marshal/bool-8 16.6ns ± 5% 6.2ns ± 4% -62.82% (p=0.000 n=10+10) Marshal/int8-8 19.4ns ± 1% 8.3ns ± 5% -57.28% (p=0.000 n=9+10) Marshal/int8#01-8 19.5ns ± 2% 8.4ns ± 4% -57.10% (p=0.000 n=9+10) Marshal/int16-8 24.3ns ± 6% 6.8ns ± 5% -72.13% (p=0.000 n=10+10) Marshal/int16#01-8 24.9ns ± 2% 7.0ns ± 6% -71.90% (p=0.000 n=9+10) Marshal/int32-8 33.1ns ± 2% 6.9ns ± 3% -79.13% (p=0.000 n=9+10) Marshal/int32#01-8 32.6ns ± 5% 6.9ns ± 5% -78.94% (p=0.000 n=10+10) Marshal/int64-8 45.8ns ± 4% 7.0ns ± 4% -84.66% (p=0.000 n=10+10) Marshal/int64#01-8 45.7ns ± 3% 7.1ns ± 5% -84.54% (p=0.000 n=8+10) Marshal/uint8-8 19.0ns ± 2% 8.3ns ± 5% -56.49% (p=0.000 n=9+10) Marshal/uint16-8 24.8ns ± 4% 7.4ns ± 2% -70.23% (p=0.000 n=10+9) Marshal/uint32-8 33.4ns ± 3% 7.1ns ± 5% -78.78% (p=0.000 n=8+10) Marshal/uint64-8 46.5ns ± 3% 8.5ns ± 4% -81.78% (p=0.000 n=9+10) Marshal/float32-8 33.7ns ± 7% 7.2ns ± 6% -78.73% (p=0.000 n=10+10) Marshal/float32#01-8 33.5ns ± 3% 7.1ns ± 5% -78.89% (p=0.000 n=10+10) Marshal/float32#02-8 33.4ns ± 5% 7.0ns ± 5% -78.99% (p=0.000 n=10+10) Marshal/float32#03-8 34.1ns ± 6% 7.2ns ± 4% -78.86% (p=0.000 n=10+10) Marshal/float64-8 47.3ns ± 3% 7.4ns ± 4% -84.38% (p=0.000 n=9+10) Marshal/float64#01-8 47.3ns ± 3% 7.4ns ± 6% -84.37% (p=0.000 n=8+10) Marshal/float64#02-8 46.9ns ± 5% 7.6ns ± 1% -83.87% (p=0.000 n=10+10) Marshal/float64#03-8 47.6ns ± 4% 7.3ns ± 4% -84.57% (p=0.000 n=9+10) Marshal/amqp.describedType-8 119ns ± 5% 65ns ± 5% -45.63% (p=0.000 n=10+9) Marshal/map[interface_{}]interface_{}-8 253ns ± 9% 79ns ± 4% -68.82% (p=0.000 n=9+10) Marshal/map[string]interface_{}-8 252ns ±11% 83ns ± 3% -67.08% (p=0.000 n=10+9) Marshal/amqp.ArrayUByte-8 38.5ns ± 4% 29.6ns ± 1% -23.25% (p=0.000 n=10+9) Marshal/[]int8-8 47.2ns ± 5% 24.9ns ± 5% -47.28% (p=0.000 n=10+9) Marshal/[]uint16-8 75.1ns ± 3% 24.1ns ± 5% -67.84% (p=0.000 n=10+10) Marshal/[]uint16#01-8 75.4ns ± 4% 24.4ns ± 5% -67.60% (p=0.000 n=10+10) Marshal/[]int16-8 75.0ns ± 6% 24.6ns ± 4% -67.26% (p=0.000 n=10+10) Marshal/[]int16#01-8 73.7ns ± 4% 23.9ns ± 7% -67.64% (p=0.000 n=10+10) Marshal/[]uint32-8 106ns ± 4% 24ns ± 2% -77.50% (p=0.000 n=10+9) Marshal/[]uint32#01-8 49.6ns ± 5% 26.7ns ± 6% -46.18% (p=0.000 n=10+10) Marshal/[]int32-8 105ns ± 3% 23ns ± 4% -77.70% (p=0.000 n=10+8) Marshal/[]int32#01-8 49.0ns ± 3% 27.1ns ± 5% -44.69% (p=0.000 n=9+9) Marshal/[]uint64-8 172ns ± 4% 24ns ± 3% -85.81% (p=0.000 n=10+10) Marshal/[]uint64#01-8 49.2ns ± 3% 26.7ns ± 2% -45.72% (p=0.000 n=10+8) Marshal/[]int64-8 172ns ± 2% 25ns ± 3% -85.57% (p=0.000 n=8+9) Marshal/[]int64#01-8 49.1ns ± 4% 27.2ns ± 4% -44.62% (p=0.000 n=10+10) Marshal/[]float32-8 90.6ns ± 3% 23.0ns ± 3% -74.58% (p=0.000 n=9+9) Marshal/[]float64-8 143ns ± 6% 23ns ± 9% -83.87% (p=0.000 n=10+10) Marshal/[]bool-8 44.0ns ± 4% 21.8ns ±10% -50.45% (p=0.000 n=10+10) Marshal/[]string-8 131ns ± 6% 43ns ± 3% -67.25% (p=0.000 n=10+10) Marshal/[]amqp.symbol-8 130ns ± 3% 41ns ± 2% -68.39% (p=0.000 n=10+10) Marshal/[][]uint8-8 127ns ± 4% 37ns ± 6% -71.02% (p=0.000 n=10+8) Marshal/[]time.Time-8 58.9ns ± 4% 19.5ns ± 4% -66.87% (p=0.000 n=10+10) Marshal/[]amqp.UUID-8 55.0ns ± 2% 20.2ns ± 5% -63.20% (p=0.000 n=10+10) Marshal/[]interface_{}-8 125ns ± 3% 43ns ± 5% -65.89% (p=0.000 n=8+10) Unmarshal/*amqp.performOpen-8 1.65µs ± 3% 0.91µs ±15% -44.61% (p=0.000 n=10+10) Unmarshal/*amqp.performBegin-8 1.33µs ± 4% 0.78µs ±14% -41.35% (p=0.000 n=10+10) Unmarshal/*amqp.performAttach-8 6.09µs ± 6% 3.80µs ±17% -37.52% (p=0.000 n=10+10) Unmarshal/amqp.role-8 215ns ±14% 58ns ± 8% -73.18% (p=0.000 n=10+10) Unmarshal/*amqp.unsettled-8 938ns ±20% 629ns ± 9% -33.01% (p=0.000 n=10+9) Unmarshal/*amqp.source-8 2.19µs ±11% 1.43µs ±25% -34.87% (p=0.000 n=10+10) Unmarshal/*amqp.target-8 1.29µs ± 5% 0.78µs ± 9% -39.50% (p=0.000 n=10+10) Unmarshal/*amqp.performFlow-8 1.82µs ± 1% 0.77µs ±15% -57.89% (p=0.000 n=10+10) Unmarshal/*amqp.performTransfer-8 1.71µs ± 2% 0.47µs ± 1% -72.26% (p=0.000 n=10+10) Unmarshal/*amqp.performDisposition-8 910ns ± 1% 242ns ± 1% -73.37% (p=0.000 n=10+10) Unmarshal/*amqp.performDetach-8 1.49µs ± 3% 0.85µs ± 9% -42.86% (p=0.000 n=10+9) Unmarshal/*amqp.performDetach#01-8 1.93µs ± 7% 1.22µs ±13% -36.82% (p=0.000 n=10+10) Unmarshal/amqp.ErrorCondition-8 271ns ±15% 92ns ±14% -65.93% (p=0.000 n=10+10) Unmarshal/*amqp.Error-8 1.19µs ± 9% 0.76µs ±17% -36.36% (p=0.000 n=10+10) Unmarshal/*amqp.performEnd-8 1.38µs ± 4% 0.86µs ±23% -37.86% (p=0.000 n=10+10) Unmarshal/*amqp.performClose-8 1.32µs ± 2% 0.82µs ± 8% -38.12% (p=0.000 n=8+10) Unmarshal/*amqp.Message-8 4.66µs ± 4% 2.94µs ±16% -36.87% (p=0.000 n=10+10) Unmarshal/*amqp.MessageHeader-8 647ns ± 0% 206ns ± 1% -68.18% (p=0.000 n=8+9) Unmarshal/*amqp.MessageProperties-8 1.47µs ± 1% 0.53µs ± 1% -63.75% (p=0.000 n=10+10) Unmarshal/*amqp.stateReceived-8 385ns ± 2% 126ns ± 1% -67.23% (p=0.000 n=9+10) Unmarshal/*amqp.stateAccepted-8 255ns ±17% 94ns ± 3% -63.08% (p=0.000 n=10+10) Unmarshal/*amqp.stateRejected-8 1.40µs ± 4% 0.87µs ±11% -38.12% (p=0.000 n=9+10) Unmarshal/*amqp.stateReleased-8 251ns ± 9% 94ns ± 4% -62.81% (p=0.000 n=10+10) Unmarshal/*amqp.stateModified-8 1.01µs ± 8% 0.68µs ±21% -33.07% (p=0.000 n=9+10) Unmarshal/amqp.lifetimePolicy-8 203ns ± 7% 63ns ± 7% -68.74% (p=0.000 n=10+9) Unmarshal/amqp.SenderSettleMode-8 218ns ± 9% 57ns ±21% -73.84% (p=0.000 n=9+10) Unmarshal/amqp.ReceiverSettleMode-8 221ns ±11% 57ns ± 7% -74.38% (p=0.000 n=10+9) Unmarshal/*amqp.saslInit-8 551ns ± 1% 220ns ± 1% -60.10% (p=0.000 n=10+10) Unmarshal/*amqp.saslMechanisms-8 420ns ± 2% 187ns ± 1% -55.35% (p=0.000 n=10+9) Unmarshal/*amqp.saslOutcome-8 511ns ± 2% 187ns ± 2% -63.46% (p=0.000 n=10+9) Unmarshal/amqp.milliseconds-8 189ns ±22% 60ns ±17% -68.31% (p=0.000 n=10+10) Unmarshal/amqp.symbol-8 201ns ±12% 74ns ±21% -63.44% (p=0.000 n=10+10) Unmarshal/map[amqp.symbol]interface_{}-8 897ns ±31% 614ns ±16% -31.57% (p=0.000 n=10+10) Unmarshal/amqp.UUID-8 215ns ±16% 66ns ±12% -69.16% (p=0.000 n=10+10) Unmarshal/bool-8 174ns ±34% 56ns ±10% -67.75% (p=0.000 n=10+10) Unmarshal/int8-8 201ns ±26% 54ns ±17% -72.95% (p=0.000 n=10+10) Unmarshal/int8#01-8 175ns ±23% 57ns ±21% -67.47% (p=0.000 n=10+10) Unmarshal/int16-8 189ns ±15% 56ns ±16% -70.29% (p=0.000 n=10+10) Unmarshal/int16#01-8 185ns ±22% 55ns ±17% -70.31% (p=0.000 n=10+10) Unmarshal/int32-8 198ns ±13% 53ns ±11% -73.27% (p=0.000 n=10+9) Unmarshal/int32#01-8 200ns ±14% 55ns ±13% -72.32% (p=0.000 n=10+10) Unmarshal/int64-8 206ns ±16% 56ns ±19% -72.93% (p=0.000 n=10+10) Unmarshal/int64#01-8 190ns ±14% 52ns ±12% -72.48% (p=0.000 n=10+9) Unmarshal/uint8-8 188ns ±11% 55ns ±13% -70.70% (p=0.000 n=10+10) Unmarshal/uint16-8 197ns ±12% 55ns ±11% -72.16% (p=0.000 n=10+10) Unmarshal/uint32-8 187ns ±14% 57ns ±10% -69.62% (p=0.000 n=8+9) Unmarshal/uint64-8 174ns ±23% 54ns ±27% -68.90% (p=0.000 n=10+10) Unmarshal/float32-8 198ns ±24% 55ns ±20% -72.17% (p=0.000 n=10+10) Unmarshal/float32#01-8 187ns ±15% 55ns ±12% -70.82% (p=0.000 n=10+10) Unmarshal/float32#02-8 186ns ±19% 56ns ±13% -69.76% (p=0.000 n=10+10) Unmarshal/float32#03-8 184ns ±12% 52ns ±13% -71.93% (p=0.000 n=10+10) Unmarshal/float64-8 179ns ± 7% 54ns ± 7% -69.55% (p=0.000 n=9+10) Unmarshal/float64#01-8 188ns ±17% 54ns ±16% -71.39% (p=0.000 n=10+10) Unmarshal/float64#02-8 186ns ±15% 55ns ±19% -70.35% (p=0.000 n=10+10) Unmarshal/float64#03-8 185ns ±13% 56ns ±21% -69.69% (p=0.000 n=10+10) Unmarshal/amqp.describedType-8 413ns ±12% 203ns ±11% -50.91% (p=0.000 n=10+10) Unmarshal/map[interface_{}]interface_{}-8 774ns ±22% 618ns ±17% -20.15% (p=0.000 n=10+10) Unmarshal/map[string]interface_{}-8 769ns ±35% 591ns ±17% -23.16% (p=0.015 n=10+10) Unmarshal/amqp.ArrayUByte-8 203ns ±16% 88ns ±10% -56.70% (p=0.000 n=10+10) Unmarshal/[]int8-8 205ns ±12% 58ns ±10% -71.96% (p=0.000 n=9+9) Unmarshal/[]uint16-8 194ns ±14% 63ns ±18% -67.66% (p=0.000 n=10+10) Unmarshal/[]uint16#01-8 194ns ±20% 62ns ±12% -68.16% (p=0.000 n=10+10) Unmarshal/[]int16-8 200ns ±12% 61ns ± 6% -69.48% (p=0.000 n=10+9) Unmarshal/[]int16#01-8 200ns ± 7% 64ns ±14% -68.04% (p=0.000 n=10+10) Unmarshal/[]uint32-8 193ns ±16% 61ns ±10% -68.53% (p=0.000 n=10+10) Unmarshal/[]uint32#01-8 200ns ±20% 58ns ±11% -70.86% (p=0.000 n=10+10) Unmarshal/[]int32-8 201ns ±20% 64ns ±15% -68.14% (p=0.000 n=10+10) Unmarshal/[]int32#01-8 187ns ±14% 60ns ±17% -67.67% (p=0.000 n=9+10) Unmarshal/[]uint64-8 182ns ±12% 63ns ±12% -65.47% (p=0.000 n=10+10) Unmarshal/[]uint64#01-8 207ns ± 8% 60ns ±16% -70.82% (p=0.000 n=9+10) Unmarshal/[]int64-8 202ns ±20% 64ns ±10% -68.57% (p=0.000 n=10+10) Unmarshal/[]int64#01-8 197ns ±19% 56ns ± 9% -71.50% (p=0.000 n=10+9) Unmarshal/[]float32-8 197ns ±14% 61ns ±16% -68.78% (p=0.000 n=10+9) Unmarshal/[]float64-8 202ns ±16% 64ns ± 7% -68.32% (p=0.000 n=10+9) Unmarshal/[]bool-8 195ns ±15% 61ns ± 6% -68.76% (p=0.000 n=10+9) Unmarshal/[]string-8 249ns ±10% 109ns ± 5% -56.19% (p=0.000 n=10+10) Unmarshal/[]amqp.symbol-8 253ns ± 9% 110ns ± 5% -56.60% (p=0.000 n=10+10) Unmarshal/[][]uint8-8 285ns ± 3% 139ns ± 6% -51.29% (p=0.000 n=8+10) Unmarshal/[]time.Time-8 192ns ±15% 61ns ± 6% -68.44% (p=0.000 n=10+10) Unmarshal/[]amqp.UUID-8 192ns ±12% 61ns ±12% -67.98% (p=0.000 n=10+10) Unmarshal/[]interface_{}-8 296ns ± 8% 142ns ± 4% -51.92% (p=0.000 n=9+10) name old alloc/op new alloc/op delta FrameMarshal/transfer-8 0.00B 0.00B ~ (all equal) FrameUnmarshal/transfer-8 312B ± 0% 232B ± 0% -25.64% (p=0.000 n=10+10) Marshal/*amqp.performOpen-8 115B ± 0% 0B -100.00% (p=0.000 n=10+10) Marshal/*amqp.performBegin-8 115B ± 0% 0B -100.00% (p=0.000 n=10+10) Marshal/*amqp.performAttach-8 576B ± 0% 0B -100.00% (p=0.000 n=10+10) Marshal/amqp.role-8 0.00B 0.00B ~ (all equal) Marshal/*amqp.unsettled-8 115B ± 0% 0B -100.00% (p=0.000 n=10+10) Marshal/*amqp.source-8 230B ± 0% 0B -100.00% (p=0.000 n=10+10) Marshal/*amqp.target-8 115B ± 0% 0B -100.00% (p=0.000 n=10+10) Marshal/*amqp.performFlow-8 115B ± 0% 0B -100.00% (p=0.000 n=10+10) Marshal/*amqp.performTransfer-8 0.00B 0.00B ~ (all equal) Marshal/*amqp.performDisposition-8 0.00B 0.00B ~ (all equal) Marshal/*amqp.performDetach-8 131B ± 0% 0B -100.00% (p=0.000 n=10+10) Marshal/*amqp.performDetach#01-8 617B ± 0% 0B -100.00% (p=0.000 n=10+10) Marshal/amqp.ErrorCondition-8 16.0B ± 0% 0.0B -100.00% (p=0.000 n=10+10) Marshal/*amqp.Error-8 131B ± 0% 0B -100.00% (p=0.000 n=10+10) Marshal/*amqp.performEnd-8 131B ± 0% 0B -100.00% (p=0.000 n=10+10) Marshal/*amqp.performClose-8 131B ± 0% 0B -100.00% (p=0.000 n=10+10) Marshal/*amqp.Message-8 464B ± 0% 0B -100.00% (p=0.000 n=10+10) Marshal/*amqp.MessageHeader-8 4.00B ± 0% 0.00B -100.00% (p=0.000 n=10+10) Marshal/*amqp.MessageProperties-8 0.00B 0.00B ~ (all equal) Marshal/*amqp.stateReceived-8 0.00B 0.00B ~ (all equal) Marshal/*amqp.stateAccepted-8 0.00B 0.00B ~ (all equal) Marshal/*amqp.stateRejected-8 131B ± 0% 0B -100.00% (p=0.000 n=10+10) Marshal/*amqp.stateReleased-8 0.00B 0.00B ~ (all equal) Marshal/*amqp.stateModified-8 115B ± 0% 0B -100.00% (p=0.000 n=10+10) Marshal/amqp.lifetimePolicy-8 0.00B 0.00B ~ (all equal) Marshal/amqp.SenderSettleMode-8 0.00B 0.00B ~ (all equal) Marshal/amqp.ReceiverSettleMode-8 0.00B 0.00B ~ (all equal) Marshal/*amqp.saslInit-8 0.00B 0.00B ~ (all equal) Marshal/*amqp.saslMechanisms-8 32.0B ± 0% 0.0B -100.00% (p=0.000 n=10+10) Marshal/*amqp.saslOutcome-8 32.0B ± 0% 0.0B -100.00% (p=0.000 n=10+10) Marshal/amqp.milliseconds-8 4.00B ± 0% 0.00B -100.00% (p=0.000 n=10+10) Marshal/amqp.symbol-8 0.00B 0.00B ~ (all equal) Marshal/map[amqp.symbol]interface_{}-8 115B ± 0% 0B -100.00% (p=0.000 n=10+10) Marshal/amqp.UUID-8 16.0B ± 0% 0.0B -100.00% (p=0.000 n=10+10) Marshal/bool-8 0.00B 0.00B ~ (all equal) Marshal/int8-8 0.00B 0.00B ~ (all equal) Marshal/int8#01-8 0.00B 0.00B ~ (all equal) Marshal/int16-8 0.00B 0.00B ~ (all equal) Marshal/int16#01-8 0.00B 0.00B ~ (all equal) Marshal/int32-8 0.00B 0.00B ~ (all equal) Marshal/int32#01-8 0.00B 0.00B ~ (all equal) Marshal/int64-8 0.00B 0.00B ~ (all equal) Marshal/int64#01-8 0.00B 0.00B ~ (all equal) Marshal/uint8-8 0.00B 0.00B ~ (all equal) Marshal/uint16-8 0.00B 0.00B ~ (all equal) Marshal/uint32-8 0.00B 0.00B ~ (all equal) Marshal/uint64-8 0.00B 0.00B ~ (all equal) Marshal/float32-8 0.00B 0.00B ~ (all equal) Marshal/float32#01-8 0.00B 0.00B ~ (all equal) Marshal/float32#02-8 0.00B 0.00B ~ (all equal) Marshal/float32#03-8 0.00B 0.00B ~ (all equal) Marshal/float64-8 0.00B 0.00B ~ (all equal) Marshal/float64#01-8 0.00B 0.00B ~ (all equal) Marshal/float64#02-8 0.00B 0.00B ~ (all equal) Marshal/float64#03-8 0.00B 0.00B ~ (all equal) Marshal/amqp.describedType-8 0.00B 0.00B ~ (all equal) Marshal/map[interface_{}]interface_{}-8 115B ± 0% 0B -100.00% (p=0.000 n=10+10) Marshal/map[string]interface_{}-8 115B ± 0% 0B -100.00% (p=0.000 n=10+10) Marshal/amqp.ArrayUByte-8 0.00B 0.00B ~ (all equal) Marshal/[]int8-8 0.00B 0.00B ~ (all equal) Marshal/[]uint16-8 0.00B 0.00B ~ (all equal) Marshal/[]uint16#01-8 0.00B 0.00B ~ (all equal) Marshal/[]int16-8 0.00B 0.00B ~ (all equal) Marshal/[]int16#01-8 0.00B 0.00B ~ (all equal) Marshal/[]uint32-8 0.00B 0.00B ~ (all equal) Marshal/[]uint32#01-8 0.00B 0.00B ~ (all equal) Marshal/[]int32-8 0.00B 0.00B ~ (all equal) Marshal/[]int32#01-8 0.00B 0.00B ~ (all equal) Marshal/[]uint64-8 0.00B 0.00B ~ (all equal) Marshal/[]uint64#01-8 0.00B 0.00B ~ (all equal) Marshal/[]int64-8 0.00B 0.00B ~ (all equal) Marshal/[]int64#01-8 0.00B 0.00B ~ (all equal) Marshal/[]float32-8 0.00B 0.00B ~ (all equal) Marshal/[]float64-8 0.00B 0.00B ~ (all equal) Marshal/[]bool-8 0.00B 0.00B ~ (all equal) Marshal/[]string-8 0.00B 0.00B ~ (all equal) Marshal/[]amqp.symbol-8 0.00B 0.00B ~ (all equal) Marshal/[][]uint8-8 0.00B 0.00B ~ (all equal) Marshal/[]time.Time-8 0.00B 0.00B ~ (all equal) Marshal/[]amqp.UUID-8 16.0B ± 0% 0.0B -100.00% (p=0.000 n=10+10) Marshal/[]interface_{}-8 0.00B 0.00B ~ (all equal) Unmarshal/*amqp.performOpen-8 544B ± 0% 464B ± 0% -14.71% (p=0.000 n=10+10) Unmarshal/*amqp.performBegin-8 496B ± 0% 416B ± 0% -16.13% (p=0.000 n=10+10) Unmarshal/*amqp.performAttach-8 2.08kB ± 0% 2.00kB ± 0% -3.85% (p=0.000 n=10+10) Unmarshal/amqp.role-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/*amqp.unsettled-8 480B ± 0% 400B ± 0% -16.67% (p=0.000 n=10+10) Unmarshal/*amqp.source-8 928B ± 0% 848B ± 0% -8.62% (p=0.000 n=10+10) Unmarshal/*amqp.target-8 512B ± 0% 432B ± 0% -15.62% (p=0.000 n=10+10) Unmarshal/*amqp.performFlow-8 464B ± 0% 400B ± 0% -13.79% (p=0.000 n=10+10) Unmarshal/*amqp.performTransfer-8 168B ± 0% 96B ± 0% -42.86% (p=0.000 n=10+10) Unmarshal/*amqp.performDisposition-8 112B ± 0% 36B ± 0% -67.86% (p=0.000 n=10+10) Unmarshal/*amqp.performDetach-8 512B ± 0% 432B ± 0% -15.62% (p=0.000 n=10+10) Unmarshal/*amqp.performDetach#01-8 728B ± 0% 648B ± 0% -10.99% (p=0.000 n=10+10) Unmarshal/amqp.ErrorCondition-8 128B ± 0% 48B ± 0% -62.50% (p=0.000 n=10+10) Unmarshal/*amqp.Error-8 512B ± 0% 432B ± 0% -15.62% (p=0.000 n=10+10) Unmarshal/*amqp.performEnd-8 512B ± 0% 432B ± 0% -15.62% (p=0.000 n=10+10) Unmarshal/*amqp.performClose-8 512B ± 0% 432B ± 0% -15.62% (p=0.000 n=10+10) Unmarshal/*amqp.Message-8 1.73kB ± 0% 1.65kB ± 0% -4.63% (p=0.000 n=10+10) Unmarshal/*amqp.MessageHeader-8 128B ± 0% 48B ± 0% -62.50% (p=0.000 n=10+10) Unmarshal/*amqp.MessageProperties-8 208B ± 0% 128B ± 0% -38.46% (p=0.000 n=10+10) Unmarshal/*amqp.stateReceived-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/*amqp.stateAccepted-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/*amqp.stateRejected-8 517B ± 0% 437B ± 0% -15.47% (p=0.000 n=10+10) Unmarshal/*amqp.stateReleased-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/*amqp.stateModified-8 480B ± 0% 400B ± 0% -16.67% (p=0.000 n=10+10) Unmarshal/amqp.lifetimePolicy-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/amqp.SenderSettleMode-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/amqp.ReceiverSettleMode-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/*amqp.saslInit-8 134B ± 0% 54B ± 0% -59.70% (p=0.000 n=10+10) Unmarshal/*amqp.saslMechanisms-8 121B ± 0% 41B ± 0% -66.12% (p=0.000 n=10+10) Unmarshal/*amqp.saslOutcome-8 144B ± 0% 64B ± 0% -55.56% (p=0.000 n=10+10) Unmarshal/amqp.milliseconds-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/amqp.symbol-8 120B ± 0% 40B ± 0% -66.67% (p=0.000 n=10+10) Unmarshal/map[amqp.symbol]interface_{}-8 500B ± 0% 420B ± 0% -16.00% (p=0.000 n=10+10) Unmarshal/amqp.UUID-8 128B ± 0% 32B ± 0% -75.00% (p=0.000 n=10+10) Unmarshal/bool-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/int8-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/int8#01-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/int16-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/int16#01-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/int32-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/int32#01-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/int64-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/int64#01-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/uint8-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/uint16-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/uint32-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/uint64-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/float32-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/float32#01-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/float32#02-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/float32#03-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/float64-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/float64#01-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/float64#02-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/float64#03-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/amqp.describedType-8 184B ± 0% 104B ± 0% -43.48% (p=0.000 n=10+10) Unmarshal/map[interface_{}]interface_{}-8 500B ± 0% 420B ± 0% -16.00% (p=0.000 n=10+10) Unmarshal/map[string]interface_{}-8 500B ± 0% 420B ± 0% -16.00% (p=0.000 n=10+10) Unmarshal/amqp.ArrayUByte-8 112B ± 0% 40B ± 0% -64.29% (p=0.000 n=10+10) Unmarshal/[]int8-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/[]uint16-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/[]uint16#01-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/[]int16-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/[]int16#01-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/[]uint32-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/[]uint32#01-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/[]int32-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/[]int32#01-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/[]uint64-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/[]uint64#01-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/[]int64-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/[]int64#01-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/[]float32-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/[]float64-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/[]bool-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/[]string-8 121B ± 0% 41B ± 0% -66.12% (p=0.000 n=10+10) Unmarshal/[]amqp.symbol-8 121B ± 0% 41B ± 0% -66.12% (p=0.000 n=10+10) Unmarshal/[][]uint8-8 136B ± 0% 56B ± 0% -58.82% (p=0.000 n=10+10) Unmarshal/[]time.Time-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/[]amqp.UUID-8 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) Unmarshal/[]interface_{}-8 136B ± 0% 56B ± 0% -58.82% (p=0.000 n=10+10) name old allocs/op new allocs/op delta FrameMarshal/transfer-8 0.00 0.00 ~ (all equal) FrameUnmarshal/transfer-8 8.00 ± 0% 8.00 ± 0% ~ (all equal) Marshal/*amqp.performOpen-8 2.00 ± 0% 0.00 -100.00% (p=0.000 n=10+10) Marshal/*amqp.performBegin-8 2.00 ± 0% 0.00 -100.00% (p=0.000 n=10+10) Marshal/*amqp.performAttach-8 10.0 ± 0% 0.0 -100.00% (p=0.000 n=10+10) Marshal/amqp.role-8 0.00 0.00 ~ (all equal) Marshal/*amqp.unsettled-8 2.00 ± 0% 0.00 -100.00% (p=0.000 n=10+10) Marshal/*amqp.source-8 4.00 ± 0% 0.00 -100.00% (p=0.000 n=10+10) Marshal/*amqp.target-8 2.00 ± 0% 0.00 -100.00% (p=0.000 n=10+10) Marshal/*amqp.performFlow-8 2.00 ± 0% 0.00 -100.00% (p=0.000 n=10+10) Marshal/*amqp.performTransfer-8 0.00 0.00 ~ (all equal) Marshal/*amqp.performDisposition-8 0.00 0.00 ~ (all equal) Marshal/*amqp.performDetach-8 3.00 ± 0% 0.00 -100.00% (p=0.000 n=10+10) Marshal/*amqp.performDetach#01-8 4.00 ± 0% 0.00 -100.00% (p=0.000 n=10+10) Marshal/amqp.ErrorCondition-8 1.00 ± 0% 0.00 -100.00% (p=0.000 n=10+10) Marshal/*amqp.Error-8 3.00 ± 0% 0.00 -100.00% (p=0.000 n=10+10) Marshal/*amqp.performEnd-8 3.00 ± 0% 0.00 -100.00% (p=0.000 n=10+10) Marshal/*amqp.performClose-8 3.00 ± 0% 0.00 -100.00% (p=0.000 n=10+10) Marshal/*amqp.Message-8 9.00 ± 0% 0.00 -100.00% (p=0.000 n=10+10) Marshal/*amqp.MessageHeader-8 1.00 ± 0% 0.00 -100.00% (p=0.000 n=10+10) Marshal/*amqp.MessageProperties-8 0.00 0.00 ~ (all equal) Marshal/*amqp.stateReceived-8 0.00 0.00 ~ (all equal) Marshal/*amqp.stateAccepted-8 0.00 0.00 ~ (all equal) Marshal/*amqp.stateRejected-8 3.00 ± 0% 0.00 -100.00% (p=0.000 n=10+10) Marshal/*amqp.stateReleased-8 0.00 0.00 ~ (all equal) Marshal/*amqp.stateModified-8 2.00 ± 0% 0.00 -100.00% (p=0.000 n=10+10) Marshal/amqp.lifetimePolicy-8 0.00 0.00 ~ (all equal) Marshal/amqp.SenderSettleMode-8 0.00 0.00 ~ (all equal) Marshal/amqp.ReceiverSettleMode-8 0.00 0.00 ~ (all equal) Marshal/*amqp.saslInit-8 0.00 0.00 ~ (all equal) Marshal/*amqp.saslMechanisms-8 1.00 ± 0% 0.00 -100.00% (p=0.000 n=10+10) Marshal/*amqp.saslOutcome-8 1.00 ± 0% 0.00 -100.00% (p=0.000 n=10+10) Marshal/amqp.milliseconds-8 1.00 ± 0% 0.00 -100.00% (p=0.000 n=10+10) Marshal/amqp.symbol-8 0.00 0.00 ~ (all equal) Marshal/map[amqp.symbol]interface_{}-8 2.00 ± 0% 0.00 -100.00% (p=0.000 n=10+10) Marshal/amqp.UUID-8 1.00 ± 0% 0.00 -100.00% (p=0.000 n=10+10) Marshal/bool-8 0.00 0.00 ~ (all equal) Marshal/int8-8 0.00 0.00 ~ (all equal) Marshal/int8#01-8 0.00 0.00 ~ (all equal) Marshal/int16-8 0.00 0.00 ~ (all equal) Marshal/int16#01-8 0.00 0.00 ~ (all equal) Marshal/int32-8 0.00 0.00 ~ (all equal) Marshal/int32#01-8 0.00 0.00 ~ (all equal) Marshal/int64-8 0.00 0.00 ~ (all equal) Marshal/int64#01-8 0.00 0.00 ~ (all equal) Marshal/uint8-8 0.00 0.00 ~ (all equal) Marshal/uint16-8 0.00 0.00 ~ (all equal) Marshal/uint32-8 0.00 0.00 ~ (all equal) Marshal/uint64-8 0.00 0.00 ~ (all equal) Marshal/float32-8 0.00 0.00 ~ (all equal) Marshal/float32#01-8 0.00 0.00 ~ (all equal) Marshal/float32#02-8 0.00 0.00 ~ (all equal) Marshal/float32#03-8 0.00 0.00 ~ (all equal) Marshal/float64-8 0.00 0.00 ~ (all equal) Marshal/float64#01-8 0.00 0.00 ~ (all equal) Marshal/float64#02-8 0.00 0.00 ~ (all equal) Marshal/float64#03-8 0.00 0.00 ~ (all equal) Marshal/amqp.describedType-8 0.00 0.00 ~ (all equal) Marshal/map[interface_{}]interface_{}-8 2.00 ± 0% 0.00 -100.00% (p=0.000 n=10+10) Marshal/map[string]interface_{}-8 2.00 ± 0% 0.00 -100.00% (p=0.000 n=10+10) Marshal/amqp.ArrayUByte-8 0.00 0.00 ~ (all equal) Marshal/[]int8-8 0.00 0.00 ~ (all equal) Marshal/[]uint16-8 0.00 0.00 ~ (all equal) Marshal/[]uint16#01-8 0.00 0.00 ~ (all equal) Marshal/[]int16-8 0.00 0.00 ~ (all equal) Marshal/[]int16#01-8 0.00 0.00 ~ (all equal) Marshal/[]uint32-8 0.00 0.00 ~ (all equal) Marshal/[]uint32#01-8 0.00 0.00 ~ (all equal) Marshal/[]int32-8 0.00 0.00 ~ (all equal) Marshal/[]int32#01-8 0.00 0.00 ~ (all equal) Marshal/[]uint64-8 0.00 0.00 ~ (all equal) Marshal/[]uint64#01-8 0.00 0.00 ~ (all equal) Marshal/[]int64-8 0.00 0.00 ~ (all equal) Marshal/[]int64#01-8 0.00 0.00 ~ (all equal) Marshal/[]float32-8 0.00 0.00 ~ (all equal) Marshal/[]float64-8 0.00 0.00 ~ (all equal) Marshal/[]bool-8 0.00 0.00 ~ (all equal) Marshal/[]string-8 0.00 0.00 ~ (all equal) Marshal/[]amqp.symbol-8 0.00 0.00 ~ (all equal) Marshal/[][]uint8-8 0.00 0.00 ~ (all equal) Marshal/[]time.Time-8 0.00 0.00 ~ (all equal) Marshal/[]amqp.UUID-8 1.00 ± 0% 0.00 -100.00% (p=0.000 n=10+10) Marshal/[]interface_{}-8 0.00 0.00 ~ (all equal) Unmarshal/*amqp.performOpen-8 13.0 ± 0% 13.0 ± 0% ~ (all equal) Unmarshal/*amqp.performBegin-8 8.00 ± 0% 8.00 ± 0% ~ (all equal) Unmarshal/*amqp.performAttach-8 33.0 ± 0% 33.0 ± 0% ~ (all equal) Unmarshal/amqp.role-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/*amqp.unsettled-8 5.00 ± 0% 5.00 ± 0% ~ (all equal) Unmarshal/*amqp.source-8 15.0 ± 0% 15.0 ± 0% ~ (all equal) Unmarshal/*amqp.target-8 8.00 ± 0% 8.00 ± 0% ~ (all equal) Unmarshal/*amqp.performFlow-8 5.00 ± 0% 10.00 ± 0% +100.00% (p=0.000 n=10+10) Unmarshal/*amqp.performTransfer-8 4.00 ± 0% 6.00 ± 0% +50.00% (p=0.000 n=10+10) Unmarshal/*amqp.performDisposition-8 1.00 ± 0% 2.00 ± 0% +100.00% (p=0.000 n=10+10) Unmarshal/*amqp.performDetach-8 10.0 ± 0% 10.0 ± 0% ~ (all equal) Unmarshal/*amqp.performDetach#01-8 15.0 ± 0% 15.0 ± 0% ~ (all equal) Unmarshal/amqp.ErrorCondition-8 2.00 ± 0% 2.00 ± 0% ~ (all equal) Unmarshal/*amqp.Error-8 10.0 ± 0% 10.0 ± 0% ~ (all equal) Unmarshal/*amqp.performEnd-8 10.0 ± 0% 10.0 ± 0% ~ (all equal) Unmarshal/*amqp.performClose-8 10.0 ± 0% 10.0 ± 0% ~ (all equal) Unmarshal/*amqp.Message-8 33.0 ± 0% 33.0 ± 0% ~ (all equal) Unmarshal/*amqp.MessageHeader-8 2.00 ± 0% 2.00 ± 0% ~ (all equal) Unmarshal/*amqp.MessageProperties-8 12.0 ± 0% 12.0 ± 0% ~ (all equal) Unmarshal/*amqp.stateReceived-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/*amqp.stateAccepted-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/*amqp.stateRejected-8 10.0 ± 0% 10.0 ± 0% ~ (all equal) Unmarshal/*amqp.stateReleased-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/*amqp.stateModified-8 6.00 ± 0% 6.00 ± 0% ~ (all equal) Unmarshal/amqp.lifetimePolicy-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/amqp.SenderSettleMode-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/amqp.ReceiverSettleMode-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/*amqp.saslInit-8 4.00 ± 0% 4.00 ± 0% ~ (all equal) Unmarshal/*amqp.saslMechanisms-8 4.00 ± 0% 4.00 ± 0% ~ (all equal) Unmarshal/*amqp.saslOutcome-8 2.00 ± 0% 2.00 ± 0% ~ (all equal) Unmarshal/amqp.milliseconds-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/amqp.symbol-8 2.00 ± 0% 2.00 ± 0% ~ (all equal) Unmarshal/map[amqp.symbol]interface_{}-8 6.00 ± 0% 6.00 ± 0% ~ (all equal) Unmarshal/amqp.UUID-8 2.00 ± 0% 1.00 ± 0% -50.00% (p=0.000 n=10+10) Unmarshal/bool-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/int8-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/int8#01-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/int16-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/int16#01-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/int32-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/int32#01-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/int64-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/int64#01-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/uint8-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/uint16-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/uint32-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/uint64-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/float32-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/float32#01-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/float32#02-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/float32#03-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/float64-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/float64#01-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/float64#02-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/float64#03-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/amqp.describedType-8 4.00 ± 0% 4.00 ± 0% ~ (all equal) Unmarshal/map[interface_{}]interface_{}-8 6.00 ± 0% 6.00 ± 0% ~ (all equal) Unmarshal/map[string]interface_{}-8 6.00 ± 0% 6.00 ± 0% ~ (all equal) Unmarshal/amqp.ArrayUByte-8 1.00 ± 0% 2.00 ± 0% +100.00% (p=0.000 n=10+10) Unmarshal/[]int8-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/[]uint16-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/[]uint16#01-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/[]int16-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/[]int16#01-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/[]uint32-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/[]uint32#01-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/[]int32-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/[]int32#01-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/[]uint64-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/[]uint64#01-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/[]int64-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/[]int64#01-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/[]float32-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/[]float64-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/[]bool-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/[]string-8 4.00 ± 0% 4.00 ± 0% ~ (all equal) Unmarshal/[]amqp.symbol-8 4.00 ± 0% 4.00 ± 0% ~ (all equal) Unmarshal/[][]uint8-8 4.00 ± 0% 4.00 ± 0% ~ (all equal) Unmarshal/[]time.Time-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/[]amqp.UUID-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Unmarshal/[]interface_{}-8 4.00 ± 0% 4.00 ± 0% ~ (all equal) ```
2018-02-03 22:54:49 +03:00
17: "\xf0\x00\x00\x00\x01@\x00TRUE\x00",
18: "\xf0\x00\x00\x00\x00\x10RTRT",
19: "\x00p\x00inp\xf0\x00\x00\x00\x01p\x00inp",
}
for i, tt := range tests {
t.Run(strconv.Itoa(i), func(t *testing.T) {
fuzzUnmarshal([]byte(tt))
2017-04-24 06:24:12 +03:00
})
}
}
func testDirFiles(t *testing.T, dir string) []string {
finfos, err := os.ReadDir(dir)
2017-04-27 06:35:29 +03:00
if err != nil {
t.Fatal(err)
2017-04-24 06:24:12 +03:00
}
var fullpaths []string
2017-04-27 06:35:29 +03:00
for _, finfo := range finfos {
fullpaths = append(fullpaths, filepath.Join(dir, finfo.Name()))
}
2017-04-24 06:24:12 +03:00
return fullpaths
}
2017-04-24 06:24:12 +03:00
func TestFuzzConnCorpus(t *testing.T) {
if os.Getenv("TEST_CORPUS") == "" {
t.Skip("set TEST_CORPUS to enable")
}
2017-04-24 06:24:12 +03:00
for _, path := range testDirFiles(t, "internal/encoding/testdata/fuzz/conn/corpus") {
t.Run(filepath.Base(path), func(t *testing.T) {
data, err := os.ReadFile(path)
2017-04-27 06:35:29 +03:00
if err != nil {
t.Fatal(err)
2017-04-27 06:35:29 +03:00
}
2017-04-24 06:24:12 +03:00
defer leaktest.Check(t)()
fuzzConn(data)
})
}
}
2017-04-24 06:24:12 +03:00
func TestFuzzMarshalCorpus(t *testing.T) {
if os.Getenv("TEST_CORPUS") == "" {
t.Skip("set TEST_CORPUS to enable")
}
for _, path := range testDirFiles(t, "internal/encoding/testdata/fuzz/marshal/corpus") {
t.Run(filepath.Base(path), func(t *testing.T) {
data, err := os.ReadFile(path)
2017-04-27 06:35:29 +03:00
if err != nil {
t.Fatal(err)
2017-04-27 06:35:29 +03:00
}
fuzzUnmarshal(data)
2017-04-27 06:35:29 +03:00
})
}
2017-04-24 06:24:12 +03:00
}