<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: pthread_kill(threadid, sigusr2) dumps core with SIGSEGV in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/pthread-kill-threadid-sigusr2-dumps-core-with-sigsegv/m-p/4260623#M62628</link>
    <description>I seriously doubt you can do that.  thread_t is private to the process.  On HP-UX pthread_kill(3) says:&lt;BR /&gt;The signal is asynchronously directed to thread in the calling process.</description>
    <pubDate>Sun, 02 Nov 2008 10:52:27 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2008-11-02T10:52:27Z</dc:date>
    <item>
      <title>pthread_kill(threadid, sigusr2) dumps core with SIGSEGV</title>
      <link>https://community.hpe.com/t5/operating-system-linux/pthread-kill-threadid-sigusr2-dumps-core-with-sigsegv/m-p/4260622#M62627</link>
      <description>Hello ,&lt;BR /&gt;   I have &lt;BR /&gt;{MM8}root@Node2:/data/tmp# uname -a&lt;BR /&gt;Linux Node2 2.6.10-telco-1.46-mckinley-smp #1 SMP Fri May 30 18:29:43 UTC 2008 ia64 GNU/Linux&lt;BR /&gt;# ls /lib/libpthread*&lt;BR /&gt;libpthread-0.10.so  libpthread.so.0&lt;BR /&gt;&lt;BR /&gt;I have 2-processes (lets say p1 and p2)&lt;BR /&gt;p1 has about 49 threads&lt;BR /&gt;p2 has about 17 threads&lt;BR /&gt;&lt;BR /&gt;If p1 hangs , then p2 sends a signal SIGUSR2 using pthread_kill(threadid_p1, sigusr2)&lt;BR /&gt;&lt;BR /&gt;While doing so , pthread_kill dumped core, stack trace is as below&lt;BR /&gt;==========================&lt;BR /&gt;Program terminated with signal 11, Segmentation fault.&lt;BR /&gt;#0  0x20000000000ffef0 in pthread_kill () from /lib/tls/libpthread.so.0&lt;BR /&gt;(gdb) bt&lt;BR /&gt;#0  0x20000000000ffef0 in pthread_kill () from /lib/tls/libpthread.so.0&lt;BR /&gt;==============================&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;ls -lrt /lib/tls/libpthread.so.0 &lt;BR /&gt;lrwxrwxrwx  1 root root 18 Aug 29 11:18 /lib/tls/libpthread.so.0 -&amp;gt; libpthread-0.60.so&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Advance thanks for the help&lt;BR /&gt;</description>
      <pubDate>Sat, 30 Aug 2008 05:31:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/pthread-kill-threadid-sigusr2-dumps-core-with-sigsegv/m-p/4260622#M62627</guid>
      <dc:creator>KRUPASINDHU PRADHAN</dc:creator>
      <dc:date>2008-08-30T05:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: pthread_kill(threadid, sigusr2) dumps core with SIGSEGV</title>
      <link>https://community.hpe.com/t5/operating-system-linux/pthread-kill-threadid-sigusr2-dumps-core-with-sigsegv/m-p/4260623#M62628</link>
      <description>I seriously doubt you can do that.  thread_t is private to the process.  On HP-UX pthread_kill(3) says:&lt;BR /&gt;The signal is asynchronously directed to thread in the calling process.</description>
      <pubDate>Sun, 02 Nov 2008 10:52:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/pthread-kill-threadid-sigusr2-dumps-core-with-sigsegv/m-p/4260623#M62628</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-11-02T10:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: pthread_kill(threadid, sigusr2) dumps core with SIGSEGV</title>
      <link>https://community.hpe.com/t5/operating-system-linux/pthread-kill-threadid-sigusr2-dumps-core-with-sigsegv/m-p/4260624#M62629</link>
      <description>You are right..&lt;BR /&gt;In fact , its one process and has multiple threads. I got the root cause for this issue.&lt;BR /&gt;When you pass on invalid thread ID to pthread_kill, it dumps core.&lt;BR /&gt;&lt;BR /&gt;int main (int argc, char* const argv [])&lt;BR /&gt;{&lt;BR /&gt;    int iRet = 0;&lt;BR /&gt;    iRet = pthread_kill (123, 0); /* 123 is invalid thread ID */&lt;BR /&gt;    printf("iRet = %d\n", iRet);&lt;BR /&gt;    return 0;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;{MM4}root@Node2:/tmp# cc invalidthread.c -lpthread&lt;BR /&gt;{MM4}root@Node2:/tmp# ./a.out&lt;BR /&gt;Segmentation fault (core dumped)&lt;BR /&gt;&lt;BR /&gt;I confirmed it. But I am baffled why would we get core dump instead of ESRCH error code.&lt;BR /&gt;As par man page of pthread_kill&lt;BR /&gt; &lt;BR /&gt;              !ESRCH!&lt;BR /&gt;                     the  thread  |thread| does not exist (e.g. it has already&lt;BR /&gt;                     terminated)</description>
      <pubDate>Sun, 02 Nov 2008 16:51:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/pthread-kill-threadid-sigusr2-dumps-core-with-sigsegv/m-p/4260624#M62629</guid>
      <dc:creator>KRUPASINDHU PRADHAN</dc:creator>
      <dc:date>2008-11-02T16:51:24Z</dc:date>
    </item>
    <item>
      <title>Re: pthread_kill(threadid, sigusr2) dumps core with SIGSEGV</title>
      <link>https://community.hpe.com/t5/operating-system-linux/pthread-kill-threadid-sigusr2-dumps-core-with-sigsegv/m-p/4260625#M62630</link>
      <description>&amp;gt;But I am baffled why would we get core dump instead of ESRCH error code.&lt;BR /&gt;&lt;BR /&gt;Because exhaustively checking is costly and probably not required.  And you don't have anything remotely like a valid pthread_t as you show in your other thread:&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1284229" target="_blank"&gt;http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1284229&lt;/A&gt;</description>
      <pubDate>Sun, 02 Nov 2008 21:08:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/pthread-kill-threadid-sigusr2-dumps-core-with-sigsegv/m-p/4260625#M62630</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-11-02T21:08:53Z</dc:date>
    </item>
  </channel>
</rss>

