<?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 Getting core dump while dealing with TRY/CATCH exceptions in HP-UX 11V2 in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/getting-core-dump-while-dealing-with-try-catch-exceptions-in-hp/m-p/3992941#M95960</link>
    <description>&lt;BR /&gt;Problem Description:&lt;BR /&gt;Getting core dump while dealing with TRY/CATCH exceptions in HP-UX 11V2.&lt;BR /&gt;&lt;BR /&gt;Below is the sample test program to verify the TRY/CATCH exceptional handling calls.&lt;BR /&gt;&lt;BR /&gt;#include&lt;STDIO.H&gt;&lt;BR /&gt;#include&lt;STRING.H&gt;&lt;BR /&gt;                        /* prototyping of functions   */&lt;BR /&gt;                        /* to allow type checks by    */&lt;BR /&gt;                        /* the compiler               */&lt;BR /&gt;#include &lt;PTHREAD_EXC.H&gt;&lt;BR /&gt;#include &lt;DCE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;void main()&lt;BR /&gt;{&lt;BR /&gt;    int  n;&lt;BR /&gt;    char string[50];&lt;BR /&gt;                        /* strcpy(a,b) copies string b into a */&lt;BR /&gt;                        /* defined via the stdio.h header     */&lt;BR /&gt;    strcpy(string, "Hello World");&lt;BR /&gt;&lt;BR /&gt;                        /* call own function */&lt;BR /&gt;    n = n_char(string);&lt;BR /&gt;    printf("Length of string = %d\n", n);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;                        /* definition of local function n_char */&lt;BR /&gt;int n_char(char string[])&lt;BR /&gt;{&lt;BR /&gt;                        /* local variable in this function   */&lt;BR /&gt;    int n;&lt;BR /&gt;                        /* strlen(a) returns the length of   */&lt;BR /&gt;                        /* string a                          */&lt;BR /&gt;                        /* defined via the string.h header   */&lt;BR /&gt;TRY&lt;BR /&gt;printf("HAI \n");&lt;BR /&gt;CATCH_ALL&lt;BR /&gt;        printf("CATCH_ALL \n");&lt;BR /&gt;ENDTRY&lt;BR /&gt;    n = strlen(string);&lt;BR /&gt;    if (n &amp;gt; 50)&lt;BR /&gt;        printf("String is longer than 50 characters\n");&lt;BR /&gt;&lt;BR /&gt;                        /* return the value of integer n  */&lt;BR /&gt;    return n;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Compilation option given : cc -ldcekt test.c.. &lt;BR /&gt;&lt;BR /&gt;Though the compilation went fine, execution is failed with 'core dump' error.&lt;BR /&gt;&lt;BR /&gt;:cc -ldcekt test.c&lt;BR /&gt;:a.out&lt;BR /&gt;Memory fault(coredump)&lt;BR /&gt;&lt;BR /&gt;While debugging with gdb, found that it fails while calling 'TRY'. Below is the gdb output :&lt;BR /&gt;&lt;BR /&gt;Program received signal SIGSEGV, Segmentation fault&lt;BR /&gt;  si_code: 2 - SEGV_ACCERR - Invalid Permissions for object.&lt;BR /&gt;0x4000e40:0 in n_char () at test.c:35&lt;BR /&gt;35      TRY&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Could you please let me know if compilation option needs to be changed to avoid getting 'core dump'?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance for your help.&lt;BR /&gt;&lt;/DCE&gt;&lt;/PTHREAD_EXC.H&gt;&lt;/STRING.H&gt;&lt;/STDIO.H&gt;</description>
    <pubDate>Thu, 03 May 2007 02:18:38 GMT</pubDate>
    <dc:creator>sasikala</dc:creator>
    <dc:date>2007-05-03T02:18:38Z</dc:date>
    <item>
      <title>Getting core dump while dealing with TRY/CATCH exceptions in HP-UX 11V2</title>
      <link>https://community.hpe.com/t5/operating-system-linux/getting-core-dump-while-dealing-with-try-catch-exceptions-in-hp/m-p/3992941#M95960</link>
      <description>&lt;BR /&gt;Problem Description:&lt;BR /&gt;Getting core dump while dealing with TRY/CATCH exceptions in HP-UX 11V2.&lt;BR /&gt;&lt;BR /&gt;Below is the sample test program to verify the TRY/CATCH exceptional handling calls.&lt;BR /&gt;&lt;BR /&gt;#include&lt;STDIO.H&gt;&lt;BR /&gt;#include&lt;STRING.H&gt;&lt;BR /&gt;                        /* prototyping of functions   */&lt;BR /&gt;                        /* to allow type checks by    */&lt;BR /&gt;                        /* the compiler               */&lt;BR /&gt;#include &lt;PTHREAD_EXC.H&gt;&lt;BR /&gt;#include &lt;DCE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;void main()&lt;BR /&gt;{&lt;BR /&gt;    int  n;&lt;BR /&gt;    char string[50];&lt;BR /&gt;                        /* strcpy(a,b) copies string b into a */&lt;BR /&gt;                        /* defined via the stdio.h header     */&lt;BR /&gt;    strcpy(string, "Hello World");&lt;BR /&gt;&lt;BR /&gt;                        /* call own function */&lt;BR /&gt;    n = n_char(string);&lt;BR /&gt;    printf("Length of string = %d\n", n);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;                        /* definition of local function n_char */&lt;BR /&gt;int n_char(char string[])&lt;BR /&gt;{&lt;BR /&gt;                        /* local variable in this function   */&lt;BR /&gt;    int n;&lt;BR /&gt;                        /* strlen(a) returns the length of   */&lt;BR /&gt;                        /* string a                          */&lt;BR /&gt;                        /* defined via the string.h header   */&lt;BR /&gt;TRY&lt;BR /&gt;printf("HAI \n");&lt;BR /&gt;CATCH_ALL&lt;BR /&gt;        printf("CATCH_ALL \n");&lt;BR /&gt;ENDTRY&lt;BR /&gt;    n = strlen(string);&lt;BR /&gt;    if (n &amp;gt; 50)&lt;BR /&gt;        printf("String is longer than 50 characters\n");&lt;BR /&gt;&lt;BR /&gt;                        /* return the value of integer n  */&lt;BR /&gt;    return n;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Compilation option given : cc -ldcekt test.c.. &lt;BR /&gt;&lt;BR /&gt;Though the compilation went fine, execution is failed with 'core dump' error.&lt;BR /&gt;&lt;BR /&gt;:cc -ldcekt test.c&lt;BR /&gt;:a.out&lt;BR /&gt;Memory fault(coredump)&lt;BR /&gt;&lt;BR /&gt;While debugging with gdb, found that it fails while calling 'TRY'. Below is the gdb output :&lt;BR /&gt;&lt;BR /&gt;Program received signal SIGSEGV, Segmentation fault&lt;BR /&gt;  si_code: 2 - SEGV_ACCERR - Invalid Permissions for object.&lt;BR /&gt;0x4000e40:0 in n_char () at test.c:35&lt;BR /&gt;35      TRY&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Could you please let me know if compilation option needs to be changed to avoid getting 'core dump'?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance for your help.&lt;BR /&gt;&lt;/DCE&gt;&lt;/PTHREAD_EXC.H&gt;&lt;/STRING.H&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Thu, 03 May 2007 02:18:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/getting-core-dump-while-dealing-with-try-catch-exceptions-in-hp/m-p/3992941#M95960</guid>
      <dc:creator>sasikala</dc:creator>
      <dc:date>2007-05-03T02:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: Getting core dump while dealing with TRY/CATCH exceptions in HP-UX 11.23</title>
      <link>https://community.hpe.com/t5/operating-system-linux/getting-core-dump-while-dealing-with-try-catch-exceptions-in-hp/m-p/3992942#M95961</link>
      <description>&lt;P&gt;Not that this is your direct problem:&lt;BR /&gt;char string[50];&lt;BR /&gt;&lt;BR /&gt;This will only take a string of 49 bytes, plus the null character.&lt;BR /&gt;&lt;BR /&gt;if (n &amp;gt; 50)&lt;BR /&gt;&lt;BR /&gt;corruption has already occurred if the string is 50 bytes.&lt;BR /&gt;&lt;BR /&gt;Program received signal SIGSEGV, Segmentation fault Invalid Permissions for object.&lt;BR /&gt;0x4000e40:0 in n_char () at test.c:35&lt;BR /&gt;35 TRY&lt;BR /&gt;&lt;BR /&gt;You might want to preprocess this file so you can see what the TRY macro does. Compile with -E and save stdout.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;gt;Could you please let me know if compilation option needs to be changed to avoid getting 'core dump'?&lt;BR /&gt;&lt;BR /&gt;I don't know of any.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2011 04:27:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/getting-core-dump-while-dealing-with-try-catch-exceptions-in-hp/m-p/3992942#M95961</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-10-03T04:27:02Z</dc:date>
    </item>
  </channel>
</rss>

