-
Notifications
You must be signed in to change notification settings - Fork 451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parent-Child discover error in examples/simple when built as release and shared library. #1014
Comments
This is weird. It works fine with |
Note that the traceid is also different. Some guesses when compiler doing optimization, the thread local "Stack" in runtime_context behave funny. Just a thought. |
@lalitb This is our patch:
It seems to be a bug in gcc that somehow lost track of the static storage property for |
This issue was marked as stale due to lack of activity. It will be closed in 7 days if no furthur activity occurs. |
Closed as inactive. Feel free to reopen if this is still an issue. |
Problem still exists but no longer relevant to us since we have the workaround. |
This issue was marked as stale due to lack of activity. It will be closed in 7 days if no furthur activity occurs. |
Closed as inactive. Feel free to reopen if this is still an issue. |
@Pupilsch Did you figure out how to solve the issue ?
But it's working fine on my Ubuntu 20.04 with gcc 9.4.0 (and also 8.4.0) and C++ 17 |
@Briac-nt If it is the same problem, the patch from @cqhan777 should work for you: Please confirm. |
Hi @lalitb , unfortunately this patch doesn't work for me, the trick in the 1223 issue neither. |
I think I have a similar issue, but more complex setup. I'm compiling otel as a static library, but then building a shared library out of that static lib. And it doesn't seem to always lose the stack, only sometimes. Not sure how to provide more info, it's super complex and I only see this happening in my production system |
@Falmarri Thanks, can you also add the platform details here - (linux-distro, gcc version, build flags etc) |
@lalitb This is built on
I'm not entirely sure this is the same issue now that I've looked a bit furhter. What I'm seeing is that the trace is actually being propagated correctly. That is, I do this
and the remote service correctly gets the right trace/span. So I actually do have the right context. However, the span in question is never actually exported, so that my span never shows up in my collector and the traces are pretty broken. The reason I think it's related to this though is because it's always this 1 particular span, and this span is in a separate compilation unit from the rest of the shared lib. So how this works is that I have the following:
I realize this isn't a lot of information but like I said this only happens in our production system and I can't reproduce it on demand or figure out if there's a pattern |
Describe your environment
My system is Ubuntu 18.04.5 LTS. And the compiler is gcc 7.5.0
Steps to reproduce
I am trying to use opentelemetry as a shared library for my project. But I found that when I try to build it as release and shared library, there is some error in Parent-Child discover. The problem can be reproduced by just running the examples/simple/example_simple. Build in Debug(default) in cmake or static library wont show this error.
I use the following code to build.
cmake .. -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON
cmake --build . --target all
What is the expected behavior?
In example/simple the parent_span_id of f1 should be span_id of f2. And parent_span_id of f2 should be span_id of library. But both showing 0000000000000000.
What is the actual behavior?
Also the there is a test failed passing.
The text was updated successfully, but these errors were encountered: