|
![]() |
|
Thread Tools | Search this Thread | Display Modes |
![]() |
#41 | |||
Major Dude
Join Date: Mar 2008
Location: Erlangen
Posts: 919
|
Quote:
Quote:
Quote:
Problem: This only becomes visible with range cheks ON but debugger disabled. When I enable the debugger, it crashes really hard. The task manager even insists that killing Lazarus is not a valid option. I have to restart. So the only way to get closer to that is by injecting Showmessages at different places. I think the problem is in LabelGoClick here code: Showmessage tells me that the length (choixrepertoire2) is zero. BTW I had not selected an input folder, just clicked go. I can't see a mistake here, but... code: also prints zero. Looks like the string is not allocated. Check how Lazarus handles ansistrings, maybe they need to be created first... Aha ! code: causes a compilation error : "Element zero of an ansi/wide - or longstring cannot be accessed." Last edited by Nitorami; 15th February 2021 at 09:30. |
|||
![]() |
![]() |
![]() |
#42 |
Junior Member
Join Date: Oct 2018
Posts: 33
|
showmessage (inttostr(Length(ChoixRepertoire2))); >> show '43'
showmessage (inttostr(ptrint(ChoixRepertoire2))); >> show '23533416' Very strange that you have 0. I don't have a crash using MilkDrop2077 too. I really don't see why it's crashing. btw I'm using lazarus-2.0.10-fpc-3.2.0-win32.exe what version are you using? the lazarus-2.0.10-fpc-3.2.0-win64.exe version wouldn't compile the version I did with the xm player (Illegal COFF Magic error on libufmod.o), so I'm using the win32.exe one. |
![]() |
![]() |
![]() |
#43 |
Junior Member
Join Date: Oct 2018
Posts: 33
|
it works on the online sandbox too : https://app.any.run/tasks/edd26891-4...-3969d3938f19/
|
![]() |
![]() |
![]() |
#44 |
Junior Member
Join Date: Oct 2018
Posts: 33
|
I've updated the code to v2.0.1 to check if the output folder is valid just after clicking on go:
if not directoryexists(ChoixRepertoire2) then begin showmessage('Please select a valid OUTPUT folder first'); exit; end; |
![]() |
![]() |
![]() |
#45 |
Major Dude
Join Date: Mar 2008
Location: Erlangen
Posts: 919
|
That solves that problem, but I still get range check errors further down. It does not seem to be 100% reliable, and the position of the error seems to jump, I cannot locate it.
I am using Lazarus x86-64 here. Saying that the program runs somewhere, e.g. in a sandbox, does not mean a lot. You may have uninitialised variables which happen to be zero in your environment, and therefore it works, by chance. I have now recompiled with the "trash variables" option on, to initialise your variables with garbage values. It crashes violently on pressing GO. I could not kill Lazarus, but just before I was about restarting the PC, a message popped up. See attached. Strings are starting at 1, not zero !!!! I guess you have this mistake in more than just one place. |
![]() |
![]() |
![]() |
#46 |
Junior Member
Join Date: Oct 2018
Posts: 33
|
ok your error come from MILKFLOAT3 (the procedure to randomize colors).
can you un-check the 1st checkbox 'randomize colors' and try again to see if it works? I've updated the code to v2.0.2: I removed s : string from public variables (to maybe avoid your error, it crashed on the string 's') I've put a try except end; when clicking on GO, so if one preset crash, the error will be skipped and the rest should carry on (when running the exe alone without lazarus). Also try my exe compiled to with lazarus 32bits to see if you still have errors! |
![]() |
![]() |
![]() |
#47 |
Major Dude
Join Date: Mar 2008
Location: Erlangen
Posts: 919
|
Just a quick test with a fresh github download
Your exe seems to work but I don't trust it, that may be random. Recompiled with Lazarus x68_64 V2.0.0 - All checks OFF: No crash but presets generation reliably ceases after a random number of presets, in general less than 10. - Range checks ON: Same. At least no range check error anymore. - trash variables ON: Hard crash on GO. You most definitely still have uninitialised variables somewhere. - unticked "randomize colors": Seems to run through. |
![]() |
![]() |
![]() |
#48 |
Major Dude
Join Date: Mar 2008
Location: Erlangen
Posts: 919
|
I messed with your code a bit more.
The missing indentation makes it bad to read. For heaven's sake, use indentation. If you are too lazy to do it, simply run a code formatter over the source. Putting everything into huge try-except blocks is also a bad idea because this swallows all exceptions including those generated by FPC's range check. Always test a program thoroughly with range checks ON, before putting everything into try/except blocks. Range check is REALLY REALLY useful to detect progamming errors. I guess you also call Milkfloat3 from inside a try/except or try/finally block, and therefore you were never warned of the range violations within it. After having crashed my machine a few times, I found two further instances of within Milkfloat3 on manual inspection. I changed these to start at 1, and now THAT crash is gone.code: But there is more... In procedure MILKDROP, line 1281, you access s[1] without knowing if s has at least length 1. To gloss over any problems, you put it all within a large try-except block. But you probably call MILKDROP from inside yet another try-except block -> Crash! And you are using GOTOs... these may be considered evil or not, there have been endless discussions on the subject - but GOTO together with try/except is really a very bad idea. |
![]() |
![]() |
![]() |
#49 | |
Junior Member
Join Date: Oct 2018
Posts: 33
|
Quote:
![]() I've tried the CTRL+D to format the code but I don't like it, code looks even bigger, I prefer my big blocks of code ![]() I've changed the for j := 0 to something do if s[j]... to 1! I don't think s[1] could have been empty if you look just a few lines before, but just in case I added a check, I also removed the try-except, and I removed the GOTO! v2.0.3 is up! |
|
![]() |
![]() |
![]() |
#50 |
Junior Member
Join Date: Oct 2018
Posts: 33
|
I think 99.5%+ of the presets generated are now bug free btw!
I've created a zip (https://mega.nz/folder/VFFGUJYB#pPNXxLPIstNE6WzqCWCAJg) with 100.000 presets mashed from CreamOfTheCrop_20200216 with the warp+comp shader from my 200 presets included with MilkDrop2077 with ~30% of values changed up to - or + 20%. I took 28 minutes to create all the presets ![]() I've checked the first 500, 0 errors but 2 are making winamp crashing hard and WACUP freeze and close (#204 and #281). https://mega.nz/file/UF0yzBBA#30B1Jl...cPvq2MCV48Lulw I'd like to know what makes milkdrop to crash if someone have an idea |
![]() |
![]() |
![]() |
#51 |
Junior Member
Join Date: Oct 2018
Posts: 33
|
v2.0.4
I added a F10 hotkey to force closing winamp/wacup in case milkdrop crash. It work really well even if milkdrop is completely unresponsive and you can't call the taskmanager because you're in fullscreen mode, just press the key F10 and winamp will be closed. the formStyle is changed to fsNormal so you can keep MilkDrop2077 easily open when using milkdrop. |
![]() |
![]() |
![]() |
#52 | |
Major Dude
Join Date: Mar 2008
Location: Erlangen
Posts: 919
|
Hi Serge
Quote:
On the crash of #204 and #281: These contain fragments of my mandelbox code in the per frame and preset init sections. In the original code, the preset on startup first calculates a free position in the mandelbox space by try and error. If you make minor changes to it, the code may simply not find such a free position, and keep searching forever. The mashup option was really devised at earlier milkdrop versions, which allowed only very limited and linear programming by the user: 32 variables, hardly any dependencies, no loops, no conditional jumps. But later, a proper programming language (ns-eel) was added, which extended the coding possibilities quite dramatically by providing loops, a global memory space, conditional jumps etc. And it also introduced the possibility of endless loops, and made mashing more risky. The reason why most of your mashups are stable is that these amendmends came rather late, where milkdops had already passed its zenith, and only a few individuals still made presets and used the new features. The F10 option is brillant, and it really works ![]() |
|
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|