This is the mail archive of the cygwin 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]

Octave's oct-modules built with gcc-3.4.4-1 crash octave.


Hi,

The binary octave modules compiled with gcc-3.4.4 don't work.
Installing the gcc-3.3.3-3 compiler version makes oct modules
work again. I use a 'myones.cpp' code as an example below.

When debugging octave with gdb I saw even more subtle
problems which may be caused by cygwin, gdb, or octave.
My cygwin dll is 1.5.19-4, also tried 1.5.18 but there were
already different problems: octave and other programs
(sed, find, etc.) complain about missing dll modules.
My whole cygwin system is installed using the normal
cygwin installer using the ftp://ftp.funet.fi mirror.


1. Example code:
------------------ myones.cpp ------------------
#include <octave/config.h>
#include <octave/defun-dld.h>

DEFUN_DLD ( myones, args, ,"" )
{
    if (args.length() != 2)
    {
        error("Expecting 2 arguments.");
        return octave_value_list();
    }

    int r = args(0).int_value();
    int c = args(1).int_value();
    Matrix f(r, c);

    for (int j = 0; j < c; j++)
    {
        for (int i = 0; i < r; i++)
        {
            f(i, j) = 1.0;
        } // for (int i = 0; i < r; i++)
    } // for (int j = 0; j < c; j++)
    return octave_value_list(1, f);
} // DEFUN_DLD
------------------ myones.cpp ------------------



2. Example command sequence in bash, gcc-3.4.4-1 installed:
The oct module is builds normally but octave exits silently
when running the dynamically loadable function!
--------------------------- gcc-3.4.4-1 ------------------------------
$ gcc -v
Reading specs from /usr/lib/gcc/i686-pc-cygwin/3.4.4/specs
Configured with: /gcc/gcc-3.4.4/gcc-3.4.4-1/configure --verbose --prefix=/usr --
exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib --man
dir=/usr/share/man --infodir=/usr/share/info --enable-languages=c,ada,c++,d,f77,
java,objc --enable-nls --without-included-gettext --enable-version-specific-runt
ime-libs --without-x --enable-libgcj --disable-java-awt --with-system-zlib --ena
ble-interpreter --disable-libgcj-debug --enable-threads=posix --enable-java-gc=b
oehm --disable-win32-registry --enable-sjlj-exceptions --enable-hash-synchroniza
tion --enable-libstdcxx-debug : (reconfigured) 
Thread model: posix
gcc version 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125)
$ mkoctfile myones.cpp
$ octave --quiet
octave:1> myones
$ 
--------------------------- gcc-3.4.4-1 ------------------------------


3. Example command sequence in bash, gcc-3.3.3-3 installed:
The oct module is builds normally and the output of myones
dynamically loadable function without arguments is as expected.
Also octave stays up and prompts user for next command.
--------------------------- gcc-3.3.3-3 ------------------------------
$ gcc -v
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/specs
Configured with: /gcc/gcc-3.3.3-3/configure --verbose --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --enable-languages=c,ada,c++,d,f77,java,objc,pascal --enable-nls --without-included-gettext --enable-libgcj --with-system-zlib --enable-interpreter --enable-threads=posix --enable-java-gc=boehm --enable-sjlj-exceptions --disable-version-specific-runtime-libs --disable-win32-registry
Thread model: posix
gcc version 3.3.3 (cygwin special)
$ mkoctfile myones.cpp
$ octave --quiet
octave:1> myones
error: Expecting 2 arguments.
octave:1> quit
$ 
--------------------------- gcc-3.3.3-3 ------------------------------


4. Running octave with gdb suprisingly causes segmentation fault.
The following happens, of course, indepent of the installed gcc version.
This looks like some subtle problem, maybe with cygwin dll,
octave, or gdb. Skillful people, please investigate, also try to
reproduce and verify the problem. Stack trace is included.

$ gdb octave 
GNU gdb 6.3.50_2004-12-28-cvs (cygwin-special)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-cygwin"...(no debugging symbols found)

(gdb) run        
Starting program: /usr/bin/octave.exe 

Program received signal SIGSEGV, Segmentation fault.
0x610ae938 in pthread_key_create () from /usr/bin/cygwin1.dll
(gdb) bt
#0  0x610ae938 in pthread_key_create () from /usr/bin/cygwin1.dll
#1  0x6108dd7f in _sigfe () from /usr/bin/cygwin1.dll
#2  0x7c91056d in ntdll!RtlFreeThreadActivationContextStack () from ntdll.dll
#3  0x00464fc8 in ?? ()
#4  0x70e76b90 in octave_restore_signal_mask () from /usr/bin/libcruft.dll
#5  0x610af6b7 in pthread::once () from /usr/bin/cygwin1.dll
#6  0x6108dd7f in _sigfe () from /usr/bin/cygwin1.dll
#7  0x0022ed98 in ?? ()
#8  0x70e543bb in octave_restore_signal_mask () from /usr/bin/libcruft.dll
#9  0x70e543bb in octave_restore_signal_mask () from /usr/bin/libcruft.dll
#10 0x70e48839 in octave_restore_signal_mask () from /usr/bin/libcruft.dll
#11 0x70e48c81 in octave_restore_signal_mask () from /usr/bin/libcruft.dll
#12 0x70e4a958 in octave_restore_signal_mask () from /usr/bin/libcruft.dll
#13 0x70e4a972 in octave_restore_signal_mask () from /usr/bin/libcruft.dll
#14 0x61010253 in per_module::run_ctors () from /usr/bin/cygwin1.dll
#15 0x00000001 in ?? ()
#16 0x610102a0 in dll::init () from /usr/bin/cygwin1.dll
#17 0x70ea0008 in ?? ()
#18 0x00000000 in ?? () from 

Please fix. I love and need octave, gcc, cygwin, and gdb!


Juhani Saastamoinen



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.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]