Opened 11 years ago

Closed 11 years ago

#41238 closed defect (fixed)

Octave parcellfun panics

Reported by: trolin421 Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version: 2.2.1
Keywords: Cc:
Port: octave-devel

Description (last modified by mf2k (Frank Schima))

I updated MacPorts yesterday, and now the parcellfun function from the general package is unusable. Here's a simple test file:

function foo()
  parcellfun(2, @myfunc, {pi; e});
end
function myfunc(val)
end

When I run it, I get:

parcellfun: 0/2 jobs doneoctave(17310,0x7fff7c400180) malloc: *** error for object 0x108b93220: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
panic: Abort trap: 6 -- stopping myself...
attempting to save variables to 'octave-core'...
save to 'octave-core' complete
Abort trap: 6

I've found mention of this error going back some months on various forums, but I've found no clear explanation nor solution/workaround. It worked fine since I last updated MacPorts within the last week or two.

  octave-devel @3.6.4_9+atlas+docs+fltk+gcc47+x11 (active)

Change History (6)

comment:1 Changed 11 years ago by mf2k (Frank Schima)

Description: modified (diff)
Keywords: parcellfun malloc removed
Owner: changed from macports-tickets@… to michaelld@…

In the future, please use WikiFormatting and Cc the port maintainers (port info --maintainers octave-devel).

comment:2 Changed 11 years ago by michaelld (Michael Dickens)

Just a guess that octave-general needs to be reinstalled because of some change to octave:

sudo port uninstall octave-general
sudo port install octave-general

and see if that works.

comment:3 Changed 11 years ago by michaelld (Michael Dickens)

OK; I finally figured out how to load packages (pkg load general; I'm clearly a noob in some regards :). I get the same error. I'll push it upstream to some octave developers to see what they think.

comment:4 Changed 11 years ago by michaelld (Michael Dickens)

Oh; I think I know the issue. I changed octave-devel recently to decouple the c/c++ and fortran compilers. Building octave-devel requires linking using the fortran compiler, which uses that compiler's libstdc++ runtime, which is provided by libgcc. Packages are build using the c/c++ compiler, which will in general be different than the fortran compiler (suite), and use a different c++ runtime. In my case, I have clang as the c/c++ compiler, and gfortran-mp-4.8 as the fortran compiler (via +gcc48). Clang uses /usr/lib/libstdc++ in 10.8 and earlier, while gfortran-mp-4.8 uses /opt/local/lib/libgcc/libstdc++.6.dylib. You can't have both c++ runtimes at the same time. So, I need to fix mkoctfile to use the fortran compiler; or, something like that. YA reason MacPorts needs a single c++ runtime, as will be the case for 10.9 (or, I'm pretty sure that's the case). What fun!

You should be able to get around this by setting the variant and compiler to be the same, e.g.

sudo port install octave-devel +gcc47 configure.compiler=macports-gcc-4.7

You might still need to reinstall octave-general.

comment:5 Changed 11 years ago by trolin421

Setting the configure.compiler option fixed the problem. Thanks for your help.

comment:6 Changed 11 years ago by michaelld (Michael Dickens)

Resolution: fixed
Status: newclosed

Should be fixed with r114034.

Note: See TracTickets for help on using tickets.