These are chat archives for chrisber/v8dotnet/development-mono

11th
Feb 2015
Mikael Håkansson
@wmmihaa
Feb 11 2015 08:41
Hi Chrisber
I have now try to get to the bottom of this problem. The reason I couldn't get this to work for .Net was the fact that I compiled it for .Net 4.5. Changed it to 4.0, and all worked fine... But not for my mono build...
The build goes well, and I get the output. To make sure it's not a reference problem, I updated the V8.Net-Console demo (program.cs). I changed the Main method, and added MyConsole class:
public static void Main (string[] args)
{
var script = @"myconsole.log('this would freek me out');";
//script = @"var x = 1 + 3;";
using (var engine = new V8Engine ())
{
try
{
engine.RegisterType<MyConsole>(null,recursive:true);
engine.GlobalObject.SetProperty("myconsole", new MyConsole());
var scriptHandle = engine.Compile(script, "V8.Net", true);
engine.Execute(scriptHandle, true);
            }
            catch (Exception ex) {
                var s = ex.Message;
                Console.WriteLine ("ERROR: " + s);
            }

        }
        System.Console.WriteLine ("Done");
        Console.ReadKey ();
    }
Mikael Håkansson
@wmmihaa
Feb 11 2015 08:46
public class SamplePointFunctionTemplate : FunctionTemplate
{
    public SamplePointFunctionTemplate() { }

    protected override void OnInitialized()
    {
        base.OnInitialized();
    }
}
(Sorry about the paste issue)... All builds without any issues, but when I run it, i get the following error:

Mikael-MacBook-Air:Debug citronc2$ mono V8.Net-Console.exe
Stacktrace:

at <unknown> <0xffffffff>
at (wrapper managed-to-native) V8.Net.V8NetProxy.V8ExecuteCompiledScript (V8.Net.NativeV8EngineProxy,V8.Net.HandleProxy) <0xffffffff>
at V8.Net.V8Engine.Execute (V8.Net.Handle,bool) <0x00047>
at V8.Net.Program.Main (string[]) <0x0018f>
at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

Debug info from gdb:

(lldb) command source -s 0 '/tmp/mono-gdb-commands.r8w1GA'
Executing commands in '/private/tmp/mono-gdb-commands.r8w1GA'.
(lldb) process attach --pid 55129
warning: (i386) /Library/Frameworks/Mono.framework/Versions/3.12.0/lib/mono/4.5/mscorlib.dll.dylib empty dSYM file detected, dSYM was created with an executable with no debug info.
Process 55129 stopped
Executable module set to "/usr/bin/mono".
Architecture set to: i386-apple-macosx.
(lldb) thread list
Process 55129 stopped

  • thread #1: tid = 0x76f1d, 0x98f90e16 libsystem_kernel.dylib__wait4 + 10, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP thread #2: tid = 0x76f25, 0x98f8aa0a libsystem_kernel.dylibsemaphore_wait_trap + 10
    thread #3: tid = 0x76f26, 0x98f918ce libsystem_kernel.dylibkevent64 + 10, queue = 'com.apple.libdispatch-manager' thread #4: tid = 0x76f27, 0x98f8aa0a libsystem_kernel.dylibsemaphore_wait_trap + 10, name = 'OptimizingCompi'
    thread #5: tid = 0x76f28, 0x98f8aa0a libsystem_kernel.dylibsemaphore_wait_trap + 10, name = 'V8 WorkerThread' thread #6: tid = 0x76f29, 0x98f8aa0a libsystem_kernel.dylibsemaphore_wait_trap + 10, name = 'V8 WorkerThread'
    thread #7: tid = 0x76f2a, 0x98f8aa0a libsystem_kernel.dylibsemaphore_wait_trap + 10, name = 'V8 WorkerThread' thread #8: tid = 0x76f2b, 0x98f8aa0a libsystem_kernel.dylibsemaphore_wait_trap + 10, name = 'V8 WorkerThread'
    thread #9: tid = 0x76f34, 0x98f908f6 libsystem_kernel.dylib__semwait_signal + 10 thread #10: tid = 0x76f35, 0x98f90e6a libsystem_kernel.dylibworkq_kernreturn + 10
    thread #11: tid = 0x76f36, 0x98f90e6a libsystem_kernel.dylib`
    workq_kernreturn + 10
    thread #12: tid = 0x76f3f, 0x98f90e6a libsystem_kernel.dylib`__workq_kernreturn + 10
    (lldb) thread backtrace all
  • thread #1: tid = 0x76f1d, 0x98f90e16 libsystem_kernel.dylib`__wait4 + 10, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP

    • frame #0: 0x98f90e16 libsystem_kernel.dylib__wait4 + 10 frame #1: 0x91bdeb15 libsystem_c.dylibwaitpid$UNIX2003 + 48
      frame #2: 0x000c5f5d monomono_handle_native_sigsegv(signal=11, ctx=0x007dbfe0) + 541 at mini-exceptions.c:2323 frame #3: 0x00114f6b monomono_arch_handle_altstack_exception(sigctx=<unavailable>, fault_addr=<unavailable>, stack_ovf=0) + 155 at exceptions-x86.c:1106
      frame #4: 0x00018e5d monomono_sigsegv_signal_handler(_dummy=<unavailable>, _info=<unavailable>, context=<unavailable>) + 445 at mini.c:6858 frame #5: 0x992d703b libsystem_platform.dylib_sigtramp + 43

    thread #2: tid = 0x76f25, 0x98f8aa0a libsystem_kernel.dylibsemaphore_wait_trap + 10 frame #0: 0x98f8aa0a libsystem_kernel.dylibsemaphore_wait_trap + 10
    frame #1: 0x0025cc3a monomono_sem_wait(sem=0x003624b8, alertable=1) + 26 at mono-semaphore.c:103 frame #2: 0x001d7b9e monofinalizer_thread(unused=0x00000000) + 142 at gc.c:1077
    frame #3: 0x001b5f81 monostart_wrapper [inlined] start_wrapper_internal + 484 at threads.c:663 frame #4: 0x001b5d9d monostart_wrapper(data=<unavailable>) + 29 at threads.c:710
    frame #5: 0x00262160 monoinner_start_thread(arg=<unavailable>) + 240 at mono-threads-posix.c:88 frame #6: 0x972aae13 libsystem_pthread.dylib_pthread_body + 138
    frame #7: 0x972aad89 libsystem_pthread.dylib_pthread_start + 162 frame #8: 0x972a8e52 libsystem_pthread.dylibthread_start + 34

    thread #3: tid = 0x76f26, 0x98f918ce libsystem_kernel.dylibkevent64 + 10, queue = 'com.apple.libdispatch-manager' frame #0: 0x98f918ce libsystem_kernel.dylibkevent64 + 10
    frame #1: 0x99e9f73f libdispatch.dylib`_dispatch_mgr_invoke + 24

Mikael Håkansson
@wmmihaa
Feb 11 2015 08:52
Goes on for a while... I can send you the whole trace if it's makes sense to you...
Any ideas?
Christian Karl Bernasko
@chrisber
Feb 11 2015 10:58
No, on osx is just something that is to investigate.
Christian Karl Bernasko
@chrisber
Feb 11 2015 11:47
Yes please send me the whole stack trace can you post it as gist?
Is this the console application that you are running?
Did you have copied the libV8_Net_Proxy.dylib to Debug/?
Christian Karl Bernasko
@chrisber
Feb 11 2015 11:52
cp "Build/ia32.debug/makefiles/out/Default"/libV8_Net_Proxy.dylib to Result/Debug ? at this point the script is incomplete. You need to do it manually. Working on a better solution, a python script which can be executed on osx/linux/win