<?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 Losing data in C structure at runtime on Itanium in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/losing-data-in-c-structure-at-runtime-on-itanium/m-p/3945975#M97789</link>
    <description>&lt;!--!*#--&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;i have discovered a strange behaviour on an HP Itanium.&lt;BR /&gt;&lt;BR /&gt;First some specs :&lt;BR /&gt;hp-ux 11iv2 +patchs bundles March2006&lt;BR /&gt;compiler :  HP C/aC++ B3910B A.06.13  + patchs&lt;BR /&gt;&lt;BR /&gt;The problem has been reproduced on 2 server with almost the same configuration.&lt;BR /&gt;We use our code for years now on PA-Risc with no trouble at all.&lt;BR /&gt;And the use of GCC make the problem ... disappear.&lt;BR /&gt;&lt;BR /&gt;So the trouble is that, when you get into a function and get out of it by using 1 struct as parameters....&lt;BR /&gt;When you get out of the call of the function =&amp;gt; the structure has been cleaned (nothing more in it.....)&lt;BR /&gt;&lt;BR /&gt;The result of a test case: (code included at the end)&lt;BR /&gt;=====START=====&lt;BR /&gt;BEFORE f2 _st1.debut_nom : [debut nom de st1] - Adr[7ffcd6f0]&lt;BR /&gt;BEFORE f2 _st2.ref : [ref de st2] - Adr[7ffe5e38]&lt;BR /&gt;f2 _st1.debut_nom : [debut nom de st1] - Adr[7ffb4fa0]&lt;BR /&gt;f2 _st2.ref : [ref de st2] - Adr[7ffb4da0]&lt;BR /&gt;AFTER f2 _st1.debut_nom : [] - Adr[7ffe5e32]&lt;BR /&gt;AFTER f2 _st2.ref : [] - Adr[7fffe57a]&lt;BR /&gt;=====END=====&lt;BR /&gt;&lt;BR /&gt;Before and after the f2 function call.&lt;BR /&gt;As you can see st1.debut_nom  and _st2.ref has been cleaned and do not have the same adress anymore.&lt;BR /&gt;&lt;BR /&gt;Just to repeat it : we tried to compile and run this with gcc and it worked just fine with no trouble&lt;BR /&gt;&lt;BR /&gt;So the trouble (just make this little exemple to reproduce) :&lt;BR /&gt;============================================================&lt;BR /&gt;&amp;gt;------------------------------------------------------------------------------------------&lt;BR /&gt;code included in the attachement&lt;BR /&gt;------------------------------------------------------------------------------------------&amp;lt;&lt;BR /&gt;And to compile... you can reduce it as this &lt;BR /&gt;cc -g  -c filec.c -o filec.o&lt;BR /&gt;cc -g  -o filec.exe filec.o -lm -lc&lt;BR /&gt;------------------------------------------------------------------------------------------&amp;lt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;So , if someone sees a code trouble , or have any idea of what happens here...&lt;BR /&gt;Help or informations would be just great !&lt;BR /&gt;If you need more informations just ask, we really need to find out this one here.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance !!&lt;BR /&gt;</description>
    <pubDate>Fri, 16 Feb 2007 05:54:45 GMT</pubDate>
    <dc:creator>bruneau</dc:creator>
    <dc:date>2007-02-16T05:54:45Z</dc:date>
    <item>
      <title>Losing data in C structure at runtime on Itanium</title>
      <link>https://community.hpe.com/t5/operating-system-linux/losing-data-in-c-structure-at-runtime-on-itanium/m-p/3945975#M97789</link>
      <description>&lt;!--!*#--&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;i have discovered a strange behaviour on an HP Itanium.&lt;BR /&gt;&lt;BR /&gt;First some specs :&lt;BR /&gt;hp-ux 11iv2 +patchs bundles March2006&lt;BR /&gt;compiler :  HP C/aC++ B3910B A.06.13  + patchs&lt;BR /&gt;&lt;BR /&gt;The problem has been reproduced on 2 server with almost the same configuration.&lt;BR /&gt;We use our code for years now on PA-Risc with no trouble at all.&lt;BR /&gt;And the use of GCC make the problem ... disappear.&lt;BR /&gt;&lt;BR /&gt;So the trouble is that, when you get into a function and get out of it by using 1 struct as parameters....&lt;BR /&gt;When you get out of the call of the function =&amp;gt; the structure has been cleaned (nothing more in it.....)&lt;BR /&gt;&lt;BR /&gt;The result of a test case: (code included at the end)&lt;BR /&gt;=====START=====&lt;BR /&gt;BEFORE f2 _st1.debut_nom : [debut nom de st1] - Adr[7ffcd6f0]&lt;BR /&gt;BEFORE f2 _st2.ref : [ref de st2] - Adr[7ffe5e38]&lt;BR /&gt;f2 _st1.debut_nom : [debut nom de st1] - Adr[7ffb4fa0]&lt;BR /&gt;f2 _st2.ref : [ref de st2] - Adr[7ffb4da0]&lt;BR /&gt;AFTER f2 _st1.debut_nom : [] - Adr[7ffe5e32]&lt;BR /&gt;AFTER f2 _st2.ref : [] - Adr[7fffe57a]&lt;BR /&gt;=====END=====&lt;BR /&gt;&lt;BR /&gt;Before and after the f2 function call.&lt;BR /&gt;As you can see st1.debut_nom  and _st2.ref has been cleaned and do not have the same adress anymore.&lt;BR /&gt;&lt;BR /&gt;Just to repeat it : we tried to compile and run this with gcc and it worked just fine with no trouble&lt;BR /&gt;&lt;BR /&gt;So the trouble (just make this little exemple to reproduce) :&lt;BR /&gt;============================================================&lt;BR /&gt;&amp;gt;------------------------------------------------------------------------------------------&lt;BR /&gt;code included in the attachement&lt;BR /&gt;------------------------------------------------------------------------------------------&amp;lt;&lt;BR /&gt;And to compile... you can reduce it as this &lt;BR /&gt;cc -g  -c filec.c -o filec.o&lt;BR /&gt;cc -g  -o filec.exe filec.o -lm -lc&lt;BR /&gt;------------------------------------------------------------------------------------------&amp;lt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;So , if someone sees a code trouble , or have any idea of what happens here...&lt;BR /&gt;Help or informations would be just great !&lt;BR /&gt;If you need more informations just ask, we really need to find out this one here.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance !!&lt;BR /&gt;</description>
      <pubDate>Fri, 16 Feb 2007 05:54:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/losing-data-in-c-structure-at-runtime-on-itanium/m-p/3945975#M97789</guid>
      <dc:creator>bruneau</dc:creator>
      <dc:date>2007-02-16T05:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: Losing data in C structure at runtime on Itanium</title>
      <link>https://community.hpe.com/t5/operating-system-linux/losing-data-in-c-structure-at-runtime-on-itanium/m-p/3945976#M97790</link>
      <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;I suggest taking the same code back to pa-risc, compiling it and testing. This will eliminate the code as a suspect. Unless it blows up.&lt;BR /&gt;&lt;BR /&gt;After this I suggest downloading compiler patches from itrc patch database and checking for new version of the application dvd.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Fri, 16 Feb 2007 07:29:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/losing-data-in-c-structure-at-runtime-on-itanium/m-p/3945976#M97790</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2007-02-16T07:29:34Z</dc:date>
    </item>
    <item>
      <title>Re: Losing data in C structure at runtime on Itanium</title>
      <link>https://community.hpe.com/t5/operating-system-linux/losing-data-in-c-structure-at-runtime-on-itanium/m-p/3945977#M97791</link>
      <description>Don't pass those long argments by value, pass them by reference using a pointer?!&lt;BR /&gt;&lt;BR /&gt;fwiw,&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Fri, 16 Feb 2007 07:31:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/losing-data-in-c-structure-at-runtime-on-itanium/m-p/3945977#M97791</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-02-16T07:31:21Z</dc:date>
    </item>
    <item>
      <title>Re: Losing data in C structure at runtime on Itanium</title>
      <link>https://community.hpe.com/t5/operating-system-linux/losing-data-in-c-structure-at-runtime-on-itanium/m-p/3945978#M97792</link>
      <description>Thx for your answers...&lt;BR /&gt;&lt;BR /&gt;For the fact of running the application on PA-RISC.... &lt;BR /&gt;It's ok , the test case and your entire software runs just fine on PA-Risc Arch.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;For the fact of sending arguments by adress instead of values is a good idea and works better in some case (but not all)&lt;BR /&gt;And our software is now fairly large....&lt;BR /&gt;It would takes ages for us to migrate every (eventual) problem for value to adress.&lt;BR /&gt;&lt;BR /&gt;And since it works fine on almost every arch we have... we would be confident in thinking it was a bug from the compiler or the linker.&lt;BR /&gt;&lt;BR /&gt;No trouble on windows, sun, aix, linux, DU...&lt;BR /&gt;And works fine with GCC on the same server...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;We have upgraded to the lastest patch.&lt;BR /&gt;And the trouble still here...&lt;BR /&gt;</description>
      <pubDate>Fri, 16 Feb 2007 09:12:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/losing-data-in-c-structure-at-runtime-on-itanium/m-p/3945978#M97792</guid>
      <dc:creator>bruneau</dc:creator>
      <dc:date>2007-02-16T09:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: Losing data in C structure at runtime on Itanium</title>
      <link>https://community.hpe.com/t5/operating-system-linux/losing-data-in-c-structure-at-runtime-on-itanium/m-p/3945979#M97793</link>
      <description>I compiled your code using both ANSI C and the aCC compiler on an IPF machine B.11.23 and it works. I'm not sure how to reproduce your problem.</description>
      <pubDate>Fri, 16 Feb 2007 12:57:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/losing-data-in-c-structure-at-runtime-on-itanium/m-p/3945979#M97793</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2007-02-16T12:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: Losing data in C structure at runtime on Itanium</title>
      <link>https://community.hpe.com/t5/operating-system-linux/losing-data-in-c-structure-at-runtime-on-itanium/m-p/3945980#M97794</link>
      <description>My aC++ compiler is much older than yours. I have the B3911DB bundle of the C++ compiler installed. Don't know if that has anything to do with it.&lt;BR /&gt;&lt;BR /&gt;~hope it helps</description>
      <pubDate>Fri, 16 Feb 2007 15:23:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/losing-data-in-c-structure-at-runtime-on-itanium/m-p/3945980#M97794</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2007-02-16T15:23:21Z</dc:date>
    </item>
    <item>
      <title>Re: Losing data in C structure at runtime on Integrity</title>
      <link>https://community.hpe.com/t5/operating-system-linux/losing-data-in-c-structure-at-runtime-on-itanium/m-p/3945981#M97795</link>
      <description>&lt;P&gt;Please contact the Response Center and file a bug ASAP.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;When you get out of the call of the function =&amp;gt; the structure has been cleaned&lt;BR /&gt;&amp;gt;do not have the same address anymore.&lt;BR /&gt;&lt;BR /&gt;Right, the address register has been moved while copying the arg.&lt;BR /&gt;&lt;BR /&gt;This was broken in A.06.05.&lt;BR /&gt;&lt;BR /&gt;One workaround as Hein says is to not pass long structs. In fact if you copied it to a temp with memcpy, and then passed an address, it would be faster than the code the compiler generates.&lt;BR /&gt;&lt;BR /&gt;Another workaround is to use +O2. Where memcpy is used.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Sandman: My aC++ compiler is much older than yours.&lt;BR /&gt;&lt;BR /&gt;(It would help if you mentioned your version rather than say "older".)&lt;/P&gt;</description>
      <pubDate>Sun, 16 Oct 2011 10:27:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/losing-data-in-c-structure-at-runtime-on-itanium/m-p/3945981#M97795</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-10-16T10:27:06Z</dc:date>
    </item>
    <item>
      <title>Re: Losing data in C structure at runtime on Integrity</title>
      <link>https://community.hpe.com/t5/operating-system-linux/losing-data-in-c-structure-at-runtime-on-itanium/m-p/3945982#M97796</link>
      <description>&lt;P&gt;I didn't see any bug reports recently filed by you on this problem so I filed CR JAGag32532:&lt;BR /&gt;Bad code for large parms passed to large parms&lt;/P&gt;</description>
      <pubDate>Sun, 16 Oct 2011 10:27:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/losing-data-in-c-structure-at-runtime-on-itanium/m-p/3945982#M97796</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-10-16T10:27:39Z</dc:date>
    </item>
    <item>
      <title>Re: Losing data in C structure at runtime on Itanium</title>
      <link>https://community.hpe.com/t5/operating-system-linux/losing-data-in-c-structure-at-runtime-on-itanium/m-p/3945983#M97797</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Thanks for all your answers !&lt;BR /&gt;&lt;BR /&gt;And thank you Dennis for pointing out a solution (the +O2 flag works just fine for my test case, i will try it one our application)&lt;BR /&gt;&lt;BR /&gt;Thank you too , for opening the bug reports.&lt;BR /&gt;(i was ill and out of business for the entire week)&lt;BR /&gt;&lt;BR /&gt;I will now investigate for eventual side effects.&lt;BR /&gt;&lt;BR /&gt;Once again thanks !</description>
      <pubDate>Mon, 26 Feb 2007 03:58:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/losing-data-in-c-structure-at-runtime-on-itanium/m-p/3945983#M97797</guid>
      <dc:creator>bruneau</dc:creator>
      <dc:date>2007-02-26T03:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Losing data in C structure at runtime on Itanium</title>
      <link>https://community.hpe.com/t5/operating-system-linux/losing-data-in-c-structure-at-runtime-on-itanium/m-p/3945984#M97798</link>
      <description>After some more tests.....&lt;BR /&gt;&lt;BR /&gt;The +O2 do not solve our problem finally&lt;BR /&gt;&lt;BR /&gt;My test case is ok for now.&lt;BR /&gt;But in our application the result is pretty strange.&lt;BR /&gt;&lt;BR /&gt;It goes from:&lt;BR /&gt;-simply doing the same behaviour than without the +O2&lt;BR /&gt;-to display message like 'too much arguments' appear on screen at runtime..... (it appear while logging data on console)&lt;BR /&gt;&lt;BR /&gt;I will have to investigate a little more to... reproduce the problem in the same way as my example do.</description>
      <pubDate>Mon, 26 Feb 2007 10:52:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/losing-data-in-c-structure-at-runtime-on-itanium/m-p/3945984#M97798</guid>
      <dc:creator>bruneau</dc:creator>
      <dc:date>2007-02-26T10:52:39Z</dc:date>
    </item>
  </channel>
</rss>

