Golly bugs

Has something gone haywire? Let us know about it!
User avatar
Anivec
Posts: 1981
Joined: January 28th, 2022, 7:18 pm
Location: In 4.3 miles, take a right onto Exit 54

Re: Golly bugs

Post by Anivec »

Andrew wrote: May 31st, 2024, 9:39 pm
AlbertArmStain wrote: May 31st, 2024, 5:43 pm The web version will not load my catforce output rle while the downloaded version of Golly will.
Please provide a short example of some RLE code that fails.
When I try to paste it into the web version of Golly, it simply ignores it too
Here's a fragment of the rle:

Code: Select all

x = 0, y = 0, rule = B3/S23
12$28bo99bo99bo$28b3o97b3o15b2o80b3o15b2o$31bo99bo13bobo83bo13bobo$30b2o98b2o13b2o83b2o13b2o$43b2o98b2o98b2o$42bobo97bobo5b2o90bobo5b2o$42b2o98b2o5bobo90b2o5bobo$149b2o98b2o$147b2o98b2o$146bobo97bobo$146b2o98b2o10$49bo99bo99bo$47bobo97bobo97bobo$47b3o97b3o97b3o$47bo99bo99bo3$53b2o98b2o98b2o$53b2o98b2o98b2o2$43b2o98b2o98b2o$44bo99bo99bo$43bo3b2o94bo3b2o94bo3b2o$43bobo2bo94bobo2bo94bobo2bo$42b2ob2o95b2ob2o95b2ob2o$40bo2bobo94bo2bobo94bo2bobo$40b3o4bo92b3o4bo92b3o4bo$32b2obobo8b2o84b2obobo8b2o84b2obobo8b2o$32bob2ob4o91bob2ob4o91bob2ob4o$36bo3bo95bo3bo95bo3bo$33b2o2bo95b2o2bo95b2o2bo$33bob2o96bob2o96bob2o48$2$442b2o$41b2o399bo$41bo299b2o100bo$42bo100b2o96b2o98bo98b4o$39b4o96b2o2bo97bobo99bo2bo93bo$39bo99bobobo99bo98b5o96b3o$42b3o95bo2b2o97b2ob2obo194bo2bo$42bo2bo97bo2bo98bob2o95bo100b2o$44b2o99b2o98bo97bobo$244b2o98b2o7$26bo99bo99bo99bo99bo$25bobo97bobo97bobo97bobo97bobo$26bo99bo99bo99bo99bo12$49bo99bo99bo99bo99bo$47bobo97bobo97bobo97bobo97bobo$47b3o97b3o97b3o97b3o97b3o$47bo99bo99bo99bo99bo3$53b2o98b2o98b2o98b2o98b2o$53b2o98b2o98b2o98b2o98b2o2$43b2o98b2o98b2o98b2o98b2o$44bo99bo99bo99bo99bo$43bo3b2o94bo3b2o94bo3b2o94bo3b2o94bo3b2o$43bobo2bo94bobo2bo94bobo2bo94bobo2bo94bobo2bo$42b2ob2o95b2ob2o95b2ob2o95b2ob2o95b2ob2o$40bo2bobo94bo2bobo94bo2bobo94bo2bobo94bo2bobo$40b3o4bo92b3o4bo92b3o4bo92b3o4bo92b3o4bo$32b2obobo8b2o84b2obobo8b2o84b2obobo8b2o84b2obobo8b2o84b2obobo8b2o$32bob2ob4o91bob2ob4o91bob2ob4o91bob2ob4o91bob2ob4o$36bo3bo95bo3bo95bo3bo95bo3bo95bo3bo$33b2o2bo95b2o2bo95b2o2bo95b2o2bo95b2o2bo$33bob2o96bob2o96bob2o96bob2o96bob2o48$3$41b2o98b2o98b2o98b2o98b2o$41bo99bo99bo99bo99bo$42bo99bo99bo99bo99bo$39b4o96b4o96b4o96b4o96b4o$39bo99bo99bo99bo99bo$42b3o97b3o97b3o97b3o97b3o$42bo2bo96bo2bo96bo2bo96bo2bo96bo2bo$44b2o98b2o98b2o98b2o98b2o22$49bo99bo99bo74b2o23bo99bo$47bobo74b2o21bobo97bobo74b2o21bobo97bobo$28b2o17b3o74b2o2b2o17b3o78b2o17b3o78b2o17b3o78b2o17b3o$28b2o17bo80b2o17bo76b2o2b2o17bo80b2o17bo80b2o17bo$224b2o2$53b2o98b2o98b2o98b2o71b2o25b2o$53b2o98b2o98b2o98b2o71b2o25b2o2$43b2o98b2o98b2o98b2o98b2o$44bo99bo99bo99bo99bo$43bo3b2o94bo3b2o94bo3b2o94bo3b2o94bo3b2o$
User avatar
Andrew
Moderator
Posts: 1039
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

Re: Golly bugs

Post by Andrew »

AlbertArmStain wrote: June 1st, 2024, 4:50 pm When I try to paste it into the web version of Golly, it simply ignores it too
Works fine in web Golly on my Mac in Firefox and Chrome, so use a different browser or ask the author of catforce to generate nicer RLE.
Use Glu or Glui to explore CA rules on non-periodic tilings: DominoLife and HatLife
User avatar
Anivec
Posts: 1981
Joined: January 28th, 2022, 7:18 pm
Location: In 4.3 miles, take a right onto Exit 54

Re: Golly bugs

Post by Anivec »

Andrew wrote: June 1st, 2024, 7:14 pm
AlbertArmStain wrote: June 1st, 2024, 4:50 pm When I try to paste it into the web version of Golly, it simply ignores it too
Works fine in web Golly on my Mac in Firefox and Chrome, so use a different browser or ask the author of catforce to generate nicer RLE.
Oh, the RLE is much longer though, and with out any proper spacing. I believe this confuses both Golly and the Life Veiwer.

The creator of the version of Catforce I’m currently using is guaranteed not to do anything because he never reads the forums.
User avatar
LaundryPizza03
Posts: 2624
Joined: December 15th, 2017, 12:05 am
Location: Unidentified location "https://en.wikipedia.org/wiki/Texas"

Re: Golly bugs

Post by LaundryPizza03 »

Running this script from a beta version of EmnumPattEvo crashes Golly. I think it is not designed for Golly, but it is unclear why it crashes Golly if I attempt to run it.
filter-epe.py.txt
(2.02 KiB) Downloaded 244 times

Code: Select all

x = 4, y = 3, rule = B3-q4z5y/S234k5j
2b2o$b2o$2o!
LaundryPizza03 at Wikipedia
User avatar
Andrew
Moderator
Posts: 1039
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

Re: Golly bugs

Post by Andrew »

LaundryPizza03 wrote: July 6th, 2024, 1:36 am Running this script from a beta version of EmnumPattEvo crashes Golly. I think it is not designed for Golly, but it is unclear why it crashes Golly if I attempt to run it.
Golly isn't really crashing (there is no crash log). Golly is exiting because the script calls sys.exit(). Probably not a good idea to run a script that isn't meant for Golly (which should be obvious if the script doesn't import golly or glife near the start).
Use Glu or Glui to explore CA rules on non-periodic tilings: DominoLife and HatLife
User avatar
Andrew
Moderator
Posts: 1039
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

Re: Golly bugs

Post by Andrew »

b-engine wrote: May 21st, 2024, 10:15 pm I don't know if this is the right thread, but in the mobile version 1.3 the text is too large: ...
We're currently working on a new version of Android Golly but haven't been able to reproduce this problem on any of our devices (with Android versions ranging from 5.1 to 13), so please provide specific details about your device: Android version, screen dimensions and resolution if you know them, and if you have some sort of magnification setting enabled.

Also, in future, please report Android-specific problems in the relevant "Golly x.x for Android" thread.
Use Glu or Glui to explore CA rules on non-periodic tilings: DominoLife and HatLife
User avatar
Vort
Posts: 248
Joined: May 14th, 2024, 6:35 am

Re: Golly bugs

Post by Vort »

AlbertArmStain wrote: May 31st, 2024, 5:43 pm The web version will not load my catforce output rle while the downloaded version of Golly will.
Downloaded version fails to read CatForce RLEs as well.
And right, it's a problem of CatForce, it violates RLE standard.
AlbertArmStain wrote: June 3rd, 2024, 6:25 am The creator of the version of Catforce I’m currently using is guaranteed not to do anything because he never reads the forums.
Do you mean https://github.com/mvr/CatForce ?
I was thinking about creating GitHub Issue about this problem, but for some reason Issues are disabled for this repository.
Pull Requests are enabled, so there is a chance, it should not be too hard to create fix for this problem.
It requires few lines of code probably.
User avatar
Vort
Posts: 248
Joined: May 14th, 2024, 6:35 am

Re: Golly bugs

Post by Vort »

Did anyone mentioned OS crashes when opening ~5 instances of Golly?
I often need more (because Golly have no support for tabs, like web browsers have).
Problem can be partially solved by typing "net stop uxsms" and "net start uxsms".
But sometimes OS crash leads to random programs glitching or crashing as well, which is harder to track.

I see this problem with Windows 7, did not tested with other versions, maybe they are fine.
User avatar
confocaloid
Posts: 6697
Joined: February 8th, 2022, 3:15 pm
Location: learn to protect yourself against stray gliders and sparks and self-destruct mechanisms

Re: Golly bugs

Post by confocaloid »

Vort wrote: July 21st, 2024, 5:12 pm [...] (because Golly have no support for tabs, like web browsers have) [...]
Do you know about layers? (The menu "Layer" in Golly; "Help -> Layer Menu" for more information.)
127:1 B3/S234c User:Confocal/R (isotropic CA, incomplete)
Unlikely events happen.
My silence does not imply agreement, nor indifference. If I disagreed with something in the past, then please do not construe my silence as something that could change that.
User avatar
Vort
Posts: 248
Joined: May 14th, 2024, 6:35 am

Re: Golly bugs

Post by Vort »

confocaloid wrote: July 21st, 2024, 5:30 pmDo you know about layers? (The menu "Layer" in Golly; "Help -> Layer Menu" for more information.)
Didn't knew about it, thanks for the information.
However, layers feature doesn't have the same level of usability as tabs in browsers have.
Having several open Golly windows (processes) is more convenient.
User avatar
b-engine
Posts: 3762
Joined: October 26th, 2023, 4:11 am
Location: Somewhere on where Earth At
Contact:

Re: Golly bugs

Post by b-engine »

Andrew wrote: July 20th, 2024, 10:20 pm We're currently working on a new version of Android Golly but haven't been able to reproduce this problem on any of our devices (with Android versions ranging from 5.1 to 13), so please provide specific details about your device: Android version, screen dimensions and resolution if you know them, and if you have some sort of magnification setting enabled.

Also, in future, please report Android-specific problems in the relevant "Golly x.x for Android" thread.
Android 14, no magnification setting enabled.
User avatar
Vort
Posts: 248
Joined: May 14th, 2024, 6:35 am

Re: Golly bugs

Post by Vort »

Vort wrote: July 21st, 2024, 5:12 pm Did anyone mentioned OS crashes when opening ~5 instances of Golly?
I figured out why crashes happen:
Because of gazillion icons created in wxBitmap** CreateIconBitmaps(const char** xpmdata, int maxstates).
https://learn.microsoft.com/en-us/windows/win32/sysinfo/gdi-objects wrote:There is a theoretical limit of 65,536 GDI handles per session. However, the maximum number of GDI handles that can be opened per session is usually lower, since it is affected by available memory.
User avatar
rowett
Moderator
Posts: 4586
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Golly bugs

Post by rowett »

Vort wrote: July 25th, 2024, 5:28 pm
Vort wrote: July 21st, 2024, 5:12 pm Did anyone mentioned OS crashes when opening ~5 instances of Golly?
I figured out why crashes happen:
Because of gazillion icons created in wxBitmap** CreateIconBitmaps(const char** xpmdata, int maxstates).
https://learn.microsoft.com/en-us/windows/win32/sysinfo/gdi-objects wrote:There is a theoretical limit of 65,536 GDI handles per session. However, the maximum number of GDI handles that can be opened per session is usually lower, since it is affected by available memory.
I don't think that's relevant: CreateIconBitmaps is not a GDI API. Golly uses a graphical library called wxWidgets. On startup Golly only creates around 200 icons.
User avatar
Vort
Posts: 248
Joined: May 14th, 2024, 6:35 am

Re: Golly bugs

Post by Vort »

rowett wrote: July 26th, 2024, 2:03 am I don't think that's relevant: CreateIconBitmaps is not a GDI API. Golly uses a graphical library called wxWidgets.
CreateIconBitmaps creates GDI handles via new wxBitmap call.
rowett wrote: July 26th, 2024, 2:03 am On startup Golly only creates around 200 icons.
CreateIconBitmaps have "// duplicate last icon" section, which creates largest amount of GDI handles.
It is probably ok to fix this problem like this (or in similar way - with smart pointers for example, std::shared_ptr):

Code: Select all

diff --git a/gui-wx/wxalgos.cpp b/gui-wx/wxalgos.cpp
index 5f1290b1..516f93b1 100644
--- a/gui-wx/wxalgos.cpp
+++ b/gui-wx/wxalgos.cpp
@@ -590,17 +590,18 @@ wxBitmap** CreateIconBitmaps(const char** xpmdata, int maxstates)
         // initialize all pointers (not just those < maxstates)
         for (int i = 0; i < 256; i++) iconptr[i] = NULL;
         
+        wxBitmap* lastIcon = nullptr;
         for (int i = 0; i < numicons; i++) {
             wxRect rect(0, i*wd, wd, wd);
+            lastIcon = new wxBitmap(allicons.GetSubBitmap(rect));
             // add 1 to skip iconptr[0] (ie. dead state)
-            iconptr[i+1] = new wxBitmap(allicons.GetSubBitmap(rect));
+            iconptr[i+1] = lastIcon;
         }
         
         if (numicons < maxstates-1 && iconptr[numicons]) {
             // duplicate last icon
-            wxRect rect(0, (numicons-1)*wd, wd, wd);
             for (int i = numicons; i < maxstates-1; i++) {
-                iconptr[i+1] = new wxBitmap(allicons.GetSubBitmap(rect));
+                iconptr[i+1] = lastIcon;
             }
         }
     }
@@ -612,7 +613,15 @@ wxBitmap** CreateIconBitmaps(const char** xpmdata, int maxstates)
 void FreeIconBitmaps(wxBitmap** icons)
 {
     if (icons) {
-        for (int i = 0; i < 256; i++) delete icons[i];
+        for (int i = 0; i < 256; i++) {
+            wxBitmap* ptr = icons[i];
+            if (ptr == nullptr)
+                continue;
+            for (int j = i; j < 256; j++)
+                if (icons[j] == ptr)
+                    icons[j] = nullptr;
+            delete ptr;
+        }
         free(icons);
     }
 } 
User avatar
rowett
Moderator
Posts: 4586
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Golly bugs

Post by rowett »

Vort wrote: July 26th, 2024, 2:40 am CreateIconBitmaps creates GDI handles via new wxBitmap call.
You're correct.
Vort wrote: July 26th, 2024, 2:40 am CreateIconBitmaps have "// duplicate last icon" section, which creates largest amount of GDI handles.
It is probably ok to fix this problem like this (or in similar way - with smart pointers for example, std::shared_ptr)
Looks good. From my tests it reduced the GDI handles from over 5000 to 570 on startup.
GDIhandles.png
GDIhandles.png (3.5 KiB) Viewed 16025 times
User avatar
Andrew
Moderator
Posts: 1039
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

Re: Golly bugs

Post by Andrew »

rowett wrote: July 26th, 2024, 3:53 am Looks good. From my tests it reduced the GDI handles from over 5000 to 570 on startup.
Presumably Golly could also crash if 5 or more (non-cloned) layers are created. Chris, I'm unable to reproduce any crash on my Windows VM so can you please commit Vort's changes and test for any problems. I have a (very!) vague memory that sharing icon pointers caused problems, so it would be a good idea to test this change in situations like switching from a Generations rule with lots of states to a rule with fewer states and vice versa, especially via Undo/Redo. Ditto for LtL and RuleLoader rules with a different number of states.
Use Glu or Glui to explore CA rules on non-periodic tilings: DominoLife and HatLife
User avatar
rowett
Moderator
Posts: 4586
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Golly bugs

Post by rowett »

Andrew wrote: July 27th, 2024, 10:38 pm Presumably Golly could also crash if 5 or more (non-cloned) layers are created. Chris, I'm unable to reproduce any crash on my Windows VM...
I can't reproduce the crash on my system. It may be because I'm on Windows 11 and the original report was on Windows 7. I merely tested the fix to see if it did reduce GDI handle usage (which it does).

On a side note using non-cloned layers doesn't seem to increase the used GDI handles so using Layers could be a workaround.

I'll do some more testing when I get time anyway.
User avatar
Vort
Posts: 248
Joined: May 14th, 2024, 6:35 am

Re: Golly bugs

Post by Vort »

rowett wrote: July 29th, 2024, 2:53 amI can't reproduce the crash on my system. It may be because I'm on Windows 11 and the original report was on Windows 7.
First thing, which may matter, is amount of available RAM.
Docs from Microsoft mention that handle limit is related to RAM amount.
Second thing - Aero theme in Windows 7, this is what exactly crashes.
If Aero is disabled, then there may be no crash.

Anyway, how many instances did you tried to run simultaneously?
If 65536 handle limit is still in place in Windows 11, then with 5k handles per process, there should definitely be problems with 14 processes launched.
Andrew wrote: July 27th, 2024, 10:38 pm... I have a (very!) vague memory that sharing icon pointers caused problems, ...
In case of having exact reproduction steps for problems, I will try to figure out why they happen.
rowett wrote: July 29th, 2024, 2:53 amOn a side note using non-cloned layers doesn't seem to increase the used GDI handles so using Layers could be a workaround.
Why workarounds may be needed?
User avatar
rowett
Moderator
Posts: 4586
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Golly bugs

Post by rowett »

Vort wrote: July 29th, 2024, 3:27 am Anyway, how many instances did you tried to run simultaneously?
If 65536 handle limit is still in place in Windows 11, then with 5k handles per process, there should definitely be problems with 14 processes launched.
I ran 40 instances with no issues. I do have 64Gb RAM.

gollyx40.png
gollyx40.png (69.02 KiB) Viewed 15902 times
User avatar
Vort
Posts: 248
Joined: May 14th, 2024, 6:35 am

Re: Golly bugs

Post by Vort »

Here is a video demonstration of this problem, just in case:
https://www.youtube.com/watch?v=biHG0kMufA0
Antonin Duda
Posts: 168
Joined: October 19th, 2023, 10:23 am
Location: 404 not found

Re: Golly bugs

Post by Antonin Duda »

Max hash memory has been limited to 300 MB on android for a really long time, and phones are much more powerful now.
User avatar
Gustone
Posts: 881
Joined: March 6th, 2019, 2:26 am

Re: Golly bugs

Post by Gustone »

Zoomed out patterns in Windows Vista look like the left, in Windows 7 it's the right. What is the cause? How do i make it look like the left in Windows 7?
Attachments
Clipboard.png
Clipboard.png (3.54 KiB) Viewed 9744 times
User avatar
Andrew
Moderator
Posts: 1039
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

Re: Golly bugs

Post by Andrew »

Gustone wrote: November 17th, 2024, 1:09 pm Zoomed out patterns in Windows Vista look like the left, in Windows 7 it's the right. What is the cause? How do i make it look like the left in Windows 7?
I suspect that on the right you have View > Smarter Scaling turned on. That option doesn't work well with sparse two-state patterns.
Use Glu or Glui to explore CA rules on non-periodic tilings: DominoLife and HatLife
User avatar
eRroR_6o6
Posts: 383
Joined: August 15th, 2023, 1:24 am
Location: somewhere over the rainbow

Re: Golly bugs

Post by eRroR_6o6 »

If you try to draw a cell and reset a pattern simultaneously while it's running, it clears the whole layer. I have (by accident) learned this the hard way many, many times.

(Keep in mind I'm using golly 4.3b2, so maybe this was fixed in a newer version.)

Edit: I literally just got golly 4.3 a few minutes ago, and it still seems to have the bug.

Code: Select all

x = 19, y = 37, rule = B3/S23
13b3o$12b4o$11b2obobo$13bobo$15bo12$10b2o$bobo7bobo$o7b2o3b2o$o3bo2b3o
3bo$o6b4obo$o2bo7bo$3o12bobo$18bo$14bo3bo$14bo3bo$18bo$9bo5bo2bo$8b3o
5b3o2$10bo$2bobo4b2o$5bo2b3o$5bo2b3o$2bo2bo2b2obo$3b3o3b3o$10bo!
User avatar
confocaloid
Posts: 6697
Joined: February 8th, 2022, 3:15 pm
Location: learn to protect yourself against stray gliders and sparks and self-destruct mechanisms

Re: Golly bugs

Post by confocaloid »

eRroR_6o6 wrote: December 16th, 2024, 9:50 pm If you try to draw a cell and reset a pattern simultaneously while it's running, it clears the whole layer. I have (by accident) learned this the hard way many, many times.

(Keep in mind I'm using golly 4.3b2, so maybe this was fixed in a newer version.)

Edit: I literally just got golly 4.3 a few minutes ago, and it still seems to have the bug.
Can you explain the details of how to reproduce the bug? I can't seem to reproduce it either in 4.3b2 or 4.3. I tried a two-state B3/S23 pattern and a History version of the same pattern. I tried drawing a cell while the pattern is evolving, and resetting a pattern. It works the expected way (the cell is drawn and then immediately dies; the pattern resets correctly).
127:1 B3/S234c User:Confocal/R (isotropic CA, incomplete)
Unlikely events happen.
My silence does not imply agreement, nor indifference. If I disagreed with something in the past, then please do not construe my silence as something that could change that.
Post Reply