<?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 weird SIGBUSs in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/weird-sigbuss/m-p/3883361#M99151</link>
    <description>Hi all there!&lt;BR /&gt;&lt;BR /&gt;I got another boring issue that I even do not know why it is happening.&lt;BR /&gt;&lt;BR /&gt;I compiled application in ELF64 mode.&lt;BR /&gt;In the middle of application I got 2 cases when I got SIGBUS&lt;BR /&gt;&lt;BR /&gt;1:&lt;BR /&gt;&lt;BR /&gt;Program received signal SIGBUS, Bus error.&lt;BR /&gt;0x800003ffff4f8f70 in _XtAddCallback (callbacks=0x8000000100024c78, callback=0x800003ffff44a398, closure=0x0) at Callback.c:128&lt;BR /&gt;128         cl-&amp;gt;callback = callback;&lt;BR /&gt;(gdb)&lt;BR /&gt;(gdb) l&lt;BR /&gt;123         *callbacks = icl;&lt;BR /&gt;124         icl-&amp;gt;count = count + 1;&lt;BR /&gt;125         icl-&amp;gt;is_padded = 0;&lt;BR /&gt;126         icl-&amp;gt;call_state = 0;&lt;BR /&gt;127         cl = ToList(icl) + count;&lt;BR /&gt;128         cl-&amp;gt;callback = callback;&lt;BR /&gt;129         cl-&amp;gt;closure = closure;&lt;BR /&gt;130     } /* _XtAddCallback */&lt;BR /&gt;131&lt;BR /&gt;132     void _XtAddCallbackOnce(callbacks, callback, closure)&lt;BR /&gt;(gdb) p cl-&amp;gt;callback&lt;BR /&gt;$1 = (signed char (*)()) 0xc1c6c4800000000&lt;BR /&gt;(gdb) p callback&lt;BR /&gt;$2 = (signed char (*)()) 0x800003ffff44a398&lt;BR /&gt;(gdb) p cl-&amp;gt;closure&lt;BR /&gt;$3 = (signed char *) 0x448dfcc00000000 &lt;ERROR reading="" address=""&gt;&lt;BR /&gt;(gdb) p closure&lt;BR /&gt;$4 = (signed char *) 0x0&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;All the pointer that are accessed on the time when SIGBUS arrive are valid why this could occur?&lt;BR /&gt;&lt;BR /&gt;2. I have a char* variable that has a value like&lt;BR /&gt;0x8000000100006308 "string"&lt;BR /&gt;&lt;BR /&gt;then I invoke the procedure that does nothing and just return this pointer back - something like this&lt;BR /&gt;&lt;BR /&gt;char* Name(name)&lt;BR /&gt;{&lt;BR /&gt;return name;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;name=Name(name);&lt;BR /&gt;&lt;BR /&gt;and after that I have name = 0x6308 &lt;ERROR reading="" address=""&gt;&lt;BR /&gt;&lt;BR /&gt;It just return 4 last digits for some reason. I fill that there is something with data/code alignment but do not know how to fight with this. &lt;BR /&gt;&lt;BR /&gt;Thanks for all advises if any.&lt;BR /&gt;&lt;BR /&gt;&lt;/ERROR&gt;&lt;/ERROR&gt;</description>
    <pubDate>Thu, 19 Oct 2006 11:41:03 GMT</pubDate>
    <dc:creator>Grigoriy Shcherbyak</dc:creator>
    <dc:date>2006-10-19T11:41:03Z</dc:date>
    <item>
      <title>weird SIGBUSs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/weird-sigbuss/m-p/3883361#M99151</link>
      <description>Hi all there!&lt;BR /&gt;&lt;BR /&gt;I got another boring issue that I even do not know why it is happening.&lt;BR /&gt;&lt;BR /&gt;I compiled application in ELF64 mode.&lt;BR /&gt;In the middle of application I got 2 cases when I got SIGBUS&lt;BR /&gt;&lt;BR /&gt;1:&lt;BR /&gt;&lt;BR /&gt;Program received signal SIGBUS, Bus error.&lt;BR /&gt;0x800003ffff4f8f70 in _XtAddCallback (callbacks=0x8000000100024c78, callback=0x800003ffff44a398, closure=0x0) at Callback.c:128&lt;BR /&gt;128         cl-&amp;gt;callback = callback;&lt;BR /&gt;(gdb)&lt;BR /&gt;(gdb) l&lt;BR /&gt;123         *callbacks = icl;&lt;BR /&gt;124         icl-&amp;gt;count = count + 1;&lt;BR /&gt;125         icl-&amp;gt;is_padded = 0;&lt;BR /&gt;126         icl-&amp;gt;call_state = 0;&lt;BR /&gt;127         cl = ToList(icl) + count;&lt;BR /&gt;128         cl-&amp;gt;callback = callback;&lt;BR /&gt;129         cl-&amp;gt;closure = closure;&lt;BR /&gt;130     } /* _XtAddCallback */&lt;BR /&gt;131&lt;BR /&gt;132     void _XtAddCallbackOnce(callbacks, callback, closure)&lt;BR /&gt;(gdb) p cl-&amp;gt;callback&lt;BR /&gt;$1 = (signed char (*)()) 0xc1c6c4800000000&lt;BR /&gt;(gdb) p callback&lt;BR /&gt;$2 = (signed char (*)()) 0x800003ffff44a398&lt;BR /&gt;(gdb) p cl-&amp;gt;closure&lt;BR /&gt;$3 = (signed char *) 0x448dfcc00000000 &lt;ERROR reading="" address=""&gt;&lt;BR /&gt;(gdb) p closure&lt;BR /&gt;$4 = (signed char *) 0x0&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;All the pointer that are accessed on the time when SIGBUS arrive are valid why this could occur?&lt;BR /&gt;&lt;BR /&gt;2. I have a char* variable that has a value like&lt;BR /&gt;0x8000000100006308 "string"&lt;BR /&gt;&lt;BR /&gt;then I invoke the procedure that does nothing and just return this pointer back - something like this&lt;BR /&gt;&lt;BR /&gt;char* Name(name)&lt;BR /&gt;{&lt;BR /&gt;return name;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;name=Name(name);&lt;BR /&gt;&lt;BR /&gt;and after that I have name = 0x6308 &lt;ERROR reading="" address=""&gt;&lt;BR /&gt;&lt;BR /&gt;It just return 4 last digits for some reason. I fill that there is something with data/code alignment but do not know how to fight with this. &lt;BR /&gt;&lt;BR /&gt;Thanks for all advises if any.&lt;BR /&gt;&lt;BR /&gt;&lt;/ERROR&gt;&lt;/ERROR&gt;</description>
      <pubDate>Thu, 19 Oct 2006 11:41:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/weird-sigbuss/m-p/3883361#M99151</guid>
      <dc:creator>Grigoriy Shcherbyak</dc:creator>
      <dc:date>2006-10-19T11:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: weird SIGBUSs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/weird-sigbuss/m-p/3883362#M99152</link>
      <description>&amp;gt; char* Name(name)&lt;BR /&gt;&amp;gt; {&lt;BR /&gt;&amp;gt; return name;&lt;BR /&gt;&amp;gt; }&lt;BR /&gt;&lt;BR /&gt;Because "name" is not explicitly typed, it's&lt;BR /&gt;an "int", which may be shorter than a&lt;BR /&gt;(64-bit) pointer.&lt;BR /&gt;&lt;BR /&gt;The compiler didn't complain?&lt;BR /&gt;&lt;BR /&gt;char* Name( char *name)&lt;BR /&gt;&lt;BR /&gt;Of course, if "like this" really means&lt;BR /&gt;"better than this", then the problem could be&lt;BR /&gt;somewhere else.&lt;BR /&gt;</description>
      <pubDate>Thu, 19 Oct 2006 11:56:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/weird-sigbuss/m-p/3883362#M99152</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2006-10-19T11:56:06Z</dc:date>
    </item>
    <item>
      <title>Re: weird SIGBUSs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/weird-sigbuss/m-p/3883363#M99153</link>
      <description>Around here:&lt;BR /&gt;&lt;BR /&gt;alp $ type TMP.C&lt;BR /&gt;char* Name(name)&lt;BR /&gt;{&lt;BR /&gt;return name;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;alp $ cc TMP.C&lt;BR /&gt;&lt;BR /&gt;return name;&lt;BR /&gt;.......^&lt;BR /&gt;%CC-W-CVTDIFTYPES, In this statement, "name" of type "int", is being converted t&lt;BR /&gt;o "pointer to char".&lt;BR /&gt;at line number 3 in file ALP$DKA0:[SMS]TMP.C;1&lt;BR /&gt;&lt;BR /&gt;That's with:&lt;BR /&gt;&lt;BR /&gt;alp $ cc /version&lt;BR /&gt;HP C V7.1-015 on OpenVMS Alpha V7.3-2&lt;BR /&gt;&lt;BR /&gt;But I'd expect any good compiler to say&lt;BR /&gt;something about this usage.</description>
      <pubDate>Thu, 19 Oct 2006 12:02:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/weird-sigbuss/m-p/3883363#M99153</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2006-10-19T12:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: weird SIGBUSs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/weird-sigbuss/m-p/3883364#M99154</link>
      <description>How about attaching the code (iff it's small) since this does not tell much.</description>
      <pubDate>Thu, 19 Oct 2006 12:37:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/weird-sigbuss/m-p/3883364#M99154</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2006-10-19T12:37:47Z</dc:date>
    </item>
    <item>
      <title>Re: weird SIGBUSs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/weird-sigbuss/m-p/3883365#M99155</link>
      <description>&lt;P&gt;&amp;gt;But I'd expect any good compiler to say something about this usage.&lt;BR /&gt;&lt;BR /&gt;It does:&lt;BR /&gt;$ cc -Ae -c type.c +DD64&lt;BR /&gt;cc: "type.c", line 2: warning 725: Return converts 32 bit integer to pointer.&lt;BR /&gt;&lt;BR /&gt;If you compile with +We725, you can make it an error.&lt;BR /&gt;&lt;BR /&gt;On IPF or with cadvise you get:&lt;BR /&gt;$ cc -Ae -c type.c +wlint&lt;BR /&gt;"type.c", line 1: warning #2267-D: old-style parameter list (anachronism)&lt;BR /&gt;char* Name(name) {&lt;BR /&gt;"type.c", line 1: warning #3051-D: standard requires that parameter "name" be given a type by a subsequent declaration ("int" assumed)&lt;BR /&gt;char* Name(name) {&lt;BR /&gt;"type.c", line 2: warning #2120-D: return value type does not match the function type&lt;BR /&gt;return name;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And there is also +w64bit.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2011 03:14:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/weird-sigbuss/m-p/3883365#M99155</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-10-24T03:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: weird SIGBUSs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/weird-sigbuss/m-p/3883366#M99156</link>
      <description>&amp;gt; It just return 4 last digits for some reason. &lt;BR /&gt;&lt;BR /&gt;Just for the record, it returned the low&lt;BR /&gt;_eight_ (hexadecimal) digits (the low 32 bits).</description>
      <pubDate>Fri, 20 Oct 2006 06:25:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/weird-sigbuss/m-p/3883366#M99156</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2006-10-20T06:25:38Z</dc:date>
    </item>
    <item>
      <title>Re: weird SIGBUSs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/weird-sigbuss/m-p/3883367#M99157</link>
      <description>Sorry, sorry, sorry.&lt;BR /&gt;I just typed example by memory and made mistake. Surely there is type in name variable. Anyway using your logic I have found mistake - there was function declaration beyond scope where it was used. Some compilers understand this but some obviously not. &lt;BR /&gt;&lt;BR /&gt;If some thought could came to you according to situation #1 I described it would be very helpful for me. &lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
      <pubDate>Fri, 20 Oct 2006 08:20:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/weird-sigbuss/m-p/3883367#M99157</guid>
      <dc:creator>Grigoriy Shcherbyak</dc:creator>
      <dc:date>2006-10-20T08:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: weird SIGBUSs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/weird-sigbuss/m-p/3883368#M99158</link>
      <description>&amp;gt; [...] there was function declaration beyond&lt;BR /&gt;&amp;gt; scope where it was used. Some compilers&lt;BR /&gt;&amp;gt; understand this but some obviously not.&lt;BR /&gt;&lt;BR /&gt;Or it matters less when an "int" and a&lt;BR /&gt;pointer are the same size.&lt;BR /&gt;&lt;BR /&gt;In any case, I'm glad you figured it out.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 20 Oct 2006 08:45:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/weird-sigbuss/m-p/3883368#M99158</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2006-10-20T08:45:48Z</dc:date>
    </item>
    <item>
      <title>Re: weird SIGBUSs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/weird-sigbuss/m-p/3883369#M99159</link>
      <description>Could you attach the code of &amp;gt;Callback.c&amp;lt; here so that situation #1 can be debugged.&lt;BR /&gt;&lt;BR /&gt;~thanks</description>
      <pubDate>Fri, 20 Oct 2006 12:14:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/weird-sigbuss/m-p/3883369#M99159</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2006-10-20T12:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: weird SIGBUSs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/weird-sigbuss/m-p/3883370#M99160</link>
      <description>Sorry for delay in answering. &lt;BR /&gt;&lt;BR /&gt;It is just part of the standard Xt library. I have feeling that there is some memory corruption in my application. Is there any tool that could help me to check memory using in run-time on HP-UX 11.11?&lt;BR /&gt;&lt;BR /&gt;I am compiling the code in 64 bit elf mode using gcc.&lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
      <pubDate>Thu, 26 Oct 2006 10:23:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/weird-sigbuss/m-p/3883370#M99160</guid>
      <dc:creator>Grigoriy Shcherbyak</dc:creator>
      <dc:date>2006-10-26T10:23:40Z</dc:date>
    </item>
    <item>
      <title>Re: weird SIGBUSs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/weird-sigbuss/m-p/3883371#M99161</link>
      <description>&amp;gt;I have feeling that there is some memory corruption in my application. Is there any tool that could help me to check memory using in run-time on HP-UX 11.11?&lt;BR /&gt;&lt;BR /&gt;wdb provides heap checking.&lt;BR /&gt;&lt;A href="http://h21007.www2.hp.com/dspp/tech/tech_TechDocumentDetailPage_IDX/1,1701,1662,00.html" target="_blank"&gt;http://h21007.www2.hp.com/dspp/tech/tech_TechDocumentDetailPage_IDX/1,1701,1662,00.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;You can also use a watch point to see who is corrupting the data after you set it up correctly.</description>
      <pubDate>Thu, 26 Oct 2006 14:22:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/weird-sigbuss/m-p/3883371#M99161</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2006-10-26T14:22:34Z</dc:date>
    </item>
  </channel>
</rss>

