Poikilos / pypicolcd

Draw to picoLCD 256x64 and 20x4 over IP using only pyusb (No driver is required)!
GNU General Public License v3.0
1 stars 0 forks source link

draw_text intermittently uses invalid pointer #1

Open Poikilos opened 4 years ago

Poikilos commented 4 years ago
(lcd) [root@pentdestrian owner]# lcd-cli --clear hello 
* showing 'hello'...
(lcd) [root@pentdestrian owner]# lcd-cli --clear hello world
* showing 'hello'...
munmap_chunk(): invalid pointer
Aborted (core dumped)
(lcd) [root@pentdestrian owner]# lcd-cli --clear hello 1
* showing 'hello'...
munmap_chunk(): invalid pointer
Aborted (core dumped)
(lcd) [root@pentdestrian owner]# lcd-cli --clear hello 2345
* showing 'hello'...
munmap_chunk(): invalid pointer
Aborted (core dumped)
(lcd) [root@pentdestrian owner]# lcd-cli --clear hello 2 3 4
* showing 'hello'...
* showing '2'...
* showing '3'...
* showing '4'...
(lcd) [root@pentdestrian owner]# lcd-cli --clear hello 2 3 4 5 6 7 8 9 10 11 12
* showing 'hello'...
* showing '2'...
* showing '3'...
* showing '4'...
* showing '5'...
* showing '6'...
* showing '7'...
* showing '8'...
* showing '9'...
[ PicoLCD ] WARNING in draw_text: offscreen buffer had 0 text pixels
* showing '10'...
[ PicoLCD ] WARNING in draw_text: offscreen buffer had 0 text pixels
Poikilos commented 4 years ago

This is still happening intermittently. You can sometimes prevent it by physically disconnecting and reconnecting the LCD, which resets some buffers (the only reason that solves the issue seems to be changing the conditions under which Pillow operates, such as clearing the Image etc which causes pypicolcd to draw things differently [avoid optimizations regarding pixels that are already on; and possibly other differences]). See https://github.com/python-pillow/Pillow/issues/4225

radarhere commented 3 years ago

A proposed fix for the Pillow issue has been merged and released as part of Pillow 8.2.0.

Poikilos commented 3 years ago

Thanks!