JSValue string problem

Oops, did something break? Give us a heads-up!

JSValue string problem

Postby Chjoodge on Sat Jan 17, 2009 12:47 am

My application would sometimes crash on calling the JS callback. I backed up to the simpliest callback implementation:

Code: Select all
class c
{
public:
   void v (const Awesomium::JSArguments& args)
   {
      string s = args[0].toString();
   }
};
c cI;

Navi* n = createNavi(name, NaviPosition(posX, posY), sizeX, sizeY);
n->loadFile(fileName);
n->setCallback("call", NaviDelegate(&cI, &c::v));


And the page that I'm loading into the Navi contains a simple square:

Code: Select all
<div id="area" style="width: 50px; height: 50px; background-color: #6600ff;" onMouseOver="Client.call('that's what she said');"></div>


This simpliest example still sometimes crashes, that is, depending on the string that the callback is passing. For example, that's what she said in the example crashes the application. These are strings that crash the application:

Code: Select all
   
and then he said
and then he said:
and then he said:_
and then he said: 'hi there'
that's what she said
that's what she said_
that's what she said:
that's what she said:_
onMouseDown(1,2,3,4)

(An underscore being a space.)


What actually happens is that the callback gets called, the string is read just fine:

Code: Select all
string s = args[0].toString();


...then whatever would follow is still run and then, when leaving the callback method, the application throws a debug validation error:

Code: Select all
HEAP[Spider.exe]: Invalid Address specified to RtlValidateHeap( 02C00000, 1A578628 )


Can this be a bug somewhere in the JSValue? Could someone at least duplicate this, or prove me wrong? Because this really seems weird :?
User avatar
Chjoodge
 
Posts: 19
Joined: Tue Nov 04, 2008 2:56 pm

Re: JSValue string problem

Postby AjS15822 on Sat Jan 17, 2009 2:05 am

Sorry about that-- you're getting a confirmed bug in the build of Awesomium that is in the NaviLibrary SVN-- I've fixed this recently but haven't updated the online build yet.
I am always doing that which I can not do, in order that I may learn how to do it. - Pablo Picasso
User avatar
AjS15822
Site Admin
 
Posts: 466
Joined: Fri Sep 07, 2007 11:24 pm

Re: JSValue string problem

Postby Chjoodge on Sat Jan 17, 2009 5:01 pm

That's good news, thanks.
User avatar
Chjoodge
 
Posts: 19
Joined: Tue Nov 04, 2008 2:56 pm

Re: JSValue string problem

Postby Klaim on Sat Jan 17, 2009 6:42 pm

Code: Select all
Client.call('that's what she said')


Isn't it invalid? The second ' character makes this an error, isn't it? - I'm not a javascript specialist..
User avatar
Klaim
 
Posts: 50
Joined: Sun Dec 16, 2007 12:38 am

Re: JSValue string problem

Postby Chjoodge on Sun Jan 18, 2009 5:56 pm

True, the quote needs to be escaped. I do have it escaped in the real code, I just didn't escape it in the post.

Code: Select all
Client.call('that\'s what she said')
User avatar
Chjoodge
 
Posts: 19
Joined: Tue Nov 04, 2008 2:56 pm

Re: JSValue string problem

Postby Chjoodge on Wed Jan 28, 2009 2:35 pm

AjS15822 wrote:Sorry about that-- you're getting a confirmed bug in the build of Awesomium that is in the NaviLibrary SVN-- I've fixed this recently but haven't updated the online build yet.

Could you please upload the fixed Awesomium to the SVN? I'm still getting this with even with the current HEAD.
User avatar
Chjoodge
 
Posts: 19
Joined: Tue Nov 04, 2008 2:56 pm

Re: JSValue string problem

Postby filipecruz on Wed Jan 28, 2009 6:11 pm

also waiting on that promised update :(
User avatar
filipecruz
 
Posts: 11
Joined: Fri Dec 19, 2008 12:49 pm

Re: JSValue string problem

Postby Klaim on Thu Jan 29, 2009 3:00 pm

Please read http://ajeanius.wordpress.com/2009/01/18/whats-up/

Working on the projects, installing and set-up a server and working on license stuff takes a lot of time.
So, be patient, Aj is clearly overloaded but I guess the release will come soon enough.
User avatar
Klaim
 
Posts: 50
Joined: Sun Dec 16, 2007 12:38 am

Re: JSValue string problem

Postby Chjoodge on Thu Jan 29, 2009 3:55 pm

I guessed :D
User avatar
Chjoodge
 
Posts: 19
Joined: Tue Nov 04, 2008 2:56 pm


Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 1 guest

cron