Skip to content

displayio: inner Group gets smashed #1695

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

Closed
dhalbert opened this issue Mar 25, 2019 · 1 comment
Closed

displayio: inner Group gets smashed #1695

dhalbert opened this issue Mar 25, 2019 · 1 comment
Assignees
Labels

Comments

@dhalbert
Copy link
Collaborator

On latest master:

The testg.py file below produces this output, showing that the inner_group[0] has been smashed in some way:

>>> import testg
type(innergroup[0]) <class 'TileGrid'>
type(innergroup[0]) <function>

Minimal example, file testg.py:

import displayio
import board
import time

# max sizes of 4 do not produce error, but 15 and 10 do, as well as 16 and 16.
#
group = displayio.Group(max_size=16)
inner_group = displayio.Group(max_size=1)
od_bitmap = displayio.OnDiskBitmap(open("countdown_background.bmp", "rb"))
tg = displayio.TileGrid(od_bitmap,
                        pixel_shader=displayio.ColorConverter())
inner_group.append(tg)
group.append(inner_group)
#board.DISPLAY.show(inner_group) also causes bug
board.DISPLAY.show(group)
print("type(innergroup[0])", type(inner_group[0]))
time.sleep(1)
print("type(innergroup[0])", type(inner_group[0]))

The max_size values seem to be critical in some way to produce this output, though I've seen other erroneous output with other values, e.g.:

type(innergroup[0]) <class 'TileGrid'>
 <class 'TileGrid'>

Note that the first string in the second print() statement has disappeared. I can't remember which max_size values caused this, but something is getting smashed somewhere, and it manifests in different ways.

The nested group is also important. I tried with a single group, and couldn't cause the error (but, again, maybe something else is being smashed elsewhere.

This example was pruned down from EventCountdown and PyPortal, and is the essence of the underlying bug in #1680 that causes the background to disappear. I had inserted some debugging print statements while debugging #1680 code, and was getting hard faults when trying to print the smashed TileGrid object, so that's why I'm printing the type(), not the object itself.

@ATMakersBill
Copy link
Collaborator

@dhalbert I may be hitting the same issue on a PyPortal with latest everything (yesterday's bundle and 4.0 beta5)
Adafruit CircuitPython 4.0.0-beta.5 on 2019-03-17; Adafruit PyPortal with samd51j20

I just thought I'd add a comment that I had seen none of this instability until I started reading the image and sound files from the SD card. The card's not corrupted and works fine in my laptop, but I was just wondering if the SPI bus might be an area to look? When these files were in the CIRCUITPY drive (Flash), I was not getting the screen blanking nor the safe mode crashes.

FWIW here's my venting from Discord as this got worse:

ATMakersBill: Bummer! Just got this on yesterday's build:
You are running in safe mode which means something unanticipated happened.
Looks like our core CircuitPython code crashed hard. Whoops!
Please file an issue at https://github.com/adafruit/circuitpython/issues
with the contents of your CIRCUITPY drive and this message:
Crash into the HardFault_Handler.
[12:44 AM] ATMakersBill: Gonna wait to see if it happens again
[12:48 AM] ATMakersBill: I think I'm officially unstable.repeated plays of .WAV files from the SD card causes out obnoxious noises and hard crash
[1:05 AM] ATMakersBill: Ok, with no user code running, and nothing being written by the PyPortal on debug, I get a hard crash consistently at 76 seconds
[1:07 AM] ATMakersBill: 76 seconds after plugging in the USB cord
[1:08 AM] ATMakersBill: Adafruit CircuitPython 2c9fbb5 on 2019-02-24; Adafruit PyPortal with samd51j20
[1:11 AM] ATMakersBill: Just updated to Adafruit CircuitPython 4.0.0-beta.5 on 2019-03-17; Adafruit PyPortal with samd51j20
We will see
[1:14 AM] ATMakersBill: Ok, with the new (beta5) build, it does not go to safe mode... however, it does blank the screen after the same time.... is this a new watchdog call that sleeps the screen? What do I have to do to wake it?
[1:14 AM] ATMakersBill: The touch screen still works
[1:24 AM] ATMakersBill: And now the filesystem is corrupted.
[1:24 AM] ATMakersBill: I'm done for the night.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants