- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: NULL problem in HP server
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-25-2009 09:10 AM
тАО02-25-2009 09:10 AM
SolutionWhy? This code is illegal. Unfortunately it should work by the linker default, -Z.
>works on a AIX machine but not in HP.
What linker options are you using?
>is it possible to instruct compiler while compiling not to use "0"?
No.
>instead use a valid segment area?
That's the default for read. Trying to modify will always abort.
>Don: So "-Z" will probably get you going -- but I'd still fix that source in the future to have more clean portability.
Right. But since -Z is the default, you'll need to look for -z.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-25-2009 07:50 PM
тАО02-25-2009 07:50 PM
Re: NULL problem in HP server
We made that sample code work by using -Z option in GCC. But even this approcah fails in our project, sice we are making a shared library and making use of that. Its a JNI project with Java and C. :(
- Tags:
- JNI
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-25-2009 09:38 PM
тАО02-25-2009 09:38 PM
Re: NULL problem in HP server
It appears that gcc hates bad programmers and by default passes -z to ld.
>making a shared library and making use of that. It's a JNI project with Java and C
I suppose you could copy java and "chatr -Z java" and then use that?
But I don't know what will be broken in java, if that trap is removed?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-25-2009 09:50 PM
тАО02-25-2009 09:50 PM
Re: NULL problem in HP server
> project, [...]
There is much to be said for fixing your
really very bad code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-26-2009 01:22 AM
тАО02-26-2009 01:22 AM
Re: NULL problem in HP server
"I suppose you could copy java and "chatr -Z java" and then use that?"
Could you explain wats the purpose of "chatr -Z java" and for wat it is used? wer to use this? I'm new to this command.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-26-2009 09:37 AM
тАО02-26-2009 09:37 AM
Re: NULL problem in HP server
It does the same as linking java with -Z.
Copy the executable, make it writable, use chatr, make it read only.
Then test. It may not work unless the modified executable is in the original directory. If so, you should give it a different name. Then see if it works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-27-2009 01:27 AM
тАО02-27-2009 01:27 AM
Re: NULL problem in HP server
Thanks for your valid inputs.
With the help of -Z option in GCC command, 20% of our application which is not in JNI worked. But the remaining 80% of application which is in JNI fails even with -Z option in GCC command.
Is there any command which can be used with GCC or with Javac or somewhere that makes my JNI portion also wrking?
Expecting your inputs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-27-2009 02:41 AM
тАО02-27-2009 02:41 AM
Re: NULL problem in HP server
(If I remember correctly, the -Z flag allows dereferencing of null pointers by mapping a small block of zero-intialised memory starting at address 0, but I'm sure Dennis can correct me on that.)
Java was designed to have no way to ignore reference errors. When you say that the 20% in JNI fails, do you mean it crashes, or do you get Java errors?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-27-2009 03:11 AM
тАО02-27-2009 03:11 AM
Re: NULL problem in HP server
We are creating a shared library which will be used by JVM. -Z doesnt seem to work with shared libraries.. or Java is unable to handle null ptr reference. JVM crashes after receiving a SIGSERV error and a core file and a log file (hs_err_pid28587.log)getting generated.
With all your inputs 20% of Non JNI (exe) worked. Still need your inputs to make the other 80% JNI stuff to work.
is there a way to make java handle the null ptr reference, like how -Z made exe work?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-27-2009 09:06 AM
тАО02-27-2009 09:06 AM
Re: NULL problem in HP server
The Java stack dump would indicate that Java had successfully interpreted the null pointer from the C code as a Java null reference, while the SIGSEGV indicates that the JVM is failing to dereference the null pointer internally.
You could possibly use Dennis' chatr command on the "java" executable itself, but I'm fairly certain that you would then get Java null pointer exceptions (from the dereferenced C null pointer) at some point. There's no way to turn these off in Java, other than by using a try...catch block around the JNI call to handle the exception.