-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lv2: Fix overflow and enum visualization #5811
Lv2: Fix overflow and enum visualization #5811
Conversation
* Fix arithmetic overflow in `Lv2Ports::Meta::get()` in case min and max are not set * Fix combo boxes with >16 values being wrongly visualized as knobs * Rename `Lv2Ports::Vis` enum value `None` to `Generic`
🤖 Hey, I'm @LmmsBot from github.com/lmms/bot and I made downloads for this pull request, click me to make them magically appear! 🎩
Linux
Windows
macOS🤖{"platform_name_to_artifacts": {"Linux": [{"artifact": {"title": {"title": "(AppImage)", "platform_name": "Linux"}, "link": {"link": "https://10941-15778896-gh.circle-artifacts.com/0/lmms-1.3.0-alpha.1.29%2Bgf9a06f2-linux-x86_64.AppImage"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/10941?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}], "Windows": [{"artifact": {"title": {"title": "32-bit", "platform_name": "Windows"}, "link": {"link": "https://10942-15778896-gh.circle-artifacts.com/0/lmms-1.3.0-alpha.1.29%2Bgf9a06f2a3-mingw-win32.exe"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/10942?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}, {"artifact": {"title": {"title": "64-bit", "platform_name": "Windows"}, "link": {"link": "https://10943-15778896-gh.circle-artifacts.com/0/lmms-1.3.0-alpha.1.29%2Bgf9a06f2a3-mingw-win64.exe"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/10943?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}, {"artifact": {"title": {"title": "32-bit", "platform_name": "Windows"}, "link": {"link": "https://ci.appveyor.com/api/buildjobs/0p79d4ep0b7ub9y7/artifacts/build/lmms-1.3.0-alpha-msvc2017-win32.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/36568061"}, {"artifact": {"title": {"title": "64-bit", "platform_name": "Windows"}, "link": {"link": "https://ci.appveyor.com/api/buildjobs/86pmhpdevc94317h/artifacts/build/lmms-1.3.0-alpha-msvc2017-win64.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/36568061"}], "macOS": [{"artifact": {"title": {"title": "", "platform_name": "macOS"}, "link": {"link": "https://10940-15778896-gh.circle-artifacts.com/0/lmms-1.3.0-alpha.1.29%2Bgf9a06f2a3-mac10.13.dmg"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/10940?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}]}, "commit_sha": "dcaba3a69bcde9898e49bd2a5fec89c754aba584"} |
Same overflow.
I don't think the problem is that they're not set but that they are set to the max/min values for a float. max - (-min) => 2*max => overflow. Why not set m_max/m_min to something smaller? I made it run by setting them to 1.0f/-1.0f . LogsClick to expandThread 1 "lmms" received signal SIGFPE, Arithmetic exception. Lv2Ports::Meta::get (this=0x7fffffffd890, plugin=0x555555f960f0, portNum=4) at /home/zonkmachine/builds/lmms/src/core/lv2/Lv2Ports.cpp:221 221 if (m_max - m_min > 15.0f) (gdb) bt full #0 Lv2Ports::Meta::get(LilvPluginImpl const*, unsigned long) (this=0x7fffffffd890, plugin=0x555555f960f0, portNum=4) at /home/zonkmachine/builds/lmms/src/core/lv2/Lv2Ports.cpp:221 isToggle = false minN = 0x0 maxN = 0x0 def = std::unique_ptr = {get() = 0x0} defN = 0x0 min = std::unique_ptr = {get() = 0x0} max = std::unique_ptr = {get() = 0x0} takeRangeValue = {__this = 0x7fffffffd890, __issue = @0x7fffffffd6f8, __portName = "latency"} portIssues = std::vector of length 0, capacity 0 issue = {__portIssues = std::vector of length 0, capacity 0} man = 0x555556057ef0 lilvPort = 0x5555567880a0 portFunc = {__plugin = @0x7fffffffd6d8, __lilvPort = @0x7fffffffd708, __man = @0x7fffffffd700} hasProperty = {__portFunc = @0x7fffffffd760} isA = {__portFunc = @0x7fffffffd760} portName = "latency" m_min_set = {__this = 0x7fffffffd890} m_max_set = {__this = 0x7fffffffd890} #1 0x0000555555849d48 in Lv2Proc::check(LilvPluginImpl const*, std::vector >&) (plugin=0x555555f960f0, issues=std::vector of length 0, capacity 0) at /home/zonkmachine/builds/lmms/src/core/lv2/Lv2Proc.cpp:85 meta = {m_type = Lv2Ports::Type::Control, m_flow = Lv2Ports::Flow::Output, m_vis = Lv2Ports::Vis::None, m_logarithmic = false, m_optional = false, m_used = true, m_def = 0, m_min = -3.40282347e+38, m_max = 3.40282347e+38, m_sampleRate = false} tmp = std::vector of length 0, capacity 0 portMustBeUsed = true portNum = 4 |
@zonkmachine The line that your gdb crashes in is not part of this PR anymore 😃 . Did you forget to rebuild? It should really work now. |
It works.
No, I think I was on the wrong commit somehow. I thought i 'fetched'... :p |
@zonkmachine OK, take your time for testing, and let me know when you think this PR - and the stuff from the old logarithmic PR - are ready for merge. |
I'll leave this open for 5 days anyways. |
I'm getting the rpmalloc issue with FPE here. I think you mentioned that problem already in discord @zonkmachine ? Any solutions to that?
|
I was just looking into that. I don't know how to touch
|
I think we need to merge this branch to master now and rebase the Lv2 options PR, in order to debug it with FPE? Right now, the options PR always hangs at the |
Please do. Now. |
Unfortunately, the developer who wrote #5788 forgot the testing phase for their PR 👎 . This fix does (citing the commit log):
Lv2Ports::Meta::get()
in case min andmax are not set
Lv2Ports::Vis
enum valueNone
toGeneric
First: Let's wait for CI.
Code review: optional.
Testing: Please test the #5788 PR here again, with the instructions from there. Please also check that the arithmetic overflow is gone.