Skip to content

Instantly share code, notes, and snippets.

View trask's full-sized avatar

Trask Stalnaker trask

  • Microsoft
  • Portland, OR
View GitHub Profile
@trask
trask / gist.md
Last active October 6, 2023 07:42

Scenario 1: Simple

simple

Scenario 2: Forward proxy

forward-proxy

Scenario 3: Reverse proxy

Logical vs physical separation

Scenario 1: Simple

simple

Scenario 2: Forward proxy

forward-proxy

Typical HTTP instrumentation - network.client.*, network.server.*, no duplication

Scenario 1: Simple

simple

Scenario 2: Forward proxy

forward-proxy

/*
* Copyright 2015-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
/*
* Copyright 2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@trask
trask / Agent.java
Created June 13, 2014 08:03
ClassFileTransformer.transform() can be passed null className
import java.lang.instrument.Instrumentation;
public class Agent {
public static void premain(String agentArgs, Instrumentation instrumentation) {
instrumentation.addTransformer(new Transformer());
}
}
@trask
trask / Agent.java
Last active August 29, 2015 14:01
ClassFileTransformer.transform() can be passed null protectionDomain
import java.lang.instrument.Instrumentation;
public class Agent {
public static void premain(String agentArgs, Instrumentation instrumentation) {
instrumentation.addTransformer(new Transformer());
}
}
Found one Java-level deadlock:
=============================
"Informant-New I/O server boss #1 ([id: 0x7f401d28, /0:0:0:0:0:0:0:0:4000])":
waiting to lock monitor 0x00007fa184005f10 (object 0x00000000dae2db50, a sun.misc.Launcher$AppClassLoader),
which is held by "main"
"main":
waiting to lock monitor 0x00007fa184004578 (object 0x00000000fbf72f00, a <unknown>),
which is held by "Informant-New I/O server boss #1 ([id: 0x7f401d28, /0:0:0:0:0:0:0:0:4000])"
Java stack information for the threads listed above: