ConwayLife.com - A community for Conway's Game of Life and related cellular automata
Home  •  LifeWiki  •  Forums  •  Download Golly

A problem with Metafier

Has something gone haywire? Let us know about it!

A problem with Metafier

Postby Alexey_Nigin » April 29th, 2015, 4:33 pm

I have got Golly 2.7b2 and Python 2.7 (both 64-bit). My OS is Windows 7. When I try to run Metafier, the following thing happens:

Metafier.JPG
Metafier.JPG (216.58 KiB) Viewed 6521 times


Approximate translation of the text into English:
"Program "Golly.exe" has been terminated.
Windows is seeking a way to get rid of this problem..."

Other scripts seem to work normally.
There are 10 types of people in the world: those who understand binary and those who don't.
User avatar
Alexey_Nigin
 
Posts: 323
Joined: August 4th, 2014, 12:33 pm
Location: Ann Arbor, MI

Re: A problem with Metafier

Postby dvgrn » April 29th, 2015, 4:47 pm

Alexey_Nigin wrote:I have got Golly 2.7b2 and Python 2.7 (both 64-bit). When I try to run Metafier, the following thing happens... Other scripts seem to work normally.

This is a crash and exit while the script is trying to build the OFF tile, correct? I wrote that script, so most likely it's my fault somehow.

Is there now a "metapixel-OFF.rle" file in your Golly data directory, or no? I assume there's no "metapixel-ON.rle" since the status line shows that the script didn't get that far.

The script still works fine for me under the conditions you mentioned. It might offer a useful clue if you could pinpoint exactly what the script is doing when the crash occurs. You could just add a bunch of annoying g.note() statements to the script -- e.g.,

  g.note("Got this far -- #1")

Right now we only know that the crash is somewhere between line 107 and line 778 (probably)...
User avatar
dvgrn
Moderator
 
Posts: 4988
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI

Re: A problem with Metafier

Postby Alexey_Nigin » April 29th, 2015, 5:00 pm

Dave Greene wrote:Is there now a "metapixel-OFF.rle" file in your Golly data directory, or no?


No.

Dave Greene wrote:You could just add a bunch of annoying g.note() statements to the script...


It is already midnight in my TZ, so I will probably do it tomorrow.
There are 10 types of people in the world: those who understand binary and those who don't.
User avatar
Alexey_Nigin
 
Posts: 323
Joined: August 4th, 2014, 12:33 pm
Location: Ann Arbor, MI

Re: A problem with Metafier

Postby Alexey_Nigin » April 30th, 2015, 4:45 pm

How to deal with this:

Metafier3.JPG
Metafier3.JPG (46 KiB) Viewed 6489 times
There are 10 types of people in the world: those who understand binary and those who don't.
User avatar
Alexey_Nigin
 
Posts: 323
Joined: August 4th, 2014, 12:33 pm
Location: Ann Arbor, MI

Re: A problem with Metafier

Postby dvgrn » April 30th, 2015, 5:46 pm

Alexey_Nigin wrote:How to deal with this:...

Sorry -- make sure there are four spaces at the beginning of each g.note() line, instead of the two that I quoted.

Just have to line up the text so that it matches the indentation in that part of the Python code.
User avatar
dvgrn
Moderator
 
Posts: 4988
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI

Re: A problem with Metafier

Postby Alexey_Nigin » May 17th, 2015, 3:15 pm

After some skewed binary search I figured out the problematic part of the script:

g.note("Ku!")#####################################################################################
# The metafier-OFF and -ON files technically should not exist (we just checked
#  at the beginning of the script).  Shouldn't do any harm to check again, though:
if os.access(OFFcellFileName, os.W_OK) or not os.access(OFFcellFileName, os.F_OK):
    try:
        OFFcell.save (OFFcellFileName, "Metapixel OFF cell: Brice Due, Spring 2006")
    except:
        # if tile can't be saved, it will be rebuilt next time --
        # no need for an annoying error, just a note in the status bar
        g.show("Failed to save file version of OFF cell: " + OFFcellFileName)
        os.remove (OFFcellFileName)

g.note("Q!")######################################################################################


(For a reason I don't understand, forums sometimes interpret a long line of whitespaces as a line break, so excuse incorrect indentation inside code box).

I do see "Ku!" but do not see "Q!".

In case you were wondering, these two similar words were taken from a particular film.

Edit: This is the exact line where the script breaks:

OFFcell.save (OFFcellFileName, "Metapixel OFF cell: Brice Due, Spring 2006")
There are 10 types of people in the world: those who understand binary and those who don't.
User avatar
Alexey_Nigin
 
Posts: 323
Joined: August 4th, 2014, 12:33 pm
Location: Ann Arbor, MI

Re: A problem with Metafier

Postby dvgrn » May 17th, 2015, 3:50 pm

Alexey_Nigin wrote:Edit: This is the exact line where the script breaks:

OFFcell.save (OFFcellFileName, "Metapixel OFF cell: Brice Due, Spring 2006")

Interesting! I've been able to duplicate the problem now, by tracking down and deleting the ON and OFF metapixels in Golly's data folder. Apparently these were created by a previous version of Golly, and 2.6 is having trouble with some part of the glife library. The same crash now happens on my laptop. Time to report a bug to golly-test -- thanks for doing all the binary-search detective work!

There are a couple of easy workarounds. One is to remove all of the code that you quoted, and a similar set of six lines a little farther down the script -- starting with "if os.access...". Those lines just save a copy of the metapixel ON and OFF cells so that future runs of metafier will run faster. The script works fine when those lines are removed -- you probably won't even notice a difference in the run time.

Alternatively, you could copy the two attached files to Golly's data folder -- C:\Users\{username}\AppData\Roaming\Golly\ on Windows. That also seems to allow the script to work with no problems.

EDIT: Golly 2.7 doesn't seem to crash when it hits that .save line, so maybe that will be the final solution for this bug...!

EDIT2: Oops, no, 64-bit Golly 2.7 still crashes if the two attached files aren't present. Have done some more testing and am pretty confident it will be fixed in Golly 2.8...!
Attachments
metapixel-ON.rle
(157.22 KiB) Downloaded 231 times
metapixel-OFF.rle
(62.32 KiB) Downloaded 214 times
User avatar
dvgrn
Moderator
 
Posts: 4988
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI

Re: A problem with Metafier

Postby SuperJedi224 » July 6th, 2016, 10:15 pm

...any idea when 2.8 is going to come out?
SuperJedi224
 
Posts: 24
Joined: November 25th, 2015, 5:26 pm

Re: A problem with Metafier

Postby dvgrn » July 7th, 2016, 3:42 pm

SuperJedi224 wrote:...any idea when 2.8 is going to come out?

Speaking only for myself: no, no idea, except in the sense that it's already available as a beta. See the golly-test list for the most recent message from Andrew about a final 2.8 release.

It has already been "a good month or two" since that message, of course... We're starting to see more people trying out Lua scripting, and if we wait long enough it's possible that Golly 2.8 will also include native support for isotropic rules.

Meanwhile, starting this weekend I'm hoping to get some momentum back on the Life Lexicon update project, and also check in a number of long-overdue updates to the pattern collection. With any luck it will all come together, sometime before the end of this year!
User avatar
dvgrn
Moderator
 
Posts: 4988
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI


Return to Bugs & Errors

Who is online

Users browsing this forum: No registered users and 1 guest