octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: More on OSX build problems


From: mlewis1973
Subject: Re: More on OSX build problems
Date: Fri, 6 Jan 2012 09:01:50 -0800 (PST)

Platform: Mac OSX Lion 10.7.1
MacPorts 2.0.3
octave port -> octave 3.2.4

When I compile the embedded.cc example in the Octave manual, I think I get
the same issue with malloc and free being called from different libraries:
{{{
rodimusprime:work mlewis$ mkoctfile -v --link-stand-alone embedded.cc -o
embedded
/opt/local/bin/g++-mp-4.4 -c -I/opt/local/include -I/opt/local/include -fPIC
-I/opt/local/include/octave-3.2.4 -I/opt/local/include/octave-3.2.4/octave
-I/opt/local/include -mieee-fp -I/opt/local/include/freetype2
-I/opt/local/include -pipe -O2 -m64 embedded.cc -o embedded.o
/opt/local/bin/g++-mp-4.4 -I/opt/local/include -I/opt/local/include
-I/opt/local/include/octave-3.2.4 -I/opt/local/include/octave-3.2.4/octave
-I/opt/local/include -mieee-fp -I/opt/local/include/freetype2
-I/opt/local/include -pipe -O2 -m64 -fPIC -L/opt/local/lib -o embedded
embedded.o -L/opt/local/lib/octave-3.2.4 -L/opt/local/lib -loctinterp
-loctave -lcruft -llapack -lcblas -lf77blas -latlas -lfftw3 -lfftw3f
-lreadline -lreadline -lncurses -lhdf5 -lz -lm -L/opt/local/lib
-L/opt/local/lib/gcc44/gcc/x86_64-apple-darwin11/4.4.6
-L/opt/local/lib/gcc44/gcc/x86_64-apple-darwin11/4.4.6/../../.. -lhdf5 -lz
-lm -lgfortranbegin -lgfortran
rodimusprime:work mlewis$ ./embedded
GCD of [10, 15] is 5
embedded(85428) malloc: *** error for object 0x7fa0a9090a90: pointer being
freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6
}}}

is this something that has to be fixed when Octave is built, or is it
something I can fix when I compile my embedded octave app?

here is the gdb output.
{{{
rodimusprime:work mlewis$ gdb
GNU gdb 6.3.50-20050815 (Apple version gdb-1708) (Thu Nov  3 21:59:02 UTC
2011)
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 "x86_64-apple-darwin".
(gdb) file embedded
Reading symbols for shared libraries ...............warning: Could not find
object file
"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc44/gcc44/work/build/x86_64-apple-darwin11/libgfortran/.libs/backtrace.o"
- no debug information available for
"../../../gcc-4.4.6/libgfortran/runtime/backtrace.c".

[...similar messages deleted...]

. done
Reading symbols from /Users/mlewis/work/embedded...done.
(gdb) break malloc_error_break
Function "malloc_error_break" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (malloc_error_break) pending.
(gdb) run
Starting program: /Users/mlewis/work/embedded 
Reading symbols for shared libraries +++++++++++++++++...warning: Could not
find object file
"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_bzip2/bzip2/work/bzip2-1.0.6/blocksort.o"
- no debug information available for "blocksort.c".

warning: Could not find object file
"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_bzip2/bzip2/work/bzip2-1.0.6/huffman.o"
- no debug information available for "huffman.c".

warning: Could not find object file
"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_bzip2/bzip2/work/bzip2-1.0.6/crctable.o"
- no debug information available for "crctable.c".

warning: Could not find object file
"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_bzip2/bzip2/work/bzip2-1.0.6/randtable.o"
- no debug information available for "randtable.c".

warning: Could not find object file
"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_bzip2/bzip2/work/bzip2-1.0.6/compress.o"
- no debug information available for "compress.c".

warning: Could not find object file
"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_bzip2/bzip2/work/bzip2-1.0.6/decompress.o"
- no debug information available for "decompress.c".

warning: Could not find object file
"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_bzip2/bzip2/work/bzip2-1.0.6/bzlib.o"
- no debug information available for "bzlib.c".

................................................................................................................
done
Breakpoint 1 at 0x7fff898ab6c0
Pending breakpoint 1 - "malloc_error_break" resolved
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
GCD of [10, 15] is 5
embedded(85455) malloc: *** error for object 0x1064916e0: pointer being
freed was not allocated
*** set a breakpoint in malloc_error_break to debug

Breakpoint 1, 0x00007fff898ab6c0 in malloc_error_break ()
(gdb) backtrace
#0  0x00007fff898ab6c0 in malloc_error_break ()
#1  0x00007fff898ab805 in free ()
#2  0x00000001031e2445 in std::string::assign ()
#3  0x000000010018114b in octave_read ()
#4  0x0000000100186c79 in yy_get_next_buffer ()
#5  0x0000000100192867 in octave_lex ()
#6  0x0000000100280c45 in octave_parse ()
#7  0x0000000100286491 in parse_fcn_file ()
#8  0x0000000100287647 in load_fcn_from_file ()
#9  0x00000001002cd3c6 in
symbol_table::fcn_info::fcn_info_rep::find_user_function ()
#10 0x00000001002d0582 in symbol_table::fcn_info::fcn_info_rep::xfind ()
#11 0x00000001002d07e4 in symbol_table::fcn_info::fcn_info_rep::find ()
#12 0x00000001002cecbe in symbol_table::do_find ()
#13 0x00000001002cf512 in symbol_table::find ()
#14 0x00000001002cfac2 in symbol_table::find_function ()
#15 0x000000010027da4e in feval ()
#16 0x00000001002d9b42 in do_octave_atexit ()
#17 0x00007fff8984c7d0 in __cxa_finalize ()
#18 0x00007fff8984c652 in exit ()
#19 0x0000000100000d1b in start ()
}}}


Jarno Rajahalme wrote
> 
> The malloc problem you see is likely due to your linked binary containing
> two versions of the libstdc++, and in some cases one of them being used to
> malloc and the other to free. This happens when you use non-Apple GCC/G++
> to compile Octave. To get around this problem you need to add your
> compiler's version of the libstdc++ as the first argument in the LDFLAGS.
> This is mentioned in the etc/README.MacOS as follows (see below), but the
> text may be a bit misleading, as the system's version of libstdc++ gets
> pulled in in any case, as some of the system libraries depend on it, and
> there is no way to compile those libraries again with another compiler.
> 
> Excerpt from etc/README.MacOS:
> 
>   * The same compiler must be used to build all all of Octave's sources. 
> This
>     is necessary to avoid conflicts between the compiler libraries such as
>     libstdc++.  For a successful build the first file in LDFLAGS must
> refer to
>     this library.  For example, if building with gcc-4.5 obtained from
> MacPorts
>     LDFLAGS would begin as,
> 
>       export LDFLAGS="/opt/local/lib/gcc45/libstdc++.6.dylib [...]"
> 
> Hope this helps,
> 
>   Jarno
> 
> On Oct 4, 2011, at 11:23 , ext Dr. Alexander Klein wrote:
> 
>> Good morning,
>> 
>> I spent the better part of the weekend tracking the build problems I
>> experience on OSX. I upgraded one of my machines to Snow Leopard,
>> compiled and installed everything in /usr/local/ manually, and then
>> started plodding downwards through Octave's revision tree.
>> 
>> After dozens of builds I can sum up my results as follows:
>> 
>> Each revision tagged as "stable" builds, but crashes during make check
>> for as far as I could go back in the revision history without things
>> breaking due to other problems, which begins shortly after the 3.2.4
>> release and ends around revision 128xy.
>> 
>> Here's the result from revision 13254, for example:
>> 
>> make -C test check
>> ./build_sparse_tests.sh
>> ./build_bc_overload_tests.sh ./bc_overloads_expected
>> ../run-octave --norc --silent --no-history ./fntests.m .
>> octave(9664) malloc: *** error for object 0x102ecc5c0: pointer being
>> freed was not allocated
>> *** set a breakpoint in malloc_error_break to debug
>> panic: Abort trap -- stopping myself...
>> octave(9664) malloc: *** error for object 0x102ecc5c0: pointer being
>> freed was not allocated
>> *** set a breakpoint in malloc_error_break to debug
>> panic: attempted clean up apparently failed -- aborting...
>> make[1]: *** [check] Abort trap
>> make: *** [check] Error 2
>> 
>> Then again, none of the revisions that are not tagged "stable" showed
>> this behaviour. Revision 13268 builds ok with a few failed tests during
>> make check.
>> 
>> The one thing I don't get however: If the two revision trees are merged
>> every once in a while as the commit messages suggest, then why aren't
>> behaviours merged, too? I'd expect that after such a point either both
>> would work or both would crash, but this simply isn't the case. What
>> could be the reason for such strange differences in behaviour? Am I
>> missing something?
>> 
>> I'm really at my wits' end ...
>> 
>>      Alex
>> 
>> -- 
>>          Dr. Alexander Klein, Diplom-Mathematiker
>> 
>> Physiologisches Institut       |               TransMIT Zentrum
>> Raum 543                       |        für Numerische Methoden
>> Aulweg 129                     |          Heinrich-Buff-Ring 44
>> 35392 Giessen                  |                  35392 Giessen
>>
> 


--
View this message in context: 
http://octave.1599824.n4.nabble.com/More-on-OSX-build-problems-tp3870258p4270065.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]