[arch-commits] Commit in libffado/trunk (PKGBUILD fix-segfault-on-close.patch)

Jan Steffens heftig at archlinux.org
Sun Apr 29 23:11:34 EDT 2012


    Date: Sunday, April 29, 2012 @ 23:11:34
  Author: heftig
Revision: 157812

Fix segfault on close

Added:
  libffado/trunk/fix-segfault-on-close.patch
Modified:
  libffado/trunk/PKGBUILD

-----------------------------+
 PKGBUILD                    |   11 +++----
 fix-segfault-on-close.patch |   64 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 70 insertions(+), 5 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2012-04-30 00:41:55 UTC (rev 157811)
+++ PKGBUILD	2012-04-30 03:11:34 UTC (rev 157812)
@@ -5,7 +5,7 @@
 
 pkgname=libffado
 pkgver=2.0.1
-pkgrel=6
+pkgrel=7
 pkgdesc="Driver for FireWire audio devices"
 arch=('i686' 'x86_64')
 url="http://www.ffado.org/"
@@ -17,16 +17,17 @@
             'python2-pyqt: mixer applet')
 provides=('ffado')
 source=("http://www.ffado.org/files/$pkgname-$pkgver.tar.gz"
-	"libffado-gcc47.patch"
-        '60-ffado.rules')
+        "libffado-gcc47.patch" "fix-segfault-on-close.patch" '60-ffado.rules')
 md5sums=('786f31facd417e6207e429f50af0e15e'
          '287bb3f506e31626c4b8f91f0e1d9407'
+         'ac9763cb2dc2f3eb4e1894e30645c6f1'
          'f03a3e950801c4405b8934084651bca8')
 
 build() {
   cd "$srcdir/$pkgname-$pkgver"
 
   patch -p1 -i "$srcdir"/libffado-gcc47.patch
+  patch -p3 -i "$srcdir"/fix-segfault-on-close.patch
 
   # hack to use CFLAGS without optimising
   sed -i 's/-O2//g' SConstruct
@@ -42,7 +43,7 @@
   sed -i 's:python support/tools:python2 support/tools:' \
     support/tools/SConscript
 
-  scons PREFIX=/usr #ENABLE_OPTIMIZATIONS=True
+  scons PREFIX=/usr
 }
 
 package() {
@@ -65,7 +66,7 @@
     "$pkgdir/usr/share/applications/ffadomixer.desktop"
 
   install -Dm644 support/xdg/hi64-apps-ffado.png \
-	      "$pkgdir/usr/share/pixmaps/$pkgname.png"
+    "$pkgdir/usr/share/pixmaps/$pkgname.png"
 }
 
 # vim:set ts=2 sw=2 et:

Added: fix-segfault-on-close.patch
===================================================================
--- fix-segfault-on-close.patch	                        (rev 0)
+++ fix-segfault-on-close.patch	2012-04-30 03:11:34 UTC (rev 157812)
@@ -0,0 +1,64 @@
+Index: /trunk/libffado/src/debugmodule/debugmodule.h
+===================================================================
+--- /trunk/libffado/src/debugmodule/debugmodule.h (revision 1763)
++++ /trunk/libffado/src/debugmodule/debugmodule.h (revision 1999)
+@@ -283,6 +283,10 @@
+ void hexDumpQuadlets( quadlet_t *data_start, unsigned int length );
+ 
++class DebugModuleManager;
++
+ class DebugModule {
+ public:
++    friend class DebugModuleManager;
++
+     enum {
+         eDL_Message      = DEBUG_LEVEL_MESSAGE,
+@@ -333,4 +337,5 @@
+     std::string   m_name;
+     debug_level_t m_level;
++    DebugModuleManager* m_manager;
+ };
+ 
+Index: /trunk/libffado/src/debugmodule/debugmodule.cpp
+===================================================================
+--- /trunk/libffado/src/debugmodule/debugmodule.cpp (revision 1763)
++++ /trunk/libffado/src/debugmodule/debugmodule.cpp (revision 1999)
+@@ -84,5 +84,6 @@
+ //              << endl;
+ //     }
+-    if ( !DebugModuleManager::instance()->unregisterModule( *this ) ) {
++
++    if (m_manager && !m_manager->unregisterModule( *this ) ) {
+         cerr << "Could not unregister DebugModule at DebugModuleManager"
+              << endl;
+@@ -263,12 +264,9 @@
+ DebugModuleManager::~DebugModuleManager()
+ {
+-    // cleanin up leftover modules
+-    for ( DebugModuleVectorIterator it = m_debugModules.begin();
+-          it != m_debugModules.end();
+-          ++it )
++    // cleaning up leftover modules
++    while (!m_debugModules.empty())
+     {
+-        fprintf(stderr,"Cleaning up leftover debug module: %s\n",(*it)->getName().c_str());
+-        m_debugModules.erase( it );
+-        delete *it;
++        DebugModule *mod = m_debugModules.back();
++        unregisterModule(*mod);
+     }
+ 
+@@ -455,4 +453,6 @@
+     } else {
+         m_debugModules.push_back( &debugModule );
++        if (debugModule.m_manager == NULL)
++                debugModule.m_manager = this;
+     }
+     return true;
+@@ -469,4 +469,6 @@
+         if ( *it == &debugModule ) {
+             m_debugModules.erase( it );
++            if (debugModule.m_manager == this)
++                debugModule.m_manager = NULL;
+             return true;
+         }



More information about the arch-commits mailing list