[Scilab-users] Minimal mono/call_scilab example crashes with optimizations turned on

Bogdan Burlacu froz3nshade at gmail.com
Fri Nov 8 10:28:52 CET 2013


Hello,

I am using Scilab-5.4.1 and mono-3.2.3, on 64-bit arch linux.

I've attached a minimal example in the file test.cs (also posted on
http://pastebin.com/JukugFFs).

The code is compiled with 'gmcs /reference:Mono.Posix.dll /unsafe
test.cs'

If I run it with 'mono -O=all test.exe', I get the following error:
$ mono -O=all test.exe
Trying to load test native library
Bool matrix: 
False True False 
True False True 
Stacktrace:

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native)
  object.__icall_wrapper_mono_marshal_free (intptr) <0xffffffff> at
  (wrapper managed-to-native) Test.createNamedMatrixOfBoolean
  (intptr,string,int,int,int[]) <0xffffffff> at
  Test.createNamedMatrixOfBoolean (string,int,int,bool[]) <0x000cb> at
  Test.Main () <0x0013b> at (wrapper runtime-invoke)
  object.runtime_invoke_void (object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

        mono() [0x4b5bc1]
        mono() [0x50cc3b]
        mono() [0x423f82]
        /usr/lib/libpthread.so.0(+0xf870) [0x7f62b9d29870]
        /usr/lib/libc.so.6(cfree+0x14) [0x7f62b99eb094]
        [0x41324e4a]

If I run it with 'mono -O=all,-deadce test.exe', everything works fine.

Can anyone explain this behaviour? I think it has to do with the
initialization of a new int array inside the createNamedMatrixOfBoolean
method. 

Thanks,
Bogdan



More information about the users mailing list