- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Dynamic memory allocation problem ( VMError14repor...
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
тАО01-13-2009 06:39 AM
тАО01-13-2009 06:39 AM
Dynamic memory allocation problem ( VMError14report_and_dieEv .........libjvm.so)
JVM : 1.6.0.02 ( i use in 64 bit mode IA64W )
I am using Using JNI .
compiled the jni code using the
Compiling options:
cc +z -c +DD64 -Ae +u4 -mt -I/opt/java6/include -I/opt/java6/include/hp-ux cImpl.c
Linker Options:
ld -b -o libcImpl.so cImpl.o
All the 3 senarious are called using jni
This is some what interesting problem which i found. There are 3 senarious..
1.)
int arr[5];
arr[0]=0;
printf(" sucessfull executed ");
This Got executed properly. sucessfull executed was printed
2.)
int count = 0,*arrIndex = NULL;
arrIndex= (int*)malloc(sizeof(int)*4);
for(count=0;count<4;count++)
arrIndex[count]=count;
This senario is failling for the first iteration it self. ( dynamic memory allocation )
3.)
int count = 0,*arrIndex = NULL,*tempIndex = NULL;
arrIndex= (int*)malloc(sizeof(int)*4);
tempIndex = arrIndex;
for(count=0;count<4;count++)
{
printf("count value :%d\n", count);
*tempIndex=count;
tempIndex++;
}
This also got failed just by printing
count value :0
2nd & 3rd senarious are giving the error messg as
Error message:
0xc0000000091d6b00 VMError::report_and_die{_ZN7VMError14report_and_dieEv} + 0x110 [/opt/java6/jre/lib/IA64W/server/libjvm.so]
##########################
Here u can see the VMError14report_and_dieEv ...libjvm.so.
What may be the cause for this..Is it a JVM problem ? If yes then what is the resolution for this.
Plz share u r thoughts on this.
Any help is appreciable.
Thanks in advance,
Gopi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-13-2009 07:41 AM
тАО01-13-2009 07:41 AM
Re: Dynamic memory allocation problem ( VMError14report_and_dieEv .........libjvm.so)
That makes me strongly suspect that you aren't including the appropriate header (#include
- Tags:
- malloc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-13-2009 04:27 PM
тАО01-13-2009 04:27 PM
Re: Dynamic memory allocation problem ( VMError14report_and_dieEv .........libjvm.so)
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1302344
Instead of calling this from java, you should call your JNI routines from C to make sure they work.
>2nd & 3rd scenarios are giving the error message as
This isn't the real error message. It is the signal here in frame 4:
(3) 0xe0000001120028e0 ---- Signal 11 (SIGSEGV) delivered ----
(4) 0xc0000000083e5d71 Java_TestJava2CallingNative_getCPUIndexMap + 0x191 at cImpl.c:63 [/home/nalgo01/Test/libcImpl.so]
Then you just fire up your debugger and debug:
$ gdb /opt/java1.5/bin/IA64W/java
(gdb) r -d64 TestJava2CallingNative cImpl
Program received signal SIGSEGV, Segmentation fault
si_code: 2 - SEGV_ACCERR - Invalid Permissions for object.
0x9fffffffbded6d10:0 in os::Hpux::generate_page_zero_trap ()
(ignore this bogus signal)
(gdb) c
Continuing.
Library cImpl successfully loaded
Calling sayHelloWorld
C says HelloWorld via stdio
Process ID :7203
All done
Program received signal SIGSEGV, Segmentation fault
si_code: 1 - SEGV_MAPERR - Address not mapped to object.
0x9fffffffbcd02d60:0 in Java_TestJava2CallingNative_getCPUIndexMaptype
(env=0x60000000000508a0, obj=0x9fffffffbefff688) at cImpl.c:64
64 arrIndex[count]=count;
(gdb) p arrIndex
$1 = (int *) 0x3a44d0
And this address has been truncated as Don said.
>Don: one thing that screams out at me - never cast the result of malloc() [it returns a void * -- which is compatible with all other pointers by definition].
This isn't valid for C++. You must cast the result of malloc.
>such that the compiler has to assume such an undeclared function returns an int
A newer compiler assumes it is an error and gives:
error #4313-D: no prototype or definition in scope for call to memory allocation routine "malloc"
arrIndex= (int*)malloc(sizeof(int)*numOfProc);
- Tags:
- SIGSEGV
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-13-2009 08:43 PM
тАО01-13-2009 08:43 PM
Re: Dynamic memory allocation problem ( VMError14report_and_dieEv .........libjvm.so)
Thanxs alot for taking some of your valuable time and replying back.
Will be doing the nessasary changes what u have mentioned and replying back.
Thanks a lot,
Gopi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-13-2009 11:11 PM
тАО01-13-2009 11:11 PM
Re: Dynamic memory allocation problem ( VMError14report_and_dieEv .........libjvm.so)
included #include
But when i tried it on my application it is giving the
Error as :
java.lang.UnsatisfiedLinkError: Can't load library:/home/nalgo01/Probeing/libHPUXItanium64Stats.so )
Plz refer the following link below for the detail info:
http://forums11.itrc.hp.com/service/forums/questionanswer.do?admit=109447626+1231904747519+28353475&threadId=1302344
Any help is appreceated
Thanking in advance,
Gopi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-14-2009 12:26 AM
тАО01-14-2009 12:26 AM
Re: Dynamic memory allocation problem ( VMError14report_and_dieEv .........libjvm.so)
If our answers were helpful, please read the following about assigning points:
http://forums.itrc.hp.com/service/forums/helptips.do?#33