- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Losing data in C structure at runtime on Itanium
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-15-2007 09:54 PM
тАО02-15-2007 09:54 PM
i have discovered a strange behaviour on an HP Itanium.
First some specs :
hp-ux 11iv2 +patchs bundles March2006
compiler : HP C/aC++ B3910B A.06.13 + patchs
The problem has been reproduced on 2 server with almost the same configuration.
We use our code for years now on PA-Risc with no trouble at all.
And the use of GCC make the problem ... disappear.
So the trouble is that, when you get into a function and get out of it by using 1 struct as parameters....
When you get out of the call of the function => the structure has been cleaned (nothing more in it.....)
The result of a test case: (code included at the end)
=====START=====
BEFORE f2 _st1.debut_nom : [debut nom de st1] - Adr[7ffcd6f0]
BEFORE f2 _st2.ref : [ref de st2] - Adr[7ffe5e38]
f2 _st1.debut_nom : [debut nom de st1] - Adr[7ffb4fa0]
f2 _st2.ref : [ref de st2] - Adr[7ffb4da0]
AFTER f2 _st1.debut_nom : [] - Adr[7ffe5e32]
AFTER f2 _st2.ref : [] - Adr[7fffe57a]
=====END=====
Before and after the f2 function call.
As you can see st1.debut_nom and _st2.ref has been cleaned and do not have the same adress anymore.
Just to repeat it : we tried to compile and run this with gcc and it worked just fine with no trouble
So the trouble (just make this little exemple to reproduce) :
============================================================
>------------------------------------------------------------------------------------------
code included in the attachement
------------------------------------------------------------------------------------------<
And to compile... you can reduce it as this
cc -g -c filec.c -o filec.o
cc -g -o filec.exe filec.o -lm -lc
------------------------------------------------------------------------------------------<
So , if someone sees a code trouble , or have any idea of what happens here...
Help or informations would be just great !
If you need more informations just ask, we really need to find out this one here.
Thanks in advance !!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-15-2007 11:29 PM
тАО02-15-2007 11:29 PM
Re: Losing data in C structure at runtime on Itanium
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.
After this I suggest downloading compiler patches from itrc patch database and checking for new version of the application dvd.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-15-2007 11:31 PM
тАО02-15-2007 11:31 PM
Re: Losing data in C structure at runtime on Itanium
fwiw,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-16-2007 01:12 AM
тАО02-16-2007 01:12 AM
Re: Losing data in C structure at runtime on Itanium
For the fact of running the application on PA-RISC....
It's ok , the test case and your entire software runs just fine on PA-Risc Arch.
For the fact of sending arguments by adress instead of values is a good idea and works better in some case (but not all)
And our software is now fairly large....
It would takes ages for us to migrate every (eventual) problem for value to adress.
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.
No trouble on windows, sun, aix, linux, DU...
And works fine with GCC on the same server...
We have upgraded to the lastest patch.
And the trouble still here...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-16-2007 04:57 AM
тАО02-16-2007 04:57 AM
Re: Losing data in C structure at runtime on Itanium
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-16-2007 07:23 AM
тАО02-16-2007 07:23 AM
Re: Losing data in C structure at runtime on Itanium
~hope it helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-16-2007 03:52 PM - edited тАО10-16-2011 03:27 AM
тАО02-16-2007 03:52 PM - edited тАО10-16-2011 03:27 AM
SolutionPlease contact the Response Center and file a bug ASAP.
>When you get out of the call of the function => the structure has been cleaned
>do not have the same address anymore.
Right, the address register has been moved while copying the arg.
This was broken in A.06.05.
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.
Another workaround is to use +O2. Where memcpy is used.
>Sandman: My aC++ compiler is much older than yours.
(It would help if you mentioned your version rather than say "older".)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-21-2007 04:24 PM - edited тАО10-16-2011 03:27 AM
тАО02-21-2007 04:24 PM - edited тАО10-16-2011 03:27 AM
Re: Losing data in C structure at runtime on Integrity
I didn't see any bug reports recently filed by you on this problem so I filed CR JAGag32532:
Bad code for large parms passed to large parms
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-25-2007 07:58 PM
тАО02-25-2007 07:58 PM
Re: Losing data in C structure at runtime on Itanium
Thanks for all your answers !
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)
Thank you too , for opening the bug reports.
(i was ill and out of business for the entire week)
I will now investigate for eventual side effects.
Once again thanks !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-26-2007 02:52 AM
тАО02-26-2007 02:52 AM
Re: Losing data in C structure at runtime on Itanium
The +O2 do not solve our problem finally
My test case is ok for now.
But in our application the result is pretty strange.
It goes from:
-simply doing the same behaviour than without the +O2
-to display message like 'too much arguments' appear on screen at runtime..... (it appear while logging data on console)
I will have to investigate a little more to... reproduce the problem in the same way as my example do.