Comments (11)
Is there a reason why you're enabling TRACY_DELAYED_INIT
?
from tracy.
It was just an attempt to resolve this issue.
from tracy.
This is likely caused by rpmalloc not being initialized. The crash trace points out to a call to tracy_malloc
in Profiler
constructor (i.e. m_buffer( (char*)tracy_malloc( TargetFrameSize*3 ) )
).
In case of TRACY_DELAYED_INIT
being enabled, rpmalloc initialization should be performed during construction of struct ProfilerData
, by RPMallocInit rpmalloc_init
field being before Profiler profiler
.
In the other case, rpmalloc initialization is done by specifying initialization order, placing static RPMallocInit init_order(102) s_rpmalloc_init
before static Profiler init_order(105) s_profiler
. init_order
is an alias for __attribute__ ((init_priority(val)))
.
I can't repro this on my side.
from tracy.
Thanks. So if I get the fault with TRACY_DELAYED_INIT
in either state and this is part of init_order
even manually calling init rpmalloc somewhere early won't help.
Can I assume the issue I am seeing is due to either the use of threads or shared objects?
from tracy.
It may be related to usage of multiple shared objects.
You may workaround this by using malloc
/free
in common/TracyAlloc.hpp
.
from tracy.
Hmmm .... with standard malloc and free it changes things, different point of failure but no further along. I think i'm going to have to workaround this by profiling my code standalone (on ARM) without the extra Android .apk and shared objects baggage.
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
lib/arm64/libandroid_native_app_glue.so (_ZTHN5tracy22s_rpmalloc_thread_initE+20)
lib/arm64/libandroid_native_app_glue.so (_ZTWN5tracy7s_tokenE+8)
lib/arm64/libandroid_native_app_glue.so (_ZN5tracy8GetTokenEv+8)
lib/arm64/libandroid_native_app_glue.so (_ZN5tracy8Profiler14CalibrateDelayEv+240)
lib/arm64/libandroid_native_app_glue.so (_ZN5tracy8ProfilerC1Ev+340)
lib/arm64/libandroid_native_app_glue.so (__cxx_global_var_init.8+24)
lib/arm64/libandroid_native_app_glue.so (_GLOBAL__I_000105+8)
/system/bin/linker64 (__dl__ZN6soinfo10call_arrayEPKcPPFvvEmb+348)
/system/bin/linker64 (__dl__Z9do_dlopenPKciPK17android_dlextinfoPv+2112)
/system/bin/linker64 (__dl_android_dlopen_ext+60)
/system/lib64/libnativeloader.so (_ZN7android17OpenNativeLibraryEP7_JNIEnviPKcP8_jobjectP8_jstring+244)
/system/lib64/libart.so (_ZN3art9JavaVMExt17LoadNativeLibraryEP7_JNIEnvRKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEP8_jobjectP8_jstringPS9_+1016)
/system/lib64/libopenjdkjvm.so (JVM_NativeLoad+284)
/system/framework/arm64/boot.oat (offset 0x54e000) (java.lang.Runtime.nativeLoad+204)
/system/framework/arm64/boot.oat (offset 0x54e000) (java.lang.Runtime.doLoad+204)
/system/framework/arm64/boot.oat (offset 0x54e000) (java.lang.Runtime.loadLibrary0+748)
/system/framework/arm64/boot.oat (offset 0x54e000) (java.lang.System.loadLibrary+96)
/system/lib64/libart.so (art_quick_invoke_static_stub+600)
/system/lib64/libart.so (_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+256)
/system/lib64/libart.so (_ZN3art11interpreter34ArtInterpreterToCompiledCodeBridgeEPNS_6ThreadEPNS_9ArtMethodEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+312)
/system/lib64/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+528)
/system/lib64/libart.so (MterpInvokeStatic+356)
/system/lib64/libart.so (ExecuteMterpImpl+14612)
Note i've shown the deeper stack trace this time starting with the Android Runtime libart.so. I guess Tracy needs to be initialised much earlier on in this sequence?
from tracy.
I guess Tracy needs to be initialised much earlier on in this sequence?
It should be fine as it is.
I guess you can try debugging it by setting a breakpoint in RPMallocInit()
and InitOnceCallback()
. Everything points to some problems there.
from tracy.
Calling ___tracy_init_thread
before any calls to tracy APIs could help to narrow down the issue to initialization problems.
from tracy.
Unfortunately it looks like the issue is occurring during global init - before any of my calls to Tracy, so thereโs not room to add that call first.
from tracy.
All rpmalloc issues should be fixed by b0fc0d5.
from tracy.
@babelchips Have you found a good method of getting the Java frames in the trace? At a glance your stack trace looks like java code. Thanks!
from tracy.
Related Issues (20)
- Feature Request: Searchable Metadata HOT 2
- Memory allocations call stacks: Logic for active and inactive allocations is swapped HOT 1
- No statistics for GPU zones? HOT 1
- Link error on VS 17.9 RelWithDebInfo but fine in Debug (tracy 0.10) HOT 3
- Bazel Support
- Undeclared identifier when compiling TracyD3D11.hpp with TRACY_ON_DEMAND HOT 2
- Negative TscTime triggered assertion HOT 5
- Error during Tracy profile make HOT 3
- Fails to open native file dialog on Kubuntu HOT 1
- Fails to build with `GTK_FILESELECTOR=ON` on Kubuntu HOT 1
- tracy::DecodeCallstackPtr crashes if called too early
- Group GPU scopes by Vulkan queues instead of CPU thread
- Tracy-Release unix build Fails with capstone API reference Linker failure HOT 3
- API to emit zone with static name string HOT 2
- CPU sampling stops working after short period of time HOT 2
- Tracy profiler - unable to connect to Client - "waiting for connection" HOT 1
- ON_DEMAND mode causes deadlock with static initalization. HOT 6
- Memory leak of 16416 bytes on Windows.
- Profiler: Custom namespace delimiter for zone name shortening HOT 2
- Manual out of date for building on Windows HOT 3
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 tracy.