This is an automated email from the ASF dual-hosted git repository.

gabriellee pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 98c74f9ab8 [improvement](signal) add tid during core dump,the tid is 
equal to tid in be.INFO (#15893)
98c74f9ab8 is described below

commit 98c74f9ab8ecc3b0ab5e34a0de3cbc6cb298fc86
Author: yiguolei <[email protected]>
AuthorDate: Sat Jan 14 18:40:02 2023 +0800

    [improvement](signal) add tid during core dump,the tid is equal to tid in 
be.INFO (#15893)
    
    Co-authored-by: yiguolei <[email protected]>
---
 be/src/common/signal_handler.h | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/be/src/common/signal_handler.h b/be/src/common/signal_handler.h
index a89451e03d..e88829441d 100644
--- a/be/src/common/signal_handler.h
+++ b/be/src/common/signal_handler.h
@@ -307,7 +307,15 @@ void DumpSignalInfo(int signal_number, siginfo_t* siginfo) 
{
     formatter.AppendString(")");
     formatter.AppendString(" received by PID ");
     formatter.AppendUint64(static_cast<uint64>(getpid()), 10);
-    formatter.AppendString(" (TID 0x");
+    formatter.AppendString(" (TID ");
+    uint64_t tid;
+#ifdef __APPLE__
+    pthread_threadid_np(nullptr, &tid);
+#else
+    tid = syscall(SYS_gettid);
+#endif
+    formatter.AppendUint64(tid, 10);
+    formatter.AppendString(" OR 0x");
     // We assume pthread_t is an integral number or a pointer, rather
     // than a complex struct.  In some environments, pthread_self()
     // returns an uint64 but in some other environments pthread_self()


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to