- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Wierd Error when compiled Proc code with +Ofast co...
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
Forums
Discussions
Discussions
Discussions
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
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
06-17-2009 10:34 AM
06-17-2009 10:34 AM
Wierd Error when compiled Proc code with +Ofast compiler option
Today I have faced really a wierd error. I have a Pro C code which is first converted to c file and then I compiled it with aCC compiler using +Ofast compiler option. Then the code behaves in way different from when it is compiled without Ofast option. And later behaviour is the expected one.
I have debug statement immediately after the END-EXEC; statement in the file, which is the end of the pl/sql block. This debug statement is making the difference. It works fine if i remove the debug statement or remove Ofast from the compiler option or when i run the debug_binary.
Can anyone throw some lite on why this is happening??
Thanks in advance
- Tags:
- ProC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2009 10:57 AM
06-17-2009 10:57 AM
Re: Wierd Error when compiled Proc code with +Ofast compiler option
2) "This debug statement is making the difference."
3) "It works fine if i remove the debug statement or remove Ofast from the compiler option or when i run the debug_binary"
Well...depending upon which of the above statements is really the case, then you have 4 (or possibly more) cases.
Knowing nothing of ProC, I think the first step would be to capture the .c files emitted by ProC to see what changes occur with and without the referenced debug statement.
Then compile both of them, once with and once without the -Ofast option and see which ones work as expected.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2009 02:22 PM
06-17-2009 02:22 PM
Re: Wierd Error when compiled Proc code with +Ofast compiler option
I have a code which i compile to get a shared library. In that I have a small function which I used in different there code peices by include/linking the correct headers/library. And the function I just logs the statments to a file when debug is on.
Here are my observations
1. When I have the debug statement and I have +Ofast option.
This case does not work fine.
2. When I have the debug statement and I do not use +Ofast option.
This case is good.
And I have tried to look into the c file in both the cases it is the same.
3. With Ofast option if I remove the debug statement the result is good.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2009 07:52 PM
06-17-2009 07:52 PM
Re: Wierd Error when compiled Proc code with +Ofast compiler option
1. I can't see any of the code.
2. I don't have a program that I can test.
3. My psychic powers are very weak.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2009 08:20 PM - edited 02-08-2014 07:49 PM
06-17-2009 08:20 PM - edited 02-08-2014 07:49 PM
Re: Weird Error when compiled Proc code with +Ofast compiler option
What OS are you using? What aC++ version are you using? The latest aCC6 version is A.06.23.
(Previous threads had 11.23 and A.06.15.)
Have you removed +Ofast and replaced by +O2?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2009 11:55 PM
06-17-2009 11:55 PM
Re: Wierd Error when compiled Proc code with +Ofast compiler option
HP C/aC++ Version A.06.20
My OS is
B.11.23 U ia64
Attached is the code. And the last line is the one which creates the problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2009 11:58 PM
06-17-2009 11:58 PM
Re: Wierd Error when compiled Proc code with +Ofast compiler option
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2009 12:41 AM - edited 02-08-2014 07:49 PM
06-18-2009 12:41 AM - edited 02-08-2014 07:49 PM
Re: Weird Error when compiled Proc code with +Ofast compiler option
>HP C/aC++ Version A.06.20
You should install the latest patch, PHSS_39823.
>Attached is the code.
That is useless, I would need a .i. And unless you could run it, that wouldn't be that helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2009 12:57 AM
06-18-2009 12:57 AM
Re: Wierd Error when compiled Proc code with +Ofast compiler option
#ifndef SQL_CRSR
# define SQL_CRSR
struct sql_cursor
{
unsigned int curocn;
void *ptr1;
void *ptr2;
unsigned int magic;
};
typedef struct sql_cursor sql_cursor;
typedef struct sql_cursor SQL_CURSOR;
#endif /* SQL_CRSR */
This code is generated by the proc compiler.
When I compile the above code with ofasat option my result is invalid cursor
And when I compile it without ofast option I get the data.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2009 01:16 AM - edited 02-08-2014 07:48 PM
06-18-2009 01:16 AM - edited 02-08-2014 07:48 PM
Re: Weird Error when compiled Proc code with +Ofast compiler option
>result is invalid cursor
You could print out struct sql_cursor in gdb and compare the good and bad.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2009 01:39 AM
06-18-2009 01:39 AM
Re: Wierd Error when compiled Proc code with +Ofast compiler option
And is it possible to compare the object files by any chance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2009 01:50 AM
06-18-2009 01:50 AM
Re: Wierd Error when compiled Proc code with +Ofast compiler option
then i have set a breakpoint at the oracle part of the code by giving
activate function name in file
then I have run the test case..the test case hangs but there is no info displayed in gdb console.
Can you please help me
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2009 02:10 AM
06-18-2009 02:10 AM
Re: Wierd Error when compiled Proc code with +Ofast compiler option
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2009 03:05 AM - edited 02-08-2014 07:45 PM
06-18-2009 03:05 AM - edited 02-08-2014 07:45 PM
Re: Weird Error when compiled Proc code with +Ofast compiler option
>I get this problem when I use non-debug version of the binary. I am not sure if I can debug this version.
You can use -g with +Ofast. It won't be as accurate.
>And is it possible to compare the object files by any chance
No, the whole purpose of +Ofast is to make the code different/better.
>activate function name in file
Isn't it "break function"?
>the test case hangs but there is no info displayed in gdb console.
Does control-C work?
>I have another question as it is a proc file is it possible to debug on it. or else will it be possible to debug on the C file generated from pro c compiler
It depends on what that foreign devil preprocessor does. Can you create a .i file and look at it?
The simplest way to debug is to set breakpoints on functions, then look at the parms. Is your struct sql_cursor one of those?
Have you tried A.06.23?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2009 03:27 AM
06-18-2009 03:27 AM
Re: Wierd Error when compiled Proc code with +Ofast compiler option
yes i Have used break funtion..but it is of no use...i gave commands like next n that take me to all the thirdparty library functions but not to any one of my code....
>Does control-C work?
when i give c it continues and ends.
>It depends on what that foreign devil preprocessor does. Can you create a .i file and look at it?
pro c compiler compiles .pc file to generate a .c file. I have no idea of what .i file is
>The simplest way to debug is to set breakpoints on functions, then look at the parms. Is your struct sql_cursor one of those?
Yes i have set a breakpoint and tried to debug but i do not have any useful info
>Have you tried A.06.23?
No I dont have admin rights to install
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2009 11:45 PM
06-18-2009 11:45 PM
Re: Wierd Error when compiled Proc code with +Ofast compiler option
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2009 12:35 AM - edited 02-08-2014 07:46 PM
06-19-2009 12:35 AM - edited 02-08-2014 07:46 PM
Re: Weird Error when compiled Proc code with +Ofast compiler option
>but not to any one of my code.
You have set breakpoints to each function?
>have no idea of what .i file is
Compile with "-E -.i".
>Yes I have set a breakpoint and tried to debug but I do not have any useful info
What do you get? You may have to debug at the assembly level.
>I don't have admin rights to install
>Can anyone please help me?
If you can't try a new compiler, all you can do is workaround the problem.
Have you replaced +Ofast by +O2 and does that work?
Have you compiled with +wlint and +check=bounds +check=uninit to check for user errors?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2009 02:03 AM
06-19-2009 02:03 AM
Re: Wierd Error when compiled Proc code with +Ofast compiler option
I am not able to debug as the control is never coming into my file but is always in some third party libraries.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2009 02:42 AM
06-19-2009 02:42 AM
Re: Wierd Error when compiled Proc code with +Ofast compiler option
Could you please be more specific on it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2009 02:57 AM - edited 02-08-2014 07:46 PM
06-19-2009 02:57 AM - edited 02-08-2014 07:46 PM
Re: Weird Error when compiled Proc code with +Ofast compiler option
>I have changed the compiler option to +O2. It works fine.
Then that is probably what you should do. Unless you have a support contract, it may not be worth your time.
Why do you want +Ofast?
>I am not able to debug as the control is never coming into my file but is always in some third party libraries.
You can always break on hex addresses:
b * hex-add
>I have given -E -.i option when I am compiling the .c file (generated from the .pc file). But it does not compile the .o
Yes, -E -.i produces a .i and not the .o.
>neither I see any .i files created any where.
You may have to preprocess with Pro C, then use aC++ to create a .i file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2009 04:41 AM
06-19-2009 04:41 AM
Re: Wierd Error when compiled Proc code with +Ofast compiler option
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2009 07:23 PM - edited 02-08-2014 07:47 PM
06-19-2009 07:23 PM - edited 02-08-2014 07:47 PM
Re: Weird Error when compiled Proc code with +Ofast compiler option
>I have compiled with -E -.i option and compared the files in two different scenarios but they both are some. but the behaviour is different.
Of course. A preprocessed .i file is before it is optimized, or even compiled. But that .i file can be used to perform triage.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2009 11:33 PM
06-20-2009 11:33 PM
Re: Wierd Error when compiled Proc code with +Ofast compiler option
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2009 12:29 AM - edited 02-08-2014 07:47 PM
06-21-2009 12:29 AM - edited 02-08-2014 07:47 PM
Re: Weird Error when compiled Proc code with +Ofast compiler option
>I could not get what triage is
A process of determining (sorting, sifting) which component has the bug.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2009 01:59 AM
06-21-2009 01:59 AM