Bug 183474

Summary: cad/meshlab: saving project crashes program
Product: Ports & Packages Reporter: smars
Component: Individual Port(s)Assignee: Pietro Cerutti <gahr>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description smars 2013-10-30 11:10:00 UTC
Projects cannot be saved. See also "ports/183463: cad/meshlab: cannot import .ply or .obj meshes" If data cannot be imported and results cannot be saved... it becomes difficult to use the program.

How-To-Repeat: 1> Open meshlab
2> Load some mesh: .xyz data for instance
3> File -> Save Project
type a file name, then either:
- press on cancel (with *.mlp or *.aln file type)
- press on save (with *.mlp or *.aln file type)
4> The program crashes and the data is not saved

If no mesh is loaded, the problem is the same
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-10-30 11:10:08 UTC
Responsible Changed
From-To: freebsd-ports-bugs->gahr

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter service freebsd_committer freebsd_triage 2013-10-31 17:19:45 UTC
Author: gahr
Date: Thu Oct 31 17:19:27 2013
New Revision: 332268
URL: http://svnweb.freebsd.org/changeset/ports/332268

Log:
  - Fix run-time segmentation fault [1]
  - Convert to new LIB_DEPENDS format
  - Fix build with clang (no longer depends on GCC)
  - Statically link against own library libcommon.a, to avoid
    installing a library with such a generic name as libcommon.so
  
  PR:		183474 [1]
  Submitted by:	Pierre Smars <smars@yuntech.edu.tw> [1]

Added:
  head/cad/meshlab/files/patch-meshlab_mainwindow_RunTime.cpp   (contents, props changed)
  head/cad/meshlab/files/patch-meshlabplugins-edit_arc3D-fillImage.cpp   (contents, props changed)
  head/cad/meshlab/files/patch-meshlabplugins-filter_poisson-src_Geometry.inl   (contents, props changed)
  head/cad/meshlab/files/patch-shared.pri   (contents, props changed)
  head/cad/meshlab/files/patch-vcglib-vcg-complex-algorithms_subset.h   (contents, props changed)
  head/cad/meshlab/files/patch-vcglib-vcg-math_base.h   (contents, props changed)
  head/cad/meshlab/files/patch-vcglib-vcg-space_deprecated_point.h   (contents, props changed)
  head/cad/meshlab/files/patch-vcglib-wrap-ply_plystuff.h   (contents, props changed)
Modified:
  head/cad/meshlab/Makefile
  head/cad/meshlab/files/patch-common_common.pro
  head/cad/meshlab/files/patch-meshlab_meshlab.pro
  head/cad/meshlab/files/patch-meshlabserver_meshlabserver.pro
  head/cad/meshlab/pkg-plist

Modified: head/cad/meshlab/Makefile
==============================================================================
--- head/cad/meshlab/Makefile	Thu Oct 31 17:12:58 2013	(r332267)
+++ head/cad/meshlab/Makefile	Thu Oct 31 17:19:27 2013	(r332268)
@@ -3,7 +3,7 @@
 
 PORTNAME=	meshlab
 DISTVERSION=	1.3.2
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	cad
 MASTER_SITES=	${MASTER_SITE_LOCAL}/gahr/ \
 		http://people.freebsd.org/~gahr/distfiles/
@@ -12,23 +12,29 @@ MAINTAINER=	gahr@FreeBSD.org
 COMMENT=	3D triangular meshes processing and editing tool
 
 EXTRACT_DEPENDS=7z:${PORTSDIR}/archivers/p7zip
-LIB_DEPENDS=	QtSolutions_SOAP-head:${PORTSDIR}/devel/qt4-qtsolutions-soap
+LIB_DEPENDS=	libQtSolutions_SOAP-head.so:${PORTSDIR}/devel/qt4-qtsolutions-soap
 
-USE_GCC=	yes
 USE_GL=		glew glu
 USE_QT4=	qmake_build moc_build rcc_build uic_build corelib gui xml \
 		xmlpatterns opengl network script
-USE_DOS2UNIX=	external/structuresynth/ssynth/SyntopiaCore/GLEngine/Object3D.h
-
-USE_LDCONFIG=	yes
+USE_DOS2UNIX=	external/structuresynth/ssynth/SyntopiaCore/GLEngine/Object3D.h \
+		meshlabplugins/edit_arc3D/fillImage.cpp
 
 WRKSRC=		${WRKDIR}/${DISTNAME}/${PORTNAME}/src
 
-NO_STAGE=	yes
 post-patch:
+	${MV} "${WRKSRC}/distrib/shaders/electronic microscope.gdp" \
+	    ${WRKSRC}/distrib/shaders/electronic_microscope.gdp
+	${MV} "${WRKSRC}/distrib/shaders/shadersrm/old/Depth of Field.rfx" \
+	    ${WRKSRC}/distrib/shaders/shadersrm/old/Depth_of_Field.rfx
 	${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|' \
 	   ${WRKSRC}/common/pluginmanager.cpp
 
+.if defined(MAINTAINER_MODE)
+	${FIND} ${WRKSRC}/../../ -name "*.pro" | ${XARGS} \
+	    ${REINPLACE_CMD} -e '/^CONFIG +=/s|$$| debug|'
+.endif
+
 do-configure:
 	cd ${WRKSRC}/external && ${QMAKE} -spec ${QMAKESPEC} -recursive external.pro
 	cd ${WRKSRC} && ${QMAKE} -spec ${QMAKESPEC} -recursive meshlab_full.pro
@@ -38,15 +44,11 @@ do-build:
 	cd ${WRKSRC} && ${MAKE}
 
 do-install:
-	${INSTALL_DATA} ${WRKSRC}/common/libcommon.so.1.0.0 ${PREFIX}/lib
-	${LN} -sf ${PREFIX}/lib/libcommon.so.1.0.0 ${PREFIX}/lib/libcommon.so.1.0
-	${LN} -sf ${PREFIX}/lib/libcommon.so.1.0 ${PREFIX}/lib/libcommon.so.1
-	${LN} -sf ${PREFIX}/lib/libcommon.so.1 ${PREFIX}/lib/libcommon.so
-	${MKDIR} ${PREFIX}/lib/meshlab/plugins
-	cd ${WRKSRC}/distrib/plugins && ${COPYTREE_SHARE} \*.so ${PREFIX}/lib/meshlab/plugins
-	${MKDIR} ${PREFIX}/lib/meshlab/shaders
-	cd ${WRKSRC}/distrib/shaders && ${COPYTREE_SHARE} \* ${PREFIX}/lib/meshlab/shaders
-	${INSTALL_PROGRAM} ${WRKSRC}/distrib/meshlab ${PREFIX}/lib/meshlab
-	${LN} -sf ${PREFIX}/lib/meshlab/meshlab ${PREFIX}/bin
+	${MKDIR} ${STAGEDIR}${PREFIX}/lib/meshlab/plugins
+	cd ${WRKSRC}/distrib/plugins && ${COPYTREE_SHARE} \*.so ${STAGEDIR}${PREFIX}/lib/meshlab/plugins
+	${MKDIR} ${STAGEDIR}${PREFIX}/lib/meshlab/shaders
+	cd ${WRKSRC}/distrib/shaders && ${COPYTREE_SHARE} \* ${STAGEDIR}${PREFIX}/lib/meshlab/shaders
+	${INSTALL_PROGRAM} ${WRKSRC}/distrib/meshlab ${STAGEDIR}${PREFIX}/lib/meshlab
+	${LN} -sf ${PREFIX}/lib/meshlab/meshlab ${STAGEDIR}${PREFIX}/bin
 
 .include <bsd.port.mk>

Modified: head/cad/meshlab/files/patch-common_common.pro
==============================================================================
--- head/cad/meshlab/files/patch-common_common.pro	Thu Oct 31 17:12:58 2013	(r332267)
+++ head/cad/meshlab/files/patch-common_common.pro	Thu Oct 31 17:19:27 2013	(r332268)
@@ -1,19 +1,8 @@
---- common/common.pro.orig	2013-05-07 10:06:45.000000000 +0200
-+++ common/common.pro	2013-05-07 10:09:47.000000000 +0200
-@@ -62,6 +62,9 @@
- linux-g++-64:CONFIG += dll
- linux-g++-64:DESTDIR = ../distrib
- 
-+freebsd:CONFIG += dll
-+freebsd:DESTDIR = ../distrib
-+
- win32-msvc2005:CONFIG += staticlib
- win32-msvc2008:CONFIG += staticlib
- win32-msvc2010:CONFIG += staticlib
-@@ -124,5 +127,6 @@
- linux-g++:LIBS		+= -L../external/lib/linux-g++ -ljhead
- linux-g++-32:LIBS		+= -L../external/lib/linux-g++-32 -ljhead
+--- common/common.pro.orig	2013-10-31 13:57:32.000000000 +0100
++++ common/common.pro	2013-10-31 14:00:10.000000000 +0100
+@@ -126,3 +126,5 @@
  linux-g++-64:LIBS		+= -L../external/lib/linux-g++-64 -ljhead
-+freebsd:LIBS		+= -L../external/lib/freebsd -ljhead
  	
  #RESOURCES = common.qrc
++
++CONFIG +=    static

Added: head/cad/meshlab/files/patch-meshlab_mainwindow_RunTime.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cad/meshlab/files/patch-meshlab_mainwindow_RunTime.cpp	Thu Oct 31 17:19:27 2013	(r332268)
@@ -0,0 +1,13 @@
+--- meshlab/mainwindow_RunTime.cpp.orig	2013-10-31 16:02:53.000000000 +0100
++++ meshlab/mainwindow_RunTime.cpp	2013-10-31 16:04:13.000000000 +0100
+@@ -1575,7 +1575,9 @@
+ 
+   /*********WARNING!!!!!! CHANGE IT!!! ALSO IN THE OPENPROJECT FUNCTION********/
+   meshDoc()->setDocLabel(fileName);
+-  mdiarea->activeSubWindow()->setWindowTitle(meshDoc()->docLabel());
++  if (mdiarea->activeSubWindow()) {
++      mdiarea->activeSubWindow()->setWindowTitle(meshDoc()->docLabel());
++  }
+   layerDialog->setWindowTitle(meshDoc()->docLabel());
+   /****************************************************************************/
+ 

Modified: head/cad/meshlab/files/patch-meshlab_meshlab.pro
==============================================================================
--- head/cad/meshlab/files/patch-meshlab_meshlab.pro	Thu Oct 31 17:12:58 2013	(r332267)
+++ head/cad/meshlab/files/patch-meshlab_meshlab.pro	Thu Oct 31 17:19:27 2013	(r332268)
@@ -4,7 +4,7 @@
  linux-g++-64:LIBS += -L../external/lib/linux-g++-64 -L../distrib -lcommon -lGLU
  linux-g++-64:QMAKE_RPATHDIR += ../distrib
  
-+LIBS += -L../external/jhead-2.95 -L../common -lcommon -lGLU -ljhead
++LIBS += -L../external/jhead-2.95 ../common/libcommon.a -lGLU -ljhead
 +QMAKE_RPATHDIR += ../distrib
 +
  # uncomment in your local copy only in emergency cases.

Added: head/cad/meshlab/files/patch-meshlabplugins-edit_arc3D-fillImage.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cad/meshlab/files/patch-meshlabplugins-edit_arc3D-fillImage.cpp	Thu Oct 31 17:19:27 2013	(r332268)
@@ -0,0 +1,10 @@
+--- meshlabplugins/edit_arc3D/fillImage.cpp.orig	2013-10-31 10:47:05.000000000 +0100
++++ meshlabplugins/edit_arc3D/fillImage.cpp	2013-10-31 10:52:27.000000000 +0100
+@@ -22,6 +22,7 @@
+ ****************************************************************************/
+ 
+ #include "fillImage.h"
++#include <cstdlib>
+ #include <cmath>
+ #include <limits>
+ 

Added: head/cad/meshlab/files/patch-meshlabplugins-filter_poisson-src_Geometry.inl
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cad/meshlab/files/patch-meshlabplugins-filter_poisson-src_Geometry.inl	Thu Oct 31 17:19:27 2013	(r332268)
@@ -0,0 +1,11 @@
+--- meshlabplugins/filter_poisson/src/Geometry.inl.orig	2013-10-31 09:51:50.000000000 +0100
++++ meshlabplugins/filter_poisson/src/Geometry.inl	2013-10-31 09:52:01.000000000 +0100
+@@ -26,6 +26,8 @@
+ DAMAGE.
+ */
+ 
++#include <stdlib.h>
++
+ template<class Real>
+ Real Random(void){return Real(rand())/RAND_MAX;}
+ 

Modified: head/cad/meshlab/files/patch-meshlabserver_meshlabserver.pro
==============================================================================
--- head/cad/meshlab/files/patch-meshlabserver_meshlabserver.pro	Thu Oct 31 17:12:58 2013	(r332267)
+++ head/cad/meshlab/files/patch-meshlabserver_meshlabserver.pro	Thu Oct 31 17:19:27 2013	(r332268)
@@ -4,7 +4,7 @@
  linux-g++-32:QMAKE_RPATHDIR += ../distrib
  linux-g++-64:  LIBS += -L../distrib -lcommon
  linux-g++-64:QMAKE_RPATHDIR += ../distrib
-+LIBS += -L../common -lcommon -L../external/jhead-2.95 -ljhead
++LIBS += ../common/libcommon.a -L../external/jhead-2.95 -ljhead
 +QMAKE_RPATHDIR += ../distrib
  #CONFIG (release,debug | release) {
  #	win32-msvc2005:release:  LIBS += -L../common/release -lcommon

Added: head/cad/meshlab/files/patch-shared.pri
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cad/meshlab/files/patch-shared.pri	Thu Oct 31 17:19:27 2013	(r332268)
@@ -0,0 +1,8 @@
+--- shared.pri.orig	2012-07-31 07:43:04.000000000 +0200
++++ shared.pri	2013-10-31 12:18:49.000000000 +0100
+@@ -72,3 +72,5 @@
+ 	win32-msvc2005: RCC_DIR = $(ConfigurationName)
+ 	win32-msvc2008: RCC_DIR = $(ConfigurationName)
+ 	win32-msvc2010: RCC_DIR = $(ConfigurationName)
++
++LIBS+=../../common/libcommon.a

Added: head/cad/meshlab/files/patch-vcglib-vcg-complex-algorithms_subset.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cad/meshlab/files/patch-vcglib-vcg-complex-algorithms_subset.h	Thu Oct 31 17:19:27 2013	(r332268)
@@ -0,0 +1,17 @@
+--- ../../vcglib/vcg/complex/algorithms/subset.h.orig	2013-10-31 09:34:59.000000000 +0100
++++ ../../vcglib/vcg/complex/algorithms/subset.h	2013-10-31 09:35:06.000000000 +0100
+@@ -86,12 +86,12 @@
+     return (v<o.v);
+   }
+   
+-  bool operator ==(const InsertedV & o)
++  bool operator ==(const InsertedV & o) const
+   {
+     return (v==o.v);
+   }
+   
+-  bool operator !=(const InsertedV & o)
++  bool operator !=(const InsertedV & o) const
+   {
+     return (v!=o.v);
+   }

Added: head/cad/meshlab/files/patch-vcglib-vcg-math_base.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cad/meshlab/files/patch-vcglib-vcg-math_base.h	Thu Oct 31 17:19:27 2013	(r332268)
@@ -0,0 +1,12 @@
+--- ../../vcglib/vcg/math/base.h.orig	2012-04-05 11:04:15.000000000 +0200
++++ ../../vcglib/vcg/math/base.h	2013-10-31 11:09:34.000000000 +0100
+@@ -94,7 +94,9 @@
+ /// static_assert: implemented as a macro for "assert", but it is separated for clarity.
+ /// Should be used for checking integrity constraints that can be tested at complile time,
+ /// as the ones involving templated constants in templated classes.
++#ifndef static_assert
+ #define static_assert assert
++#endif
+ 
+   #ifdef __BORLANDC__
+     float sqrtf (float v) {return sqrt(v);}

Added: head/cad/meshlab/files/patch-vcglib-vcg-space_deprecated_point.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cad/meshlab/files/patch-vcglib-vcg-space_deprecated_point.h	Thu Oct 31 17:19:27 2013	(r332268)
@@ -0,0 +1,19 @@
+--- ../../vcglib/vcg/space/deprecated_point.h.orig	2013-10-30 18:12:59.000000000 +0100
++++ ../../vcglib/vcg/space/deprecated_point.h	2013-10-30 18:12:33.000000000 +0100
+@@ -164,14 +164,14 @@
+ 	}
+   inline const S &X() const { return _v[0]; }
+ 	inline const S &Y() const { return _v[1]; }
+-	inline const S &Z() const { static_assert(N>2); return _v[2]; }
++	inline const S &Z() const { static_assert(N>2, ""); return _v[2]; }
+ 	 /// W is in any case the last coordinate.
+ 	 /// (in a 2D point, W() == Y(). In a 3D point, W()==Z()
+ 	 ///  in a 4D point, W() is a separate component)
+ 	inline const S &W() const { return _v[N-1]; }
+ 	inline S &X() { return _v[0]; }
+ 	inline S &Y() { return _v[1]; }
+-	inline S &Z() { static_assert(N>2); return _v[2]; }
++	inline S &Z() { static_assert(N>2, ""); return _v[2]; }
+ 	inline S &W() { return _v[N-1]; }
+ 	inline const S * V() const
+ 	{

Added: head/cad/meshlab/files/patch-vcglib-wrap-ply_plystuff.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cad/meshlab/files/patch-vcglib-wrap-ply_plystuff.h	Thu Oct 31 17:19:27 2013	(r332268)
@@ -0,0 +1,10 @@
+--- ../../vcglib/wrap/ply/plystuff.h.orig	2013-10-31 09:44:03.000000000 +0100
++++ ../../vcglib/wrap/ply/plystuff.h	2013-10-31 09:50:52.000000000 +0100
+@@ -75,6 +75,7 @@
+ #define pb_close  _close
+ #define DIR_SEP "\\"
+ #else
++#include <unistd.h>
+ #define pb_mkdir(n)  mkdir(n,0755)
+ #define pb_access access
+ #define pb_stat   stat

Modified: head/cad/meshlab/pkg-plist
==============================================================================
--- head/cad/meshlab/pkg-plist	Thu Oct 31 17:12:58 2013	(r332267)
+++ head/cad/meshlab/pkg-plist	Thu Oct 31 17:19:27 2013	(r332268)
@@ -1,8 +1,4 @@
 bin/meshlab
-lib/libcommon.so.1.0.0
-lib/libcommon.so.1.0
-lib/libcommon.so.1
-lib/libcommon.so
 lib/meshlab/meshlab
 lib/meshlab/plugins/libdecorate_background.so
 lib/meshlab/plugins/libdecorate_base.so
@@ -116,7 +112,7 @@ lib/meshlab/shaders/depthmap.vert
 lib/meshlab/shaders/dimple.frag
 lib/meshlab/shaders/dimple.gdp
 lib/meshlab/shaders/dimple.vert
-lib/meshlab/shaders/electronic microscope.gdp
+lib/meshlab/shaders/electronic_microscope.gdp
 lib/meshlab/shaders/envmap.frag
 lib/meshlab/shaders/envmap.gdp
 lib/meshlab/shaders/envmap.vert
@@ -149,7 +145,7 @@ lib/meshlab/shaders/shadersrm/PhongUntex
 lib/meshlab/shaders/shadersrm/QualityContour.rfx
 lib/meshlab/shaders/shadersrm/ZBrush.rfx
 lib/meshlab/shaders/shadersrm/cartoon.rfx
-lib/meshlab/shaders/shadersrm/old/Depth of Field.rfx
+lib/meshlab/shaders/shadersrm/old/Depth_of_Field.rfx
 lib/meshlab/shaders/shadersrm/old/GlyphBomb.rfx
 lib/meshlab/shaders/shadersrm/old/ImageBasedLighting.rfx
 lib/meshlab/shaders/shadersrm/old/Plastic.rfx
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 3 Pietro Cerutti freebsd_committer freebsd_triage 2013-10-31 17:20:23 UTC
State Changed
From-To: open->closed

Fixed in r332268. Thanks!