Comments (10)
[author="m_hess", created="Fri, 2 Oct 2009 17:07:41 +0200"]
Sorry about the mess with the curly braces. Somehow the formatting did not work as expected.
from btrace.
[author="jbachorik", created="Sat, 10 Oct 2009 18:19:11 +0200"]
The whole problem is in the fact that the expression
@tls =
will get transformed into something like
=
ThreadLocal variable = new ThreadLocal() {
protected Object initialValue()
{
return
}
}
as Michael pointed out and this transformation is completely wrong. This implementation works correctly for immutable objects only.
A correct solution would be to generate the following construct instead:
ThreadLocal variable = new ThreadLocal() {
protected Object initialValue()
{
return ;
}
}
Unfortunately, all those transformations are done on an already compiled BTrace probe and extracting the field initializer from the bytecode is almost impossible using the ASM Core APIs only. In order to be able to generate the required code we would need either to use the ASM Tree API for advanced transformations or to pre-process the source code to wrap the initializer expression properly.
Either way, the proper fix would mean significant changes in the BTrace core and as such it will require careful architecting.
A bit "hackish" fix would be to force the objects used as @tls into being "Cloneable" and rewrite the BTraceRuntime method to clone the initValue if possible. I will attach webrev for this patch shortly.
from btrace.
[author="jbachorik", created="Sat, 10 Oct 2009 18:20:07 +0200"]
Webrev for the proposed patch
from btrace.
[author="m_hess", created="Mon, 12 Oct 2009 09:32:58 +0200"]
Thanks for taking care of this. Unfortunately I don't know how the process can commence.
Is there some action I need to take, like making a review of your patch?
If so, could you point me in the right direction of needed formalities? I don't konw much about webrev.
from btrace.
[author="jbachorik", created="Mon, 12 Oct 2009 09:46:15 +0200"]
The webrev is there more for Sundar (who originally wrote the whole BTrace core) to verify that I am not breaking anything.
As for webrev - you can finde index.html inside the archive which you can open in your web browser and browse the patch in a user friendly way. Also, the webrev contains the "btrace.patch" file which you can "hg import" into your btrace working directory, rebuild and test.
from btrace.
[author="m_hess", created="Tue, 13 Oct 2009 14:11:41 +0200"]
I imported the patch into my local repository. It looks good so far, the testcase I created runs smoothly now.
"Hackish" - indeed, but it gets the job done for now. Thanks Jaroslav!
I suggest that you enhance the TLS JavaDoc to tell that the instance that is initially declared and created gets cloned and is never used itself. This might avoid some confusion on the users side, if for whatever reasons values/state get lost during the clone() operation.
I could imagine a situation were someone initializes an instance with some value and annotates it with TLS. If the clone() operation (which BTrace has no influence upon) does not clone the aforementioned value, then this might cause some headaches.
Maybe far fetched / too theoretical, but maybe still worth mentioning.
from btrace.
[author="jbachorik", created="Mon, 19 Oct 2009 14:56:23 +0200"]
Patch delivered in http://kenai.com/projects/btrace/sources/hg/revision/214
from btrace.
[author="jbachorik", created="Mon, 19 Oct 2009 15:15:11 +0200"]
updated user guide
from btrace.
[author="jbachorik", created="Wed, 6 Jan 2010 15:54:41 +0100"]
Please, verify and close this issue
from btrace.
[author="m_hess", created="Fri, 8 Jan 2010 16:22:05 +0100"]
I would love to close this, but all operations available to me (see screenshot) do not offer any fitting operation.
Jaroslav, can you have my permissions adjusted?
from btrace.
Related Issues (20)
- Does the BTrace agent support java 17? HOT 1
- Unsupported class file major version 29281 HOT 5
- Is adding method printStrings with a ... array possible? HOT 4
- Javaagent args for output directory seems wrong HOT 3
- Btrace doesn't trace methods when trusted is true HOT 1
- Adding XStream to the dependencies error HOT 2
- JAR artifacts are shadowed with the version number
- [BTRACE WARN] Class verification failed:
- Windows batch scripts do not work properly HOT 2
- Build fails with missing artifact HOT 4
- NoClassDefFoundError for NonBlockingIdentityHashMap when running an application with BTrace HOT 4
- Review target compileJava15Java in btrace-runtime/build.gradle
- NoClassDefFoundError for ConcurrentAutoTable and others when running an application with BTrace HOT 1
- VerifyError: Bad type on operand stack HOT 2
- MT-safety of HistoOnEvent example HOT 5
- The gradle-wrapper.jar is stale with respect to gradle version. HOT 1
- Does the BTrace agent support java 21? HOT 3
- Clarify the versions of java which Btrace can target HOT 2
- help!! btrace issue HOT 8
- BTrace v2.0.2 is unable to enable the unsafe mode
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from btrace.