View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0002498 | ardour | bugs | public | 2008-12-19 23:42 | 2020-04-19 20:13 |
| Reporter | cth103 | Assigned To | paul | ||
| Priority | normal | Severity | crash | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Summary | 0002498: segfault on removing track | ||||
| Description | With 3.0, ardour segfaults when removing a track. The problem is that removing a track deletes its Ports, but Ports don't notify other Ports when they're being deleted, so there are dangling pointers to deleted ports. This causes a crash in the process callback. I've attached a speculative patch which fixes this, but I think Paul should check it... | ||||
| Tags | No tags attached. | ||||
|
2008-12-19 23:42
|
track-rm.patch (1,624 bytes)
diff -urN -x .svn -x .hgignore -x .hg carlh/3.0/libs/ardour/ardour/port.h track-rm/libs/ardour/ardour/port.h
--- carlh/3.0/libs/ardour/ardour/port.h 2008-12-08 19:20:22.000000000 +0000
+++ track-rm/libs/ardour/ardour/port.h 2008-12-19 23:39:14.000000000 +0000
@@ -26,6 +26,7 @@
#include <cstring>
#include <sigc++/signal.h>
#include <pbd/failed_constructor.h>
+#include <pbd/destructible.h>
#include <ardour/ardour.h>
#include <ardour/data_type.h>
#include <jack/jack.h>
@@ -37,7 +38,7 @@
/** Abstract base for ports
*/
-class Port : public virtual sigc::trackable {
+class Port : public virtual PBD::Destructible {
public:
enum Flags {
IsInput = JackPortIsInput,
@@ -132,6 +133,10 @@
std::set<Port*> _connections;
static AudioEngine* engine;
+
+ private:
+
+ void port_going_away (Port *);
};
class PortConnectableByName {
diff -urN -x .svn -x .hgignore -x .hg carlh/3.0/libs/ardour/port.cc track-rm/libs/ardour/port.cc
--- carlh/3.0/libs/ardour/port.cc 2008-12-08 19:20:23.000000000 +0000
+++ track-rm/libs/ardour/port.cc 2008-12-19 23:39:15.000000000 +0000
@@ -34,6 +34,7 @@
Port::~Port ()
{
+ drop_references ();
disconnect_all ();
}
@@ -59,6 +60,7 @@
result = _connections.insert (&other);
if (result.second) {
+ other.GoingAway.connect (sigc::bind (mem_fun (*this, &Port::port_going_away), &other));
return 0;
} else {
return 1;
@@ -131,6 +133,14 @@
return i;
}
+void
+Port::port_going_away (Port* p)
+{
+ /* XXX: locking? */
+
+ disconnect (*p);
+}
+
//-------------------------------------
@@ -377,3 +387,4 @@
_ext_port->reset ();
}
}
+
|
|
|
Port system reworked, no longer an issue. |
|
|
Issue has been closed automatically, by Trigger Close Plugin. Feel free to re-open with additional information if you think the issue is not resolved. |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2008-12-19 23:42 | cth103 | New Issue | |
| 2008-12-19 23:42 | cth103 | File Added: track-rm.patch | |
| 2008-12-19 23:42 | cth103 | cost | => 0.00 |
| 2008-12-19 23:43 | cth103 | Status | new => assigned |
| 2008-12-19 23:43 | cth103 | Assigned To | => paul |
| 2009-02-19 19:58 | drobilla | Status | assigned => resolved |
| 2009-02-19 19:58 | drobilla | Resolution | open => fixed |
| 2009-02-19 19:58 | drobilla | Note Added: 0005741 | |
| 2020-04-19 20:13 | system | Note Added: 0021845 | |
| 2020-04-19 20:13 | system | Status | resolved => closed |