Can't attach core image through SA tools

David Holmes david.holmes at oracle.com
Tue Jan 31 02:58:57 PST 2012


Hi,

A bug was opened for this just a few days ago - 7133122.

I'll add your patch to the CR.

David Holmes
------------

On 31/01/2012 8:32 PM, Yasumasa Suenaga wrote:
> Hi,
> 
> I've tried attach a corefile with jstack. However, I couldn't.
> 
> I guess that this problem is caused by incorrect address mapping of libsaproc.so .
> I've made a patch which is attached this email. And I've been able to get correct thread stack with jstack.
> 
> So, I'd like to contribute this patch, and I'd like to backport to JDK6/7 .
> Could you help me?
> 
> 
> ------ details ------
> 
> I got these messages then I ran jstack with LIBSAPROC_DEBUG environment variable:
> 
> /*************************/
> 
>    :
> 
> libsaproc DEBUG: reading library /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.1.x86_64/jre/lib/amd64/server/libjvm.so @ 0x7f53b455a000 [ 0x7f53b455a000 ]
> libsaproc DEBUG: ---- sorted virtual address map ----
> 
>    :
> 
> libsaproc DEBUG: base = 0x7f53b455a000  size = 9993772
> libsaproc DEBUG: base = 0x7f53b455a000  size = 4096
> 
>    :
> 
> libsaproc DEBUG: can't locate map_info at 0x7f53b4dbe000
> libsaproc DEBUG: core read failed for 4096 byte(s) @ 0x7f53b4dbe000 (4096 more bytes)
> 
>    :
> 
> /*************************/
> 
> libsaproc.so tries to read libjvm.so library address, and it is duplicated.
> I read Linux kernel source code of function of core dump, and I found these comment:
> 
> source code: kernel-3.2.1-3.fc16.src.rpm (Fedora16 x86_64)
> in fs/binfmt_elf.c: static unsigned long vma_dump_size(struct vm_area_struct *vma, unsigned long mm_flags)
> ----------------------
>          /*
>           * If this looks like the beginning of a DSO or executable mapping,
>           * check for an ELF header.  If we find one, dump the first page to
>           * aid in determining what was mapped here.
>           */
> ----------------------
> 
> In fact, core image has executable load section which size is 1 page(0x1000)
> ----------------------
>    LOAD           0x0000000005173000 0x00007f53b455a000 0x0000000000000000
>                   0x0000000000001000 0x0000000000988000  R E    1000
> ----------------------
> 
> So, we must think these case when we attach core image.
> I modified "read_lib_segments()" in hotspot/agent/src/os/linux/ps_core.c to overwrite
> correct address in shared library .
> 
> 
> Please check it.
> 
> Thanks,
> Yasumasa
> 


More information about the serviceability-dev mailing list