jbarnette / johnson
- Source
- Commits
- Network (18)
- Issues (5)
- Downloads (3)
- Wiki (3)
- Graphs
-
Branch:
master
-
JS engine warning: leaking GC root 'JSScriptProxy' on Rails Server Shutdown
5 comments Created 3 months ago by shwoodardTitle pretty much says it all. Full message is,
S engine warning: leaking GC root 'JSScriptProxy' at 0x20d3568
JS engine warning: 1 GC root remains after destroying the JSRuntime at 0x3648000.
This root may point to freed memory. Objects reachable through it have not been finalized.script/server:3: [BUG] Bus Error
ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin9.8.0], MBARI 0x8770, Ruby Enterprise Edition 20090928
Comments
-
apply(o) causes "arrayLike is undefined" error at prelude.js:35
1 comment Created 3 months ago by Masksimple example:
var my = { foo: function() { return true; }} my.foo.apply(my);I suggest the following change:
--- a/lib/johnson/js/prelude.js +++ b/lib/johnson/js/prelude.js @@ -30,7 +30,7 @@ Object.defineProperty(String.prototype, "toSymbol", function() { (function(origApply) { Object.defineProperty(Function.prototype, "apply", function(thisObj, arrayLike) { var realArray = arrayLike; - if (!(arrayLike instanceof Array)) { + if (arrayLike !== undefined && !(arrayLike instanceof Array)) { realArray = []; for (var i = arrayLike.length - 1; i >= 0; i--) { realArray[i] = arrayLike[i];Comments
-
second argument to Function.prototype.apply must be an array
1 comment Created 3 months ago by matthewd -
cc -o Darwin_DBG.OBJ/jsprf.o -c -Wall -Wno-format -MMD -g3 -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE -DDARWIN -DX86_LINUX -DDEBUG -DDEBUG_root -DEDITLINE -IDarwin_DBG.OBJ jsprf.c jsprf.c: In function ‘BuildArgArray’: jsprf.c:644: error: incompatible types in assignmentComments
Here's the patch included with MacPorts for Spidermonkey:
--- jsprf.c.orig 2009-07-26 12:32:01.000000000 -0700 +++ jsprf.c 2009-07-26 12:33:12.000000000 -0700 @@ -58,6 +58,8 @@ */ #ifdef HAVE_VA_COPY #define VARARGS_ASSIGN(foo, bar) VA_COPY(foo,bar) +#elif defined(va_copy) +#define VARARGS_ASSIGN(foo, bar) va_copy(foo,bar) #elif defined(HAVE_VA_LIST_AS_ARRAY) #define VARARGS_ASSIGN(foo, bar) foo[0] = bar[0] #elseextconf.rb needs to be changed to use the x86_64 architecture on Snow Leopard. After these two changes I was able to get it to build on Snow Leopard.
I can make these changes in a git repo if you like, but I did it all gimpily and am afraid it might break compatibility on versions of OS X prior to Snow Leopard.
If it helps, the HOSTTYPE environment variable contains the architecture information (i.e. "x86_64")
Snow Leopard folks, could you try building master? e07a90c8 should make a difference.
Okay, reports are that the problem is fixed. Closing.
I'm lost with this same issue on Snow Leopard.
didn't help either:
sudo env HOSTTYPE="x86_64" gem install johnson
sudo env ARCHFLAGS="-arch x86_64" gem install johnson@tarcieri could you share a few more details how you got it running on your SL?
i have the same problem the alexwilde. so could somebody of you great people, write out a short desc how to build it on sl. do i have to patch jsprf.c.
which to changes do I have to make in extconf.rb. tried:
ENV["ARCHFLAGS"] = "-arch x86_64"
does not work
thanks a lot for your time
atmamurti -
1 comment Created 5 months ago by febuilesSegmentation fault in command line.jbarnettexRunning 'johnson some_file' under ruby 1.8.6 (2009-03-31 patchlevel 368) [i686-darwin9.6.2] I get an instant segfault:
$ cat foo.js var x = 3; federico@korobushka ~/programacion/orkut_social/app/public/js (master) $ johnson foo.js JS engine warning: leaking GC root 'JSScriptProxy' at 0x4e4690 JS engine warning: 1 GC root remains after destroying the JSRuntime at 0x39b000. This root may point to freed memory. Objects reachable through it have not been finalized. /usr/local/bin/johnson:19: [BUG] Segmentation fault ruby 1.8.6 (2009-03-31) [i686-darwin9.6.2] Abort trapLet me know if I can do anything to get a better report out of this.
Comments
Technically, the segfault wouldn't've been instant -- if it's the one I think, it was actually occurring at the end of the script, as ruby's interpreter was cleaning up.
Anyway, I believe this should now be fixed -- mostly, as of 6074fee, and now properly, as of d02834b.
At least, the above now exits cleanly for me, on ruby 1.8.7 (2009-06-12 patchlevel 174) [i486-linux].
-
I've been using Johnson's gem and have discovered some (sort of) bugs, but still have no time to check what the precise problem is.
There seems to be a compatibility problem between arrays from the Ruby land in JS, as their behaviour is different:
require 'rubygems' require 'johnson' Js = Johnson::Runtime.new Js['alert'] = lambda { |x| puts x } # Let's test JS arrays Js.evaluate('array = [1,2,3,4]') Js.evaluate('for (i in array) { alert(i) }') # 0 1 2 3 Js.evaluate('for (i in array) { alert(array[i]) }') # 1 2 3 4 # Let's test Ruby arrays acting as JS arrays Js['array'] = [1,2,3,4] Js.evaluate('for (i in array) { alert(i) }') # 2 3 4 5 (should be 0 1 2 3) Js.evaluate('for (i in array) { alert(array[i]) }') # 2 3 4 nil (should be 1 2 3 4)(from https://johnson.lighthouseapp.com/projects/8759/tickets/50)
Comments
-
Comments
-
Comments
-
Looks like there's no way to attach labels at the moment.
Comments
-
Comments
-
This is the first issue.
Comments





The following happened in the middle of execution, not at shutdown.
JS engine warning: leaking GC root 'JSScriptProxy' at 0x2229638
JS engine warning: leaking GC root 'JSScriptProxy' at 0x21ddbb0
JS engine warning: 2 GC roots remain after destroying the JSRuntime at 0x36ea000.
/Users/sam.woodard/Development/visa.git/app/models/business.rb:150: [BUG] Bus Error ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin9.8.0], MBARI 0x8770, Ruby Enterprise Edition 20090928
Could you please try uncommenting the '#define LEAK_ROOT_NAMES' in ext/spidermonkey/runtime.h, to determine which script(s) are leaking?
Actually, a better first question is probably: are you running the last released gem, or newer code from git?
I built the gem from source after cloning the repo from github. This worked better. However, now, I am trying to get another dev env working and I am getting `gem_original_require': no such file to load -- johnson/spidermonkey/spidermonkey (MissingSourceFile) after install Johnson. Any help?
Sorry, I missed a path change during some rearranging.
887053b should improve things.