[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: JVM crash on calling the JNI api



Karthik Sudarshan <ksudarshan@xxxxxxxxxx> said:
>     I need to get the values of the attributes passed in the SAML assertion
> in response to an Auth request, in my servlet application. For this I've
> written a servlet filter which intercepts all requests, and gets the
> ZXIDSES cookie (already set by mod_auth_saml), and make a native call to
> fed_mgmt like
> 
> zxidjni.fed_mgmt("PATH=/var/zxid/", sessionId, 0x54);

If your goal is to get the attributes, the method involving
zxidjni.fetch_ses() followed by zxidjni.ses_to_qs() might
be easier, as mentioned in my other mail.

> But when this call is made the JVM crashes.
> 
> If someone can throw some light on this, it will be helpful.
> 
> My environment :
> 
> libzxidjni.so (compiled on Ubuntu 64 bit from version 1.16 zxid)
> 
> openjdk-6 (64-bit)
> 
> The relevant stack trace from the crash log is below :
> 
> Stack: [0x00007f5b24971000,0x00007f5b24a72000],  sp=0x00007f5b24a70290,
> free space=1020k
> Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native
> code)
> C  [libzxidjni.so+0x118752]  zx_alloc+0x39

Looks scary. Problem in memory allocation. Has heap been
corrupted by earlier code?

--Sampo

> C  [libzxidjni.so+0x164b68]  zxid_init_conf+0x72
> C  [libzxidjni.so+0x135a56]  zxid_conf_to_cf_len+0x106
> C  [libzxidjni.so+0x1371aa]  zxid_fed_mgmt_len+0x5a
> C  [libzxidjni.so+0x137222]  zxid_fed_mgmt+0x36
> C  [libzxidjni.so+0xfc6ac]  Java_zxidjava_zxidjniJNI_zxid_1fed_1mgmt+0xe8
> j
> zxidjava.zxidjniJNI.zxid_fed_mgmt(Ljava/lang/String;Ljava/lang/String;I)Ljava/lang/String;+0
> j
> zxidjava.zxidjni.fed_mgmt(Ljava/lang/String;Ljava/lang/String;I)Ljava/lang/String;+3
> 
> Regards,
> Karthik