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

Re: JVM crash on calling the JNI api



Hi Sampo,
        Sorry missed out on the JVM crash part. There is no messing with
heap memory from the program. The simple_api is not even called in the
program. Since I use mod_auth_saml, I just created a session using the
browser, and for the test program, I gave the sessionId as the input and
tried to call the fed_mgmt and that's when I got  the error. Is there
anything in the zxid_simple() call that is made by mod_auth_saml, that
warrants the fed_mgmt() to not work?

Regards,
Karthik


On Mon, Dec 2, 2013 at 11:34 AM, Karthik Sudarshan <ksudarshan@xxxxxxxxxx>wrote:

> Hi Sampo,
>      I tried your suggestion and was able to get the LDIF and QS formats.
> But I got a JVM crash when trying to get the json.
> Does it mean that the auto_flags need to be set properly in the original
> zxid_simple() call to get the JSON appropriately? Since I'm using
> mod_auth_saml, is there a way that I can do this?
>
> However, after getting the LDIF, I was able to parse the same in Java and
> get the attribute values, so thank you.
>
> Just an addendum:
>
> Last week, I was searching for alternate ways of getting the attributes
> from the api, and had this below list of calls:
>
>    1. zxid_ses ses = zxidjni.fetch_ses(conf, sessionId);
>    2. zxid_a7n a7n = zxidjni.ses_a7n_get(ses);
>    3. SWIGTYPE_p_zx_sa_Attribute_s attribute = zxidjni.find_attribute(a7n,
> -1, null, -1, "attrName", -1, null, 1);
>
> The statement number 3 would return an Attribute object, but after that I
> didn't know how to get the value out of that object. So was stuck there. If
> you can let me know of a way of getting the attribute value from the
> object, then I can get rid of the parsing of the ldif completely, and use
> only the apis to get the attribute values.
>
> Regards,
> Karthik
>
>
>
> On Wed, Nov 27, 2013 at 7:07 PM, <sampo@xxxxxxxxx> wrote:
>
>> 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
>>
>>
>

-- 

------------------------------
<http://www.xtivia.com>  <http://www.virtual-dba.com/> <http://www.virtual-dba.com/><http://www.virtual-asa.com/>
  <http://www.facebook.com/Xtivia>  <http://twitter.com/#!/xtivia> <http://www.linkedin.com/company/xtivia>
  <http://blogs.xtivia.com>  <http://www.xtivia.com/resources/webinars>
*Xtivia Virtual-Services (DBA/ASA) Customer Support: (800) 205-7537*
------------------------------
This e-mail may contain confidential or privileged information. If you 
believe you have received this e-mail in error, please notify the sender by 
reply e-mail and then delete this e-mail immediately.