<?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: Difference between Segmentation fault Bus error Memory fault coredump in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/difference-between-segmentation-fault-bus-error-memory-fault/m-p/3357626#M712988</link>
    <description>Essentially there are only two cases you need to distinguish. SIGSEGV and SIGBUS.&lt;BR /&gt; &lt;BR /&gt;The "Memory fault" you are seeing is also a Segmentation Fault... only ksh and posix-sh use the term for that very same thing.&lt;BR /&gt; &lt;BR /&gt;ksh# sleep 100&amp;amp;&lt;BR /&gt;[1]     2901&lt;BR /&gt;ksh# kill -SEGV %%&lt;BR /&gt;[1] + Memory fault(coredump)      sleep 100&amp;amp;&lt;BR /&gt; &lt;BR /&gt;csh# sleep 100 &amp;amp;&lt;BR /&gt;[1] 2961&lt;BR /&gt;csh# kill -SEGV %%&lt;BR /&gt;[1]   Segmentation fault   sleep 100 (core dumped)&lt;BR /&gt; &lt;BR /&gt;A bus error usually happens if you are using unaligned addresses. The NULL pointer example is a special case... one of many.&lt;BR /&gt; &lt;BR /&gt;Best regards...&lt;BR /&gt;Dietmar.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 16 Aug 2004 06:05:13 GMT</pubDate>
    <dc:creator>Dietmar Konermann</dc:creator>
    <dc:date>2004-08-16T06:05:13Z</dc:date>
    <item>
      <title>Difference between Segmentation fault Bus error Memory fault coredump</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/difference-between-segmentation-fault-bus-error-memory-fault/m-p/3357623#M712985</link>
      <description>Hello all,&lt;BR /&gt;      I compiled this program on HP-UX PA-RISC,Linux and HP-UX IPF machines.&lt;BR /&gt;&lt;BR /&gt;main()&lt;BR /&gt;{&lt;BR /&gt;        char *p;&lt;BR /&gt;        *p='a';&lt;BR /&gt;        printf("%c",*p);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Linux machine1         Segmentation fault&lt;BR /&gt;Linux Machine2         Segmentation fault&lt;BR /&gt;HP UX PA-RISC Machine1 Bus error(coredump)&lt;BR /&gt;HP UX PA-RISC Machine2 Bus error(coredump)&lt;BR /&gt;HP UX IPF     Machine1 Memory fault(coredump)&lt;BR /&gt;HP UX IPF     Machine2 Memory fault(coredump)&lt;BR /&gt;&lt;BR /&gt;So what is the difference between&lt;BR /&gt;&lt;BR /&gt;1. Segmentation fault&lt;BR /&gt;2. Bus error(coredump)&lt;BR /&gt;3. Memory fault(coredump)&lt;BR /&gt;4. Coredump&lt;BR /&gt;&lt;BR /&gt;How can I reproduce these errors independent of platforms ( may be compilers ) or Can I get 4/3 C programs for each of the errors.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.</description>
      <pubDate>Sun, 15 Aug 2004 23:08:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/difference-between-segmentation-fault-bus-error-memory-fault/m-p/3357623#M712985</guid>
      <dc:creator>murugesan_2</dc:creator>
      <dc:date>2004-08-15T23:08:17Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between Segmentation fault Bus error Memory fault coredump</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/difference-between-segmentation-fault-bus-error-memory-fault/m-p/3357624#M712986</link>
      <description>I'd certainly use a program with more predicable conditions.&lt;BR /&gt;At present your code fails when the end of the&lt;BR /&gt;string (that has not been established) is &lt;BR /&gt;searched for. Now depending on how the compiler&lt;BR /&gt;compiled the code, it may or may not find a&lt;BR /&gt;terminating 0 befor the OS jumps on it for&lt;BR /&gt;trying to reference memory out of its own area. So its possible that this code may&lt;BR /&gt;even work in some cases or some times.&lt;BR /&gt;It all depends on the initial value of 'p' and&lt;BR /&gt;if the compiler set it or left it as a random value.&lt;BR /&gt;&lt;BR /&gt;At least setting p=0 would be reproducable.&lt;BR /&gt;The way the OS responds to this will also&lt;BR /&gt;depend on the memory model used in the OS I believe. &lt;BR /&gt;&lt;BR /&gt;Not sure that helps, but any time you want&lt;BR /&gt;to run some code with errors in it I'm sure&lt;BR /&gt;there are plenty of people that can provide&lt;BR /&gt;samples ;{)&lt;BR /&gt;&lt;BR /&gt;Why do you need to reproduce the errors anyway?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;         ...Laurie :{)</description>
      <pubDate>Mon, 16 Aug 2004 00:27:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/difference-between-segmentation-fault-bus-error-memory-fault/m-p/3357624#M712986</guid>
      <dc:creator>Laurie Gellatly</dc:creator>
      <dc:date>2004-08-16T00:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between Segmentation fault Bus error Memory fault coredump</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/difference-between-segmentation-fault-bus-error-memory-fault/m-p/3357625#M712987</link>
      <description>As I told already, I need to know the difference between the above four ( or may be three excluding coredump ) .&lt;BR /&gt;&lt;BR /&gt;As far as I know&lt;BR /&gt;&lt;BR /&gt;Segmentation fault occurs when we try to access the memory area out of the process address space.&lt;BR /&gt;Bus error occurs when we try to access a physical device that does not exists. &lt;BR /&gt; &lt;BR /&gt;coredump is the facility provided by the compiler that will give us the information on the causes and memory faults that occurs at run time.&lt;BR /&gt;&lt;BR /&gt;My question is to know these things ( the above mentioned 4 cases ) practically. &lt;BR /&gt;Now I have a program for bus error.&lt;BR /&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;main()&lt;BR /&gt;{&lt;BR /&gt;        FILE *fp=NULL;&lt;BR /&gt;        fwrite("TEST",5,1,fp);&lt;BR /&gt;        fclose(fp);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;But this produced the expected result in IPF and PA-RISC machineS alone . In Linux I am not getting the bus error message. Instead I am getting the same "Segmentation fault" error message.&lt;BR /&gt;&lt;BR /&gt;What I need is, four programs  ( or three programs, if coredump has been excluded ) which when run on all the platforms produces the same results.&lt;/STDIO.H&gt;</description>
      <pubDate>Mon, 16 Aug 2004 01:21:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/difference-between-segmentation-fault-bus-error-memory-fault/m-p/3357625#M712987</guid>
      <dc:creator>murugesan_2</dc:creator>
      <dc:date>2004-08-16T01:21:49Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between Segmentation fault Bus error Memory fault coredump</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/difference-between-segmentation-fault-bus-error-memory-fault/m-p/3357626#M712988</link>
      <description>Essentially there are only two cases you need to distinguish. SIGSEGV and SIGBUS.&lt;BR /&gt; &lt;BR /&gt;The "Memory fault" you are seeing is also a Segmentation Fault... only ksh and posix-sh use the term for that very same thing.&lt;BR /&gt; &lt;BR /&gt;ksh# sleep 100&amp;amp;&lt;BR /&gt;[1]     2901&lt;BR /&gt;ksh# kill -SEGV %%&lt;BR /&gt;[1] + Memory fault(coredump)      sleep 100&amp;amp;&lt;BR /&gt; &lt;BR /&gt;csh# sleep 100 &amp;amp;&lt;BR /&gt;[1] 2961&lt;BR /&gt;csh# kill -SEGV %%&lt;BR /&gt;[1]   Segmentation fault   sleep 100 (core dumped)&lt;BR /&gt; &lt;BR /&gt;A bus error usually happens if you are using unaligned addresses. The NULL pointer example is a special case... one of many.&lt;BR /&gt; &lt;BR /&gt;Best regards...&lt;BR /&gt;Dietmar.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 16 Aug 2004 06:05:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/difference-between-segmentation-fault-bus-error-memory-fault/m-p/3357626#M712988</guid>
      <dc:creator>Dietmar Konermann</dc:creator>
      <dc:date>2004-08-16T06:05:13Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between Segmentation fault Bus error Memory fault coredump</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/difference-between-segmentation-fault-bus-error-memory-fault/m-p/3357627#M712989</link>
      <description>Thanks  Dietmar for pointing me to the exact location to get the errors.</description>
      <pubDate>Mon, 16 Aug 2004 06:52:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/difference-between-segmentation-fault-bus-error-memory-fault/m-p/3357627#M712989</guid>
      <dc:creator>murugesan_2</dc:creator>
      <dc:date>2004-08-16T06:52:05Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between Segmentation fault Bus error Memory fault coredump</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/difference-between-segmentation-fault-bus-error-memory-fault/m-p/3357628#M712990</link>
      <description>Coredump is containing informations that the environment where the program got crashed and by what signal it's behaviour changed.&lt;BR /&gt;&lt;BR /&gt;With the signal we can identify the problem. You can simply use file core to know the type of signal you got there.&lt;BR /&gt;&lt;BR /&gt;Causes for SEGV and BUS signals:&lt;BR /&gt;&lt;BR /&gt;   SIGSEGV   &lt;BR /&gt;     SEGV_MAPERR     address not mapped to object&lt;BR /&gt;     SEGV_ACCERR     invalid permissions for mapped object&lt;BR /&gt;   SIGBUS    &lt;BR /&gt;     BUS_ADRALN     invalid address alignment&lt;BR /&gt;     BUS_ADRERR     non-existent physical address&lt;BR /&gt;     BUS_OBJERR     object specific hardware error&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Segmentation fault and Memory fault (coredump) are same. All are happenening because of SIGSEGV signal. &lt;BR /&gt;&lt;BR /&gt;Bus error is happenening out on getting SIGBUS signal. &lt;BR /&gt;&lt;BR /&gt;Let us compare them on HP-UX platforms:&lt;BR /&gt;&lt;BR /&gt;IPF: &amp;lt;11.23&amp;gt;&lt;BR /&gt;&lt;BR /&gt;  First program is giving only Memory fault(coredump) on IPF and BUS error on PA-RISC.&lt;BR /&gt;&lt;BR /&gt;  When we try it as,&lt;BR /&gt;&lt;BR /&gt; FILE *fp;&lt;BR /&gt;&lt;BR /&gt; and getting Bus error(coredump) on IPF and PA-RISC too.&lt;BR /&gt;&lt;BR /&gt; I hope the messages of SIGSEGV and SIGBUS will give the view on this.&lt;BR /&gt;&lt;BR /&gt; Memory errors are occured because unaligned memory area access or invalid address mappings too.&lt;BR /&gt;&lt;BR /&gt; You can use gdb / adb to debug the core.&lt;BR /&gt;&lt;BR /&gt; And more use file / what commands to analyse&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 16 Aug 2004 10:36:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/difference-between-segmentation-fault-bus-error-memory-fault/m-p/3357628#M712990</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2004-08-16T10:36:44Z</dc:date>
    </item>
  </channel>
</rss>

