Welcome, Guest. Please login or register.

Author Topic: duktape error NetSurf OS3  (Read 33011 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline DNADNL

  • Jr. Member
  • **
  • Join Date: Jun 2016
  • Posts: 87
    • Show only replies by DNADNL
Re: duktape error NetSurf OS3
« Reply #269 from previous page: August 16, 2016, 01:09:41 AM »
Quote from: chris;812641
duk_custom.h, not duk_config.h
It works here, that's all I can say.
Woops ! Misreading, Sorry ! ^^'
 

Offline Tygre

Re: duktape error NetSurf OS3
« Reply #270 on: August 26, 2016, 01:54:59 AM »
Hi all and Chris and DNADNL in particular :)

I tried to debug this annoying Duktap error that we keep having:
Quote
PANIC 56: uncaught error (calling abort)
and it seems to me that the offending JavaScript code is actually built on the file when Duktap starts and corresponds to the code:
Code: [Select]
(function(d,a){function b(a,b,c){Object.defineProperty(a,b,{value:c,writable:!0,enumerable:!1,configurable:!0})}b(a.Logger,"clog",new a.Logger("C"));b(a,"modLoaded",{})})(this,Duktape);which seems to me legit (at least according to JSFiddle)... Any ideas?

In attachment is the full log... :rtfm: Search for "duk_eval_raw"!

I will continue my debug to try to understand what is happening exactly...
Cheers!

Offline Tygre

Re: duktape error NetSurf OS3
« Reply #271 on: August 26, 2016, 03:12:40 AM »
PS. A little bit more detective work and I found the lines causing the problem:

Code: [Select]
DUK_LOCAL duk_int_t duk__parse_func_like_fnum(duk_compiler_ctx *comp_ctx, duk_bool_t is_decl, duk_bool_t is_setget) {

        // ...

        DUK_D(DUK_DPRINT("second pass of an inner func, skip the function, reparse closing brace; lex offset=%ld, line=%ld",
                             (long) lex_pt.offset, (long) lex_pt.line));

        DUK_LEXER_SETPOINT(&comp_ctx->lex, &lex_pt);
        comp_ctx->curr_token.t = 0;  /* this is needed for regexp mode */
        comp_ctx->curr_token.start_line = 0;  /* needed for line number tracking (becomes prev_token.start_line) */
        duk__advance(comp_ctx);
        duk__advance_expect(comp_ctx, DUK_TOK_RCURLY);

        // ...
}
The offending line is exactly:
Code: [Select]
duk__advance_expect(comp_ctx, DUK_TOK_RCURLY);
because, for some reasons, Duktape expects a right-curly brace but gets an identifier instead... I believe that the syntax-error happens between the right-curly brace and the identifier b in:
Code: [Select]
(function(d,a){function b(a,b,c){Object.defineProperty(a,b,{value:c,writable:!0,enumerable:!1,configurable:!0})}b(a.Logger,"clog",new a.Logger("C"));b(a,"modLoaded",{})})(this,Duktape);Any suggestions? Does this help?

Cheers!

Offline chris

Re: duktape error NetSurf OS3
« Reply #272 on: August 26, 2016, 08:40:45 AM »
@Tygre

Doesn't mean a thing to me. You're probably best off putting it on the netsurf-dev list (try to generate some interest), or putting it on the Duktape bugtracker https://github.com/svaarala/duktape/issues with the log.
Mention it's 68k and NetSurf, Duktape 1.5.0. See what happens.

One thing you could try first, is if you have a standalone build of Duktape 1.5.0 you could run that code through it see if the fatal error still occurs.
"Miracles we do at once, the impossible takes a little longer" - AJS on Hyperion
Avatar picture is Tabitha by Eric W Schwartz
 

Offline Tygre

Re: duktape error NetSurf OS3
« Reply #273 on: August 26, 2016, 07:35:52 PM »
Hi Chris

Thanks Chris!

Quote from: chris;812995
You're probably best off putting it on the netsurf-dev list (try to generate some interest), or putting it on the Duktape bugtracker https://github.com/svaarala/duktape/issues with the log.
Mention it's 68k and NetSurf, Duktape 1.5.0. See what happens.

I contacted yesterday Sami (Vaarala, who helped me few months ago to compile Duktape with VBCC) and I'm now waiting for some answers :laugh1:

Eventually, I will contact NetSurf / Duktape communities...

Quote from: chris;812995
One thing you could try first, is if you have a standalone build of Duktape 1.5.0 you could run that code through it see if the fatal error still occurs.

Yep, same idea here :) I tried with Duktape 1.3.1, worked fine (compiled and run on my Amiga) :angry:

Will try later with 1.5.0...

Talk to you soon!
« Last Edit: August 26, 2016, 07:39:47 PM by Tygre »
 

Offline Tygre

Re: duktape error NetSurf OS3
« Reply #274 on: August 27, 2016, 04:04:14 AM »
Hi Chris and all!

Just to let you know that Sami replied to me very fast and very kindly with several suggestions :angel:

I tried some of his suggestions and got NetSurf and Duktape to compile and run :cool: I am now waiting for his feedback to confirm that my changes make sense or not...

Now, don't get too excited because nothing happens... I loaded various Web pages with JavaScript code and nothing happens but I believe that it could be now due to the way NetSurf handles JavaScript code? :swords:

For example, I noticed something called NETSURF_DUKTAPE_PROTOTYPE_WINDOW in the logs of Duktape... My guess is that this is the "callback" used by NetSurf to control what Duktape should do when it encounters an alert()? Any idea?

Take care!

Offline chris

Re: duktape error NetSurf OS3
« Reply #275 on: August 27, 2016, 06:58:33 AM »
Quote from: Tygre;813026
Hi Chris and all!

Just to let you know that Sami replied to me very fast and very kindly with several suggestions :angel:

I tried some of his suggestions and got NetSurf and Duktape to compile and run :cool: I am now waiting for his feedback to confirm that my changes make sense or not...


Great!

Quote


Now, don't get too excited because nothing happens... I loaded various Web pages with JavaScript code and nothing happens but I believe that it could be now due to the way NetSurf handles JavaScript code? :swords:

For example, I noticed something called NETSURF_DUKTAPE_PROTOTYPE_WINDOW in the logs of Duktape... My guess is that this is the "callback" used by NetSurf to control what Duktape should do when it encounters an alert()? Any idea?


I'm not sure alert() is implemented in any visible way - I don't recall seeing any JS alerts since the changeover to Duktape.

This is a good test page:
http://www.javatester.org/javascript.html
"Miracles we do at once, the impossible takes a little longer" - AJS on Hyperion
Avatar picture is Tabitha by Eric W Schwartz
 

Offline Tygre

Re: duktape error NetSurf OS3
« Reply #276 on: August 27, 2016, 01:57:54 PM »
Hi Chris!

Quote from: chris;813032

I'm not sure alert() is implemented in any visible way - I don't recall seeing any JS alerts since the changeover to Duktape.

This is a good test page:
http://www.javatester.org/javascript.html


Yes, exactly the page I have been using :) but it says that JavaScript is not working, it uses the noscript tag, is it implemented in NetSurf?

Code: [Select]
<script language=&quot;JavaScript&quot;>
     document.write (&quot; &nbsp; JavaScript &nbsp; <b>IS WORKING</b> &nbsp; in your web browser &nbsp;&quot; );
</script>
<noscript>&nbsp; JavaScript <b>IS NOT WORKING</b> in your web browser &nbsp;
</noscript>


I have also used the JavaScripter Web site, which has a simple page with the alert, and my own simpler page, but still no luck:

Code: [Select]
Alert Example




So, alert() may not be implemented but what about a simple document.write()? Into whose backyard does it fall? NetSurf's community?

Cheers! :)

Offline Tygre

Re: duktape error NetSurf OS3
« Reply #277 on: August 27, 2016, 02:00:57 PM »
PS. Sami confirmed that my fix may be the best solution to get Duktape to compile and run on AmigaOS3: all in duk_config.h, DUK_F_USE_REPL_ALL must be defined by:

  • defining AMIGA
  • defining M68000
  • changing the code #elif defined(DUK_F_AMIGAOS) && defined(DUK_F_VBCC) into #elif defined(DUK_F_AMIGAOS)

Let me know!

Offline chris

Re: duktape error NetSurf OS3
« Reply #278 on: August 27, 2016, 07:01:02 PM »
Quote from: Tygre;813044
PS. Sami confirmed that my fix may be the best solution to get Duktape to compile and run on AmigaOS3: all in duk_config.h, DUK_F_USE_REPL_ALL must be defined by:

  • defining AMIGA
  • defining M68000
  • changing the code #elif defined(DUK_F_AMIGAOS) && defined(DUK_F_VBCC) into #elif defined(DUK_F_AMIGAOS)

Let me know!


The first two were already done (well, __m68k__ instead of M68000, but no difference).
The second one appears to have fixed the problem!
Note you need to enable Javascript in NetSurf through Prefs (the menu option just crashes) as using non-JS versions tends to switch it off.

Please thank Sami and ask him to remove that DUK_F_VBCC clause in trunk. (actually, maybe it needs to be changed to DUK_F_M68K - I'll check if this has broken OS4 a bit later! edit OS4 is fine with this change)

I've updated my archive with a JS version for testing.
« Last Edit: August 27, 2016, 10:06:47 PM by chris »
"Miracles we do at once, the impossible takes a little longer" - AJS on Hyperion
Avatar picture is Tabitha by Eric W Schwartz
 

Offline utri007

Re: duktape error NetSurf OS3
« Reply #279 on: August 27, 2016, 10:34:09 PM »
Sorry to say but it doesn't work here. :( It also brokes menus. After I enabled java menus are not accessible anymore. Tested both of my machines with same result. Menu problem is noticeable in picture.

Another thing is that I got illeagal memory Access and needed reboot.
ACube Sam 440ep Flex 800mhz, 1gb ram and 240gb hd and OS4.1FE
A1200 Micronic tower, OS3.9, Apollo 060 66mhz, xPert Merlin, Delfina Lite and Micronic Scandy, 500Gb hd, 66mb ram, DVD-burner and WLAN.
A1200 desktop, OS3.9, Blizzard 060 66mhz, 66mb ram, Ide Fix Express with 160Gb HD and WLAN
A500 OS2.1, GVP+HD8 with 4mb ram, 1mb chip ram and 4gb HD
Commodore CDTV KS3.1, 1mb chip, 4mb fast ram and IDE HD
 

Offline chris

Re: duktape error NetSurf OS3
« Reply #280 on: August 27, 2016, 11:04:57 PM »
I repeat:
Quote
Note you need to enable Javascript in NetSurf through Prefs (the menu option just crashes)
"Miracles we do at once, the impossible takes a little longer" - AJS on Hyperion
Avatar picture is Tabitha by Eric W Schwartz
 

Offline utri007

Re: duktape error NetSurf OS3
« Reply #281 on: August 27, 2016, 11:35:41 PM »
My bad, I should have pay attention. It works.
ACube Sam 440ep Flex 800mhz, 1gb ram and 240gb hd and OS4.1FE
A1200 Micronic tower, OS3.9, Apollo 060 66mhz, xPert Merlin, Delfina Lite and Micronic Scandy, 500Gb hd, 66mb ram, DVD-burner and WLAN.
A1200 desktop, OS3.9, Blizzard 060 66mhz, 66mb ram, Ide Fix Express with 160Gb HD and WLAN
A500 OS2.1, GVP+HD8 with 4mb ram, 1mb chip ram and 4gb HD
Commodore CDTV KS3.1, 1mb chip, 4mb fast ram and IDE HD
 

Offline Tygre

Re: duktape error NetSurf OS3
« Reply #282 on: August 28, 2016, 12:14:42 AM »
Quote from: chris;813067
I repeat:

Thanks Chris!

Where do I find the preference program though? :)

Ah! Silly me :lol: They are in the menus...
« Last Edit: August 28, 2016, 12:19:37 AM by Tygre »
 

Offline Tygre

Re: duktape error NetSurf OS3
« Reply #283 on: August 28, 2016, 12:30:23 AM »
And I am very happy to show that JavaScript works now for me too in NetSurf in AmigaOS3!!!

Code: [Select]

<html><head><title>Alert Example</title></head>
<body>
<script>
      document.write('Hello Amiga World!')
</script>
</body>
</html>


« Last Edit: August 28, 2016, 12:49:27 AM by Tygre »
 

Offline Tygre

Re: duktape error NetSurf OS3
« Reply #284 on: August 28, 2016, 12:48:48 AM »
Chris, how could I help further?
Could we chat by PM or e-mail, please? :)

Cheers!