[MacPorts] #37678: MacPorts gcc gives malloc error on correct program, Apple's gcc doesn't

MacPorts noreply at macports.org
Thu Jan 17 10:26:34 PST 2013


#37678: MacPorts gcc gives malloc error on correct program, Apple's gcc doesn't
------------------------+--------------------------------
 Reporter:  yusuhail@…  |      Owner:  macports-tickets@…
     Type:  defect      |     Status:  new
 Priority:  High        |  Milestone:
Component:  ports       |    Version:  2.1.2
 Keywords:              |       Port:  gcc46
------------------------+--------------------------------
 Consider the following program that uses the Boost port version 1.52:

 {{{
 #include <boost/program_options.hpp>
 #include <iostream>
 using namespace std;

 int main(int ac, char* av[])
 {
         boost::program_options::options_description desc("Allowed
 options");
         desc.add_options()  ("help", "this is a help message")  ;
         cout << desc << endl;
 }
 }}}

 If I use the mp gcc:

 {{{
 $ sudo port select gcc mp-gcc46
 Selecting 'mp-gcc46' for 'gcc' succeeded. 'mp-gcc46' is now active.
 $ g++ -L/opt/local/lib -I/opt/local/include -lboost_program_options-mt
 b.cpp
 $ ./a.out
 Allowed options:
 a.out(45587) malloc: *** error for object 0x7fff70ca3500: pointer being
 freed was not allocated
 *** set a breakpoint in malloc_error_break to debug
 Abort trap
 }}}

 However, if I use Apple's gcc I get

 {{{
 $ sudo port select gcc gcc42
 Selecting 'gcc42' for 'gcc' succeeded. 'gcc42' is now active.
 $ g++ -L/opt/local/lib -I/opt/local/include -lboost_program_options-mt
 b.cpp
 $ ./a.out
 Allowed options:
   --help                this is a help message

 }}}

-- 
Ticket URL: <https://trac.macports.org/ticket/37678>
MacPorts <http://www.macports.org/>
Ports system for Mac OS


More information about the macports-tickets mailing list