View Issue Details

IDCategoryLast Update
0006829bugs2016-12-20 18:10
ReporterventosusAssigned Topaul 
Reproducibilityalways 
Status assignedResolutionreopened 
PlatformanyOSanyOS Versionany
Product Version4.7 
Fixed in Version 
Summary0006829: Fix crash with lv2:Parameter of Variant:STRING
DescriptionArdour crashes if a plugin defines an lv2:Parameter of type atom:String in its *.ttl.
Steps To ReproduceDefine an lv2:Parameter of type atom:String in plugin's *.ttl and Ardour will crash when trying to build the general UI.

esp:sc_synth_name_0
  a lv2:Parameter ;
  rdfs:label "Synth Name 0" ;
  rdfs:range atom:String .

[...]

patch:writable
  esp:sc_synth_name_0 ;

[...]
Additional InformationPatch attached: Add checks to only handle supported variant types in 'build_control_ui'.
TagsNo tags attached.

Activities

ventosus

2016-03-19 19:23

reporter  

0001-Fix-crash-with-lv2-Parameter-of-Variant-STRING.patch (1,466 bytes)
From faea223b5c610bb7bf6f8a087e05e8f4c545e3b8 Mon Sep 17 00:00:00 2001
From: Hanspeter Portner <dev@open-music-kontrollers.ch>
Date: Sat, 19 Mar 2016 20:14:50 +0100
Subject: [PATCH] Fix crash with lv2:Parameter of Variant:STRING

Add checks for supported variant types in 'build_control_ui'.
---
 gtk2_ardour/generic_pluginui.cc | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/gtk2_ardour/generic_pluginui.cc b/gtk2_ardour/generic_pluginui.cc
index ef2de43..1990d38 100644
--- a/gtk2_ardour/generic_pluginui.cc
+++ b/gtk2_ardour/generic_pluginui.cc
@@ -685,6 +685,13 @@ GenericPluginUI::build_control_ui (const Evoral::Parameter&             param,
 			return control_ui;
 		}
 
+		if (desc.datatype != Variant::INT && desc.datatype != Variant::LONG &&
+				desc.datatype != Variant::FLOAT && desc.datatype != Variant::DOUBLE) {
+
+			/* unsupported variant */
+			return control_ui;
+		}
+
 		/* create the controller */
 
 		if (mcontrol) {
@@ -739,6 +746,14 @@ GenericPluginUI::build_control_ui (const Evoral::Parameter&             param,
 
 	} else if (!is_input) {
 
+		if (desc.datatype != Variant::INT && desc.datatype != Variant::LONG &&
+				desc.datatype != Variant::FLOAT && desc.datatype != Variant::DOUBLE &&
+				desc.datatype != Variant::BOOL) {
+
+			/* unsupported variant */
+			return control_ui;
+		}
+
 		control_ui->display = manage (new EventBox);
 		control_ui->display->set_name ("ParameterValueDisplay");
 
-- 
2.7.3

ventosus

2016-12-09 13:18

reporter   ~0019134

update: still crashing in 5.5

paul

2016-12-19 23:02

administrator   ~0019187

Any chance you could generate an updated version of this patch? I'd like (finally) apply it ...

ventosus

2016-12-20 08:31

reporter  

0001-Add-checks-for-supported-variant-types.patch (1,522 bytes)
From 325cee4121343b11e6f1c16dad2058d5ec26ee06 Mon Sep 17 00:00:00 2001
From: Hanspeter Portner <dev@open-music-kontrollers.ch>
Date: Tue, 20 Dec 2016 09:12:38 +0100
Subject: [PATCH] Add checks for supported variant types

Add checks for supported variant types in 'build_control_ui'.
---
 gtk2_ardour/generic_pluginui.cc | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/gtk2_ardour/generic_pluginui.cc b/gtk2_ardour/generic_pluginui.cc
index 066aa95fa..d5b3a5f89 100644
--- a/gtk2_ardour/generic_pluginui.cc
+++ b/gtk2_ardour/generic_pluginui.cc
@@ -702,6 +702,13 @@ GenericPluginUI::build_control_ui (const Evoral::Parameter&             param,
 			return control_ui;
 		}
 
+		if (desc.datatype != Variant::INT && desc.datatype != Variant::LONG &&
+				desc.datatype != Variant::FLOAT && desc.datatype != Variant::DOUBLE &&
+				desc.datatype != Variant::BOOL) {
+			/* unsupported variant type */
+			return control_ui;
+		}
+
 		assert(mcontrol);
 
 		/* See if there any named values for our input value */
@@ -864,6 +871,13 @@ GenericPluginUI::build_control_ui (const Evoral::Parameter&             param,
 
 	} else {
 
+		if (desc.datatype != Variant::INT && desc.datatype != Variant::LONG &&
+				desc.datatype != Variant::FLOAT && desc.datatype != Variant::DOUBLE &&
+				desc.datatype != Variant::BOOL) {
+			/* unsupported variant type */
+			return control_ui;
+		}
+
 		control_ui->display = manage (new EventBox);
 		control_ui->display->set_name ("ParameterValueDisplay");
 
-- 
2.11.0

ventosus

2016-12-20 08:39

reporter   ~0019193

Updated patch attached.

http://open-music-kontrollers.ch/lv2/espressivo#sc_out may be used as testing case.

[1] https://dl.open-music-kontrollers.ch/espressivo.lv2/unstable/

paul

2016-12-20 09:08

administrator   ~0019194

committed as 00ed7c81d32

thanks!

paul

2016-12-20 13:01

administrator   ~0019197

This patch breaks generic GUIs for plugins across more than just LV2. I have reverted it in master.

ventosus

2016-12-20 18:08

reporter  

0001-Add-checks-for-supported-variant-types-2nd-try.patch (1,605 bytes)
From 1bfab7b1fa2d692137f25d45aa0827636dc20743 Mon Sep 17 00:00:00 2001
From: Hanspeter Portner <dev@open-music-kontrollers.ch>
Date: Tue, 20 Dec 2016 09:12:38 +0100
Subject: [PATCH] Add checks for supported variant types, 2nd try

Add checks for supported variant types in 'build_control_ui'.
---
 gtk2_ardour/generic_pluginui.cc | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/gtk2_ardour/generic_pluginui.cc b/gtk2_ardour/generic_pluginui.cc
index 066aa95fa..611a3c81a 100644
--- a/gtk2_ardour/generic_pluginui.cc
+++ b/gtk2_ardour/generic_pluginui.cc
@@ -702,6 +702,13 @@ GenericPluginUI::build_control_ui (const Evoral::Parameter&             param,
 			return control_ui;
 		}
 
+		if (desc.datatype != Variant::INT && desc.datatype != Variant::LONG &&
+				desc.datatype != Variant::FLOAT && desc.datatype != Variant::DOUBLE &&
+				desc.datatype != Variant::BOOL && desc.datatype != Variant::NOTHING) {
+			/* unsupported variant type */
+			return control_ui;
+		}
+
 		assert(mcontrol);
 
 		/* See if there any named values for our input value */
@@ -864,6 +871,13 @@ GenericPluginUI::build_control_ui (const Evoral::Parameter&             param,
 
 	} else {
 
+		if (desc.datatype != Variant::INT && desc.datatype != Variant::LONG &&
+				desc.datatype != Variant::FLOAT && desc.datatype != Variant::DOUBLE &&
+				desc.datatype != Variant::BOOL && desc.datatype != Variant::NOTHING) {
+			/* unsupported variant type */
+			return control_ui;
+		}
+
 		control_ui->display = manage (new EventBox);
 		control_ui->display->set_name ("ParameterValueDisplay");
 
-- 
2.11.0

ventosus

2016-12-20 18:10

reporter   ~0019203

2nd try.

I somehow missed that control ports are of type Variant::NOTHING, I wrongly assumed they were of type Variant::FLOAT.

Issue History

Date Modified Username Field Change
2016-03-19 19:23 ventosus New Issue
2016-03-19 19:23 ventosus File Added: 0001-Fix-crash-with-lv2-Parameter-of-Variant-STRING.patch
2016-12-09 13:18 ventosus Note Added: 0019134
2016-12-19 23:02 paul Note Added: 0019187
2016-12-20 08:31 ventosus File Added: 0001-Add-checks-for-supported-variant-types.patch
2016-12-20 08:39 ventosus Note Added: 0019193
2016-12-20 09:08 paul Note Added: 0019194
2016-12-20 09:08 paul Status new => resolved
2016-12-20 09:08 paul Resolution open => fixed
2016-12-20 09:08 paul Assigned To => paul
2016-12-20 13:01 paul Note Added: 0019197
2016-12-20 13:01 paul Status resolved => feedback
2016-12-20 13:01 paul Resolution fixed => reopened
2016-12-20 18:08 ventosus File Added: 0001-Add-checks-for-supported-variant-types-2nd-try.patch
2016-12-20 18:10 ventosus Note Added: 0019203
2016-12-20 18:10 ventosus Status feedback => assigned