×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Jun 2006
    Location
    Lahore, Pakistan
    Posts
    162

    IKSEMEL parser for Gizmo

    I need little help regarding Gizmo IKsemel parser. Actually I have successfully compiled and Loaded the ECom-Plug in , but when I make call to any function then it crashes the application. here is the example code


    CXmppXmlParserIF* aXmppXmlParserIF = NULL;
    TRAPD(error,aXmppXmlParserIF = CXmppXmlParserIF::NewL());

    iksid *sid;
    sid =static_cast<iksid*>(malloc(sizeof(iksid)));
    char usr[20]="abc9876";

    const char *p = "123456";
    const char *id = "id";

    iks *s = aXmppXmlParserIF ->m_iks_make_auth(sid,p,id );// it Crashes here,
    Sajid Iqbal
    ASD, Accredited S60 Developer
    [EMAIL]saji.iq@gmail.com[/EMAIL]

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,673

    Re: IKSEMEL parser for Gizmo

    Are you serious about that ASD+S60 ASD stuff?
    You have not provided even a panic code.
    And what do you expect from "sid =static_cast<iksid*>(malloc(sizeof(iksid)));"? It results in a completely uninitialized object, why should such thing work?
    After downloading that gizmo stuff (never seen it before), I have simply searched for iksid with a file manager.
    Do you know what was the very first hit?
    Quote Originally Posted by iksemel.h
    iksid *iks_id_new (ikstack *s, const char *jid);
    I would use this one.
    A few seconds later it turned out that iksid is a struct:
    Quote Originally Posted by iksemel_types.h
    typedef struct iksid_struct {
    char *user;
    char *server;
    char *resource;
    char *partial;
    char *full;
    } iksid;
    certainly not something that a malloc could initialize.

  3. #3
    Registered User
    Join Date
    Jun 2006
    Location
    Lahore, Pakistan
    Posts
    162

    Re: IKSEMEL parser for Gizmo

    certainly I am serious about the stuff, I am not writing production code yet just experimenting with Gizmo IKSEMEL, and for your information , I have to do that, it is not in symbian rather it is in C and I have verified everything by doing "On Device Debugging" "sid" is properly initialized and there is no problem with the structure allocation and initialization everything is ok, So please experiment things before writing anything. if you do not know the ans, do not put you ideas on forum.

    The problem is somewhat with ECom-plugin , I am working on it, Once it is get resloved , I will let you know where is the problem.
    Sajid Iqbal
    ASD, Accredited S60 Developer
    [EMAIL]saji.iq@gmail.com[/EMAIL]

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,673

    Re: IKSEMEL parser for Gizmo

    Ok, I am sorry. Forget the flame, and focus on the problem: malloc allocates a block of memory, it does not even zeroes its content. So after a malloc we have a memory block, full of garbage (remains of previous uses of the same memory block), practically random values.
    Now let us pass a pointer to this valid memory block which is having invalid/uninitialized contents:
    Quote Originally Posted by xmppxmlparser.cpp
    iks* CXmppXmlParser::m_iks_make_auth (iksid *id, const char *pass, const char *sid)
    {
    return iks_make_auth ( id, pass, sid );
    }
    partial success, it actuall invokes an other method. But obviously we do not give it up so easily:
    Quote Originally Posted by jabber.c
    iks *
    iks_make_auth (iksid *id, const char *pass, const char *sid)
    {
    iks *x, *y;

    x = iks_new ("iq");
    iks_insert_attrib (x, "type", "set");
    y = iks_insert (x, "query");
    iks_insert_attrib (y, "xmlns", IKS_NS_AUTH);
    iks_insert_cdata (iks_insert (y, "username"), id->user, 0);
    ...
    where id->user points to a location on the Moon, that is the problem.

    My bet is still that "iksid *iks_id_new (ikstack *s, const char *jid);" could do a better job than malloc. It is also appears to be wrapped into CXmppXmlParser, as "m_iks_id_new".

Similar Threads

  1. XML Parser in C++
    By mrinal_malhotra in forum Symbian
    Replies: 4
    Last Post: 2008-11-10, 13:22
  2. Where is parser (for code coverage)
    By JOM in forum Symbian
    Replies: 4
    Last Post: 2008-05-07, 11:16
  3. kXML XML Parser versus Jsr172 API Parser
    By javame.developer in forum Mobile Java General
    Replies: 1
    Last Post: 2008-02-14, 20:23
  4. Replies: 5
    Last Post: 2005-10-21, 12:38
  5. Replies: 0
    Last Post: 2002-09-30, 15:54

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×