Skip to content
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

munmap_chunk(): invalid pointer; Aborted (core dumped) - when Label text rendering (sdl2 provider) #6149

Closed
me2beats opened this issue Feb 10, 2019 · 3 comments
Labels

Comments

@me2beats
Copy link

me2beats commented Feb 10, 2019

the error appears when you start the application using this font:
https://www.dafont.com/bleeding-cowboys.font

from kivy.lang import Builder
from kivy.core.text import LabelBase

LabelBase.register(
    name='Bleeding_Cowboys',
    fn_regular='Bleeding_Cowboys.ttf',
    fn_bold='Bleeding_Cowboys.ttf')

KV = """
Label
    font_name: 'Bleeding_Cowboys'

    text: 'AR' # <-- 'munmap_chunk(): invalid pointer; Aborted (core dumped)'

#    text: 'aR' # <-- same error
#    text: 'bR' # <-- same error
#    text: '.R' # <-- same error

#    text: 'R' # <-- this works
#    text: 'Ar' # <-- this works
#    text: 'ar' # <-- this works

"""

class MyApp(App):
    def build(self):
        self.root = Builder.load_string(KV)

MyApp().run()

Result:

  1. sdl2 provider:
munmap_chunk(): invalid pointer
Aborted (core dumped)

  1. pil provider:
    error doesn't appear but the render is incorrect (for example, the letter R is not fully rendered)
@tito
Copy link
Member

tito commented Feb 10, 2019

It might be better that you try opening issue on the underlaying library rather than us no?
Aka either SDL2/pygame, but they all uses freetype. If you find a segfault, nothing we could do here again. Report it to freetype!

@tito tito added wontfix awaiting-reply Waiting for reply from issue opener, will be closed if no reply labels Feb 10, 2019
@me2beats
Copy link
Author

me2beats commented Feb 12, 2019

Ok I'll try to report it to freetype.

some more info:

  1. Pygame has about the same problem with core dumped (I created an issue):
    Some fonts cause 'core dumped' error pygame/pygame#817

  2. this font
    https://www.dafontfree.net/freefonts-bickham-script-alt-one-f115107.htm
    behaves about the same:

from kivy.lang import Builder
from kivy.core.text import LabelBase

font = 'BickhamScriptAltOne.ttf'
LabelBase.register(name=font, fn_regular=font,  fn_bold=font)

KV = """
Label
    font_size: 100
    font_name: 'BickhamScriptAltOne.ttf'

    text: 'rg' #sdl2 = app crash, pil = not fully rendered
#    text: 'r' # ok
#    text: 'g' # ok

"""

class MyApp(App):
    def build(self):
        self.root = Builder.load_string(KV)

MyApp().run()
  • sdl2: core dumped, crash

  • pil: rendered, but not fully displayed

  • Pygame app (not backend): works fine

You may also notice that in pygame this text rendered a little more smoothly then in kivy pil. (?)

Pygame code:

import pygame, sys
from pygame.locals import *

pygame.init()

windowSurface = pygame.display.set_mode((500, 400), 0, 32)
pygame.display.set_caption('Hello world!')

WHITE = (255, 255, 255)

basicFont = pygame.font.Font('BickhamScriptAltOne.ttf', 100)

text = basicFont.render('rg', True, WHITE)
textRect = text.get_rect()
textRect.centerx = windowSurface.get_rect().centerx
textRect.centery = windowSurface.get_rect().centery

windowSurface.blit(text, textRect)

pygame.display.update()

while True:
    for event in pygame.event.get():
        if event.type == QUIT:
            pygame.quit()
            sys.exit()

@no-response no-response bot removed the awaiting-reply Waiting for reply from issue opener, will be closed if no reply label Feb 12, 2019
@tito
Copy link
Member

tito commented Feb 25, 2019

Yep. So i'll close this issue as it's actually not something we can fix in Kivy itself, but require the fix to be done in the upstream libraries.

@tito tito closed this as completed Feb 25, 2019
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