I gave up on gdb.  I brought over the printf/cerr macros I favor.

Only residual question from last email: what is an efficient
way to upgrade egcs / glibc on linux (e.g. Redhat 6.2) ?

I found the cause of the immedate segfault (open, close, segfault).
The ~Player was calling StopTimer with a null m_cdTimer, and StopTimer
would dereference it and die.  A simple patch is attached.

Hmmm...freeamp is not leaving behind a core file....any ideas on that?

-- 
Chris Kuklewicz
Index: base/src/timer.cpp
===================================================================
RCS file: /src/repository/freeamp/base/src/timer.cpp,v
retrieving revision 1.13
diff -u -r1.13 timer.cpp
--- base/src/timer.cpp  2000/08/30 09:20:53     1.13
+++ base/src/timer.cpp  2000/09/10 21:36:38
@@ -29,7 +29,7 @@
 #endif
 
 #include "config.h"
-#include "timer.h"
+//#include "timer.h"
 
 #if defined(__linux__) || defined(solaris) || defined(__FreeBSD__)
 #include <unistd.h>
@@ -91,20 +91,25 @@
 
 void TimerManager::StopTimer(TimerRef timer)
 {
-    timer->ticks = 0;
-    timer->duration = 0;
+    // CEK : debugging linux segfault when run & close immediately
+    // CEK : in ~Profile it calls StopTimer(NULL)
+    if (NULL!=timer)
+    {
+        timer->ticks = 0;
+        timer->duration = 0;
 
-    vector<TimerRef>::iterator i = m_list.begin();
+        vector<TimerRef>::iterator i = m_list.begin();
 
-    for(; i != m_list.end(); i++)
-    {
-        if(*i == timer)
+        for(; i != m_list.end(); i++)
         {
-            m_mutex.Acquire();
-            m_list.erase(i);
-            delete timer;
-            m_mutex.Release();
-            break;
+            if(*i == timer)
+            {
+                m_mutex.Acquire();
+                m_list.erase(i);
+                delete timer;
+                m_mutex.Release();
+                break;
+            }
         }
     }
 }

Reply via email to