This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gcc, dlltool, mex, matlab


Hi,

	I'm creating some dlls to be used within matlab (mex files). I got
everything to compile but matlab crashes when I run my dlls. The
problem happens even with a very basic mex file. Does anyone have a clue?
(detailed info follows)

Thanks for you help,

				Andre Hentz

Operating system: WindowsXP (no service packs)
Cygwin setup version: 2.249.2.5
GCC version: 3.2 20020818 (prerelease)
Matlab version: 6.0.0.88

Error description:
   1) when running from (regular) matlab
      > mymex         (crash)
      c:\matlabr12\bin\win32\matlab.exe: *** 2. unable to allocate heap,
      heap_chunk_size 1073741824, Win32 error 8
   2) when running frm matlab /nojvm /nosplash
      > mymex         (first time ok)
      > mymex         (as many times as I want)
      > clear mymex   (works fine; removes mymex from memory)
      > mymex         (crash)
        6 [main] ? 0 cygheap_fixup_in_child: Couldn't reserve space for
        cygwin's heap (0x61680000 <0x0>) in child, Win32 error 487
        c:\matlabr12\bin\win32\matlab.exe: *** m.AllocationBase
        0x61680000, m.BaseAddress 0x61680000, m.RegionSize 0x7000, m.State
        0x1000

    (Note: I figured that I had set heap_chunk_in_mb to 1GB in order to
compile Xerces. After removing that setting and rebooting the error I get
is always like #2 above, even in (regular) matlab)

The source code:
  #include "mex.h"
  void mexFunction(int nlhs, mxArray *plhs[],
                   int nrhs, const mxArray *prhs[])
  {
  }

Compilation commands:
  gcc -c -I/cygdrive/c/matlabR12/extern/include -Wall mymex.cpp -o mymex.o
  dllwrap --driver-name gcc --def mex.def -o mymex.dll -s mymex.o

This is mex.def
EXPORTS
mexFunction

gcc -V:
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.2/specs
Configured with: /netrel/src/gcc-3.2-1/configure
--enable-languages=c,c++,f77,java --enable-libgcj --enable-threads=posix
--with-system-zlib --enable-nls --without-included-gettext
--enable-interpreter --disable-sjlj-exceptions
--disable-version-specific-runtime-libs --enable-shared
--build=i686-pc-linux --host=i686-pc-cygwin --target=i686-pc-cygwin
--enable-haifa --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc
--libdir=/usr/lib --includedir=/nonexistent/include --libexecdir=/usr/sbin
Thread model: posix
gcc version 3.2 20020818 (prerelease)




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]