projectM-visualizer / projectm

projectM - Cross-platform Music Visualization Library. Open-source and Milkdrop-compatible.
https://discord.gg/mMrxAqaa3W
GNU Lesser General Public License v2.1
3.33k stars 373 forks source link

ProjectM Crashes with Certain Presets #407

Closed stevenswart closed 1 year ago

stevenswart commented 4 years ago

22nd of August 2020

I am reporting four separate issues I am experiencing with ProjectM. I started having problems when I installed the massive community preset pack available on the ProjectM GitHub home page. Previously, I was not experiencing any problems. It seems that there are certain presets in there that cause problems. In some cases, I was able to determine a few of these that were causing problems, and reproduce the errors. In other cases, I was not able to do so.

This is the first of these issues – certain presets that cause ProjectM to crash. (See the attached Crashing.Presets.zip.)

I did some fairly extensive investigations into these problems in June this year, and was able to get as far as discovering that there are four separate issues, according to backtraces that I obtained with GDB.

My use case is that I consider myself to be a Kodi power user. I use Kodi to play music on my media server most of the time that I am home. I have the ProjectM addon installed for Kodi, and I love it. I only use the ProjectM PulseAudio executable when, for example, I am streaming music via a browser. But I was able to determine that these problems originate in the ProjectM library itself, not within Kodi, and they seem to affect both Kodi with the ProjectM visualiser installed, as well as the ProjectM PulseAudio executable.

The problems fall into two classes, crashes (three problems found), and freezes/deadlocks (one problem found). As of this writing, with the latest available software, both these problems still exist.

I love the new presets I have installed, and even though I installed them over two months ago, I am still surprised by the occasional preset that I have never seen before. I have been collecting presets for a long time now, but some of the presets in the community pack are stunning!

Nevertheless, it is annoying when my music occasionally stops and I have to kill/restart Kodi and try to figure out where it was before it crashed. Most annoying when I am listening to DJ sets of an hour or longer!

Kodi reports that I now have 40585 presets installed, so, as you can imagine, it would be an extremely painful exercise for me to manually test every single preset individually and remove the ones that cause problems, certainly, I don’t have that kind of time to spend. Also, I imagine that all of these presets used to work at some point in the Milkdrop/ProjectM lifecycle, and ideally, this should be fixed inside the ProjectM library itself, or in cases where there is a bad preset that does not parse, the exception it causes should be handled, and ProjectM should simply move on to the next preset, possibly adding the faulty preset to some kind of banned list. That would be a far more robust way of handling the problem, to my mind.

Hardware:

My media server is based on an HP Proliant MicroServer, Gen10 (WW Entry BTO Model), specs here:

https://h20195.www2.hpe.com/v2/GetDocument.aspx?docname=a00008701enw&doctype=quickspecs&doclang=EN_US&searchquery=&cc=us&lc=en

Briefly, the hardware is as follows:

CPU: AMD Opteron(TM) X3216 APU - Dual-core, x86_64 Memory-Main Memory-phys_mem: 8053063680 Monitor: LG TV Network Cards: NC332i Adapter x2, RTL8192EE PCIe Wireless Network Adapter Graphics Card: ATI Radeon R5 Graphics Sound Card: Kabini HDMI/DP Audio (built into graphics card).

The hardware info as reported by YaST may be found here:

https://paste.kodi.tv/lilaqabiqe.kodi

Sample Xorg.0.log may be found here:

https://paste.kodi.tv/serijohada

I am experiencing this problem on OpenSUSE Tumbleweed, latest version, updated today (22nd of August 2020), with Kodi Leia 18.8, installed from the packman repo. (Tumbleweed is OpenSUSE’s rolling release.)

However, I don’t think this is a problem with either the hardware or the operating system.

Sample ProjectM PulseAudio backtrace:

https://paste.kodi.tv/iyupelufen

Sample Kodi backtrace:

https://paste.kodi.tv/valonabaku.kodi

Sample Kodi crashlog:

https://paste.kodi.tv/eqibaxekeh.kodi

Crashing.Presets.zip

stevenswart commented 3 years ago

About a month ago, I started moving problem presets out of my preset working folder. I am uploading my latest collection of crashing presets here. Most of these are aborts, but some may be segfaults. Initially, I was not sorting them. Please see attached abort.crashes.presets.zip.

I am also going to list the filenames below, for anyone else who has the Community Preset Pack installed. This list is probably not complete, and I will probably update it later. Due to the random nature of the preset selection, ProjectM may run for months or years without ever loading a problem preset. But for now, this should solve a big part of the problem.

@ AdamFX FusedFX Preset Pack with Ft Amandio C - Goldline (fireworks) FusedFX include  Martin - Flexi - Geiss - StahR - Eos n Phat n Rova  A.milk
BDRV Aderrasi - Accelerator (Plastique Palace) BDRV et  AL  rmx4.milk
Flexi - going processing - dead nz+ but deady, i just wanted to take everything granted!!!.milk
Flexi - going processing - lathe penetrants roam2-,3- i am no good.milk
Flexi - going processing - lathe penetrants roam2-,3-3.milk
Flexi - going processing - lathe penetrants roam2-.milk
Flexi - going processing - lathe penetrants.milk
Flexi - going processing nz.milk
Flexi - going processing roams2.milk
Flexi - going processing.milk
Geiss - Octopus (Hyperdrive Mix).milk
Martin - QBikal - Surface Turbulence [Flexi's alien complex polynomial mix].milk
Martin - QBikal - Surface Turbulence like my cat.milk
Martin - QBikal - Surface Turbulence nz+ load us.milk
Martin - QBikal - Surface Turbulence nz+ opaque clintock.milk
Martin - QBikal - Surface Turbulence nz+ unlinked error.milk
Martin - QBikal - Surface Turbulence nz+.milk
Martin - QBikal - Surface Turbulence.milk
Rozzor vs Esotic - River Portal (with Reenen shapes and waves).milk
Setting New HDFX Trends -  Amandio c - small life (goes disco) ft AdamFx n Geiss - Martin n Stahl .milk
Setting New HDFX Trends -  Amandio c - small life (goes disco) ft AdamFx n Geiss D.milk
Telek & EMPR - Harlequins Kaleidoscope Trip.milk
Telek & EMPR - Hell Cave (Fiddle A Bit (Flicker @xis) Mix).milk
Telek - EMPR - Aztec Pool (flicker @xis).milk
Telek&EMPR-AztecPool(Flicker@x.milk
Telek&EMPR-RollingDunes(Filcker.milk
Telek&empr-aztecpool(flicker@xismix).milk
Tribal Dialect.milk
akish - night's bane.milk
beta106i - Arcworld (Anti-Entropic Cycle) - ape loaf.milk
gastly - Soft Flames Crazy Remix.milk
martin - autumn melancholy - interolerate - rw3 thaee aend mbvaellz.milk
more qoinz latzolute.milk
more qoinz proqupoint subtextual etchingth.milk
more qoinz.milk
sonar cow.milk
suksma - clouded(1).milk
suksma - ken shoulders.milk
xtramartin (775).milk
xtramartin (776).milk
xtramartin (777).milk
xtramartin (779).milk
xtramartin (783).milk
xtramartin (785).milk
xtramartin (787).milk
xtramartin (789).milk
xtramartin (792).milk
xtramartin (793).milk
xtramartin (794).milk
xtramartin (796).milk
xtramartin (797).milk
xtramartin (798).milk

abort.crashes.presets.zip

stevenswart commented 3 years ago

Good day, all!

Thank you for looking into this. I have continued removing aborting presets. Please see attached Crashes.Abort.4.zip. I am not sure if this problem has been fixed yet, for all cases.

My latest list is as follows:

Martin - Flexi - Geiss - StahR - Eos n Phat n Rova  A.milk
A New Begining With Martin - acid wiring (RewiredFX)Ft AdamFX - Hexcollie - Armandio C - Geiss - Restructured DropDown D.milk
BDRV Aderrasi - Accelerator (Plastique Palace) BDRV et  AL  rmx.milk
BDRV Aderrasi - Accelerator (Plastique Palace) BDRV et  AL  rmx2.milk
BDRV Aderrasi - Accelerator (Plastique Palace) BDRV et  AL  rmx3.milk
BDRV Aderrasi - Accelerator (Plastique Palace) BDRV et  AL  rmx4.milk
Cyclic Insanity.milk
Esotic and KrashBC - Energy Fields Forever.milk
EvilJim - #40 Irregular Zoom.milk
EvilJim - Irregular Zoom.milk
Flexi - going processing - all is interpretation, all is quid pro quo, there is no money nz+.milk
Flexi - going processing - all is interpretation, all is quid pro quo, there is no money.milk
Flexi - going processing - dead nz+ but deady, i just wanted to take everything granted!!!.milk
Flexi - going processing - dead.milk
Flexi - going processing - lathe penetrants roam2-,3- i am no good.milk
Flexi - going processing - lathe penetrants roam2-,3-.milk
Flexi - going processing - lathe penetrants roam2-,3-2.milk
Flexi - going processing - lathe penetrants roam2-,3-3.milk
Flexi - going processing - lathe penetrants roam2-.milk
Flexi - going processing - lathe penetrants.milk
Flexi - going processing [a wip 03].milk
Flexi - going processing mc devvo.milk
Flexi - going processing nz+.milk
Flexi - going processing nz.milk
Flexi - going processing roams.milk
Flexi - going processing roams2.milk
Flexi - going processing.milk
Flexi - impulse drive.milk
Geiss - Octopus (Hyperdrive Mix).milk
Hexcollie - Qbert (Personal mash).milk
Hexcollie - Quilted Blotter.milk
Hexcollie - Ultra daze.milk
Martin - QBikal - Surface Turbulence [Flexi's alien complex polynomial mix].milk
Martin - QBikal - Surface Turbulence like my cat.milk
Martin - QBikal - Surface Turbulence nz+ 179.milk
Martin - QBikal - Surface Turbulence nz+ asm.milk
Martin - QBikal - Surface Turbulence nz+ bdabbt.milk
Martin - QBikal - Surface Turbulence nz+ farm.milk
Martin - QBikal - Surface Turbulence nz+ grep disk.milk
Martin - QBikal - Surface Turbulence nz+ load us.milk
Martin - QBikal - Surface Turbulence nz+ opaque clintock.milk
Martin - QBikal - Surface Turbulence nz+ phuentez.milk
Martin - QBikal - Surface Turbulence nz+ postdeterminativa.milk
Martin - QBikal - Surface Turbulence nz+ rankor.milk
Martin - QBikal - Surface Turbulence nz+ unlinked error.milk
Martin - QBikal - Surface Turbulence nz+.milk
Martin - QBikal - Surface Turbulence.milk
Rozzor & Esotic - River Portal (With Reenen Shapes & Waves).milk
Rozzor vs Esotic - River Portal (with Reenen shapes and waves).milk
Setting New HDFX Trends -  Amandio c - small life (goes disco) ft AdamFx n Geiss - Martin n Stahl .milk
Setting New HDFX Trends -  Amandio c - small life (goes disco) ft AdamFx n Geiss A.milk
Setting New HDFX Trends -  Amandio c - small life (goes disco) ft AdamFx n Geiss D.milk
Setting New HDFX Trends -  Amandio c - small life (goes disco) ft AdamFx n Geiss and Hexcollie.milk
Telek & EMPR - Aztec Pool (Flicker @xis Mix).milk
Telek & EMPR - Harlequins Kaleidoscope Trip.milk
Telek & EMPR - Hell Cave (Fiddle A Bit (Flicker @xis) Mix).milk
Telek & EMPR - Rolling Dunes (Filcker @xis Mix).milk
Telek - EMPR - Aztec Pool (flicker @xis).milk
Telek - EMPR - Hell Cave (fiddle a bit) (flicker @xis).milk
Telek - EMPR - Rolling Dunes (filcker @xis).milk
Telek&EMPR-AztecPool(Flicker@x.milk
Telek&EMPR-HellCave(FiddleABi.milk
Telek&EMPR-RollingDunes(Filcker.milk
Telek&empr-aztecpool(flicker@xismix).milk
Telek&empr-hellcave(fidd(flicker@xis).milk
Telek&empr-rollingdunes(filcker@xismi.milk
Tribal Dialect.milk
_geiss_experimental__Spiral Artifact (Filament Mix) - scallop mix.milk
akish - night's bane.milk
amandio c - mirage - merkaba1.milk
amandio c - photo warp.milk
amandio c - small life polished (goes disco).milk
beta106i - Arcworld (Anti-Entropic Cycle) - ape loaf.milk
gastly - Soft Flames Crazy Remix.milk
goody + suksma - more spectro temp2 (y warping fixed) 2.milk
martin - autumn melancholy - interolerate - rw3 thaee aend mbvaellz.milk
more qoinz cep.milk
more qoinz latzolute.milk
more qoinz proqupoint subtextual etchingth.milk
more qoinz proqupoint.milk
more qoinz.milk
sonar cow.milk
suksma - bart.milk
suksma - clouded(1).milk
suksma - ken shoulders.milk
suksma - spectro experiment 334.milk
xtramartin (771).milk
xtramartin (775).milk
xtramartin (776).milk
xtramartin (777).milk
xtramartin (779).milk
xtramartin (780).milk
xtramartin (781).milk
xtramartin (782).milk
xtramartin (783).milk
xtramartin (784).milk
xtramartin (785).milk
xtramartin (786).milk
xtramartin (787).milk
xtramartin (788).milk
xtramartin (789).milk
xtramartin (790).milk
xtramartin (791).milk
xtramartin (792).milk
xtramartin (793).milk
xtramartin (794).milk
xtramartin (795).milk
xtramartin (796).milk
xtramartin (797).milk
xtramartin (798).milk
xtramartin (799).milk

Crashes.Abort.4.zip

kblaschke commented 1 year ago

I looked into the issue and found that projectM's preset parser has some serious issues with malformed expressions. It will crash with an assertion violation (leading to SIGABRT) on the following occasions, and probably others as well:

I'm not sure how Milkdrop handles these cases, but since they've used Bison/Flex to parse the expressions, it will probably also fail to compile the code.

The current parser has more implementation problems beyond these aborts and there's already issue #590 to fix these by rewriting the whole parser/compiler code from scratch.

To fix the crashes, I'll replace the assert() calls with exceptions, which will notify the application that the preset couldn't be parsed, requesting to load another one. The preset won't display properly anyway, so there's no harm in skipping them.