AIX runtime programming issue

I hope my title is accurate enough.

I have a product that we port to various UNIX platforms. It is known to run on AIX but using the IBM compiler from years ago. Recently we got a different used AIX P5 platform running AIX 5.3 and we setup the GCC compiler (4.4.5 I think). C and C++ source code.

Traditionally I compile with static C run time libs such as the standard C and Math libs. But I think I was not able to do that on this platform.

So I compiled it on this new platform OK and tested it and it runs fine. I sent it to a customer and it core dumps. Based on info from the customer it appears to fail during C startup on a call to a function called: __modinit

I am not sure which AIX OS he is running but in the past it did not mater. The code ran on all AIX Power platforms.

Does anyone know what is causing this and what I can do about it?

If I had my way I would like to link statically so I would not depend on any run time SO libraries.

Here is some of the dump info:

Class:           S
Type:            PERM
WPAR:            Global
Resource Name:   SYSPROC
 
Description
SOFTWARE PROGRAM ABNORMALLY TERMINATED
 
Failure Causes
SOFTWARE PROGRAM
 
Detail Data
SIGNAL NUMBER
          11
ADDITIONAL INFORMATION
__modinit 26C
__start 5C
__start 5C

Thank you all for any help!

From the information you've provided I can make only general recommendation - use IBM C Compiler, not GCC. Try to debug your code with dbx or IBM Debugger, but what I see - your code even doesn't come to the execution. Possibly you've linked it with wrong C runtime (crt0.o/crt0_64.o) or with wrong linker (GNU linker instead of IBM linker).

I don't know either which AIX version your customer runs, but there is a BIG chance it isn't AIX 5.3 of any sort at all. 5.3 is not supported any more since a some years now (even its successor 6.1 is almost out of support) and on newer (POWER8) systems it won't even run. On the other hand the recent AIX version (7.2) will not run on POWER5 or even POWER6 platforms.

From 5.3 to 6.1 and from 6.1 to 7.1 there were two big changes and - lacking intimate knowledge of your application - it is quite conceivable that your code might have problems running on current platforms and/or OS versions.

To what agent.kgb (rightfully) said i'd like to add: get a current platform to compile your software, POWER7 at least or preferably a POWER8.

I hope this helps.

bakunin

Thank you both.

Well, regarding the compiler... the C/C++ compiler from IBM is extremely expensive if I recall correctly. GCC works well on all the other platforms so I am hoping I can figure this out.

Regarding the different AIX OS version, I don't think this is an issue with my App because we don't generally rely on any special OS calls. As an example, when this customer was unable to run the new release he reverted back to a stable earlier compile that was compiled on AIX 4.3.3 a few years back. This program compiles into native Power machine code.

I think my issue with the C startup code trying to initialize the math library. I suspect that it might have to do with SO files instead of a directly linked static math library, but I don't know. It could be as you say:
"Possibly you've linked it with wrong C runtime ( crt0.o / crt0_64.o ) or with wrong linker (GNU linker instead of IBM linker)"

I was asking in case there is someone out there that has worked with GCC on AIX and might know what this is right off.

I will dig into it further and see what I find.

Thanks again for your suggestions.

first look here - AIX Open Source Packages | Main / Build Instructions. These instructions pass generally to all projects, compiled on AIX, not only RPM files by Michael Perzl.

second I personally experienced strange core dumps on some strange places in right written C programs, which were compiled with GCC for AIX. Changing the compiler helped me every time. I know it is expensive, but you can download 60-day trial version, compile with it and check if it works. As for me I use GCC only if there is some GNU specific source code. But I am not a programmer :wink:

Not sure if this is still a problem. If so, try APAR IY91530. This corrects a __modinit core at 5.3. This may or may not be the ticket. Good chance it is.