openframeworks / openframeworks/openFrameworks
ofTrueTypeFont(w/ Unicode)'s load() leads to segmentation fault
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 10.4k
- Forks
- 2.6k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 9
Description
My environment: Ubuntu 16.04 x86_64, GCC 6.1.1, running in VirtualBox 5.0.24, openFrameworks@master.
Some simple code like shown below leads to a SIGSEGV:
ofTtfSettings settings("a valid file", 64);
settings.antialiased = true;
settings.addRanges({
ofUnicode::Space,
ofUnicode::Latin1Supplement,
ofUnicode::LatinExtendedAdditional,
ofUnicode::Hiragana,
ofUnicode::Katakana,
ofUnicode::KatakanaPhoneticExtensions,
ofUnicode::CJKLettersAndMonths,
ofUnicode::CJKUnified,
});
font.load(settings);
IMPORTANT NOTICE:
When loading TakaoPGothic.ttf (This file can be obtained by sudo apt-get install fonts-takao-pgothic), this problem occurs. When loading "Arial", this does not occur.
@arturoc - Can you take a look into this? Maybe this is my environment specific issue...
Here's my valgrind output:
(INFO) Loading fonts...
==8509== Invalid write of size 1
==8509== at 0x4C3269F: memcpy@@GLIBC_2.14 (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==8509== by 0x9B1926: ofPixels_<unsigned char>::pasteInto(ofPixels_<unsigned char>&, int, int) const (ofPixels.cpp:1391)
==8509== by 0x9498B1: ofTrueTypeFont::load(ofTtfSettings const&) (ofTrueTypeFont.cpp:932)
==8509== by 0x891062: syn::mode::main::OfMyApp::setup() (of_my_app.cpp:327)
==8509== by 0x892628: ofBaseApp::setup(ofEventArgs&) (ofBaseApp.h:63)
==8509== by 0x8E6C81: std::shared_ptr<of::priv::Function<ofEventArgs, std::recursive_mutex> > ofEvent<ofEventArgs, std::recursive_mutex>::make_function<ofBaseApp>(ofBaseApp*, void (ofBaseApp::*)(ofEventArgs&), int)::{lambda(void const*, ofEventArgs&)#1}::operator()(void const*, ofEventArgs&) const (ofEvent.h:439)
==8509== by 0x8F60C8: std::_Function_handler<bool (void const*, ofEventArgs&), std::shared_ptr<of::priv::Function<ofEventArgs, std::recursive_mutex> > ofEvent<ofEventArgs, std::recursive_mutex>::make_function<ofBaseApp>(ofBaseApp*, void (ofBaseApp::*)(ofEventArgs&), int)::{lambda(void const*, ofEventArgs&)#1}>::_M_invoke(std::_Any_data const&, void const*&&, ofEventArgs&) (functional:1726)
==8509== by 0xA0D77E: std::function<bool (void const*, ofEventArgs&)>::operator()(void const*, ofEventArgs&) const (functional:2136)
==8509== by 0xA0BFAD: of::priv::Function<ofEventArgs, std::recursive_mutex>::notify(void const*, ofEventArgs&) (ofEvent.h:90)
==8509== by 0xA0AB01: ofEvent<ofEventArgs, std::recursive_mutex>::notify(ofEventArgs&) (ofEvent.h:538)
==8509== by 0xA0A225: bool ofNotifyEvent<ofEvent<ofEventArgs, std::recursive_mutex>, ofEventArgs>(ofEvent<ofEventArgs, std::recursive_mutex>&, ofEventArgs&) (ofEventUtils.h:214)
==8509== by 0xA08430: ofCoreEvents::notifySetup() (ofEvents.cpp:249)
==8509== Address 0x1886a122 is 5,138 bytes inside a block of size 5,727 free'd
==8509== at 0x4C2F74B: operator delete[](void*) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==8509== by 0x9AF1FE: ofPixels_<unsigned char>::clear() (ofPixels.cpp:522)
==8509== by 0x9AEF67: ofPixels_<unsigned char>::~ofPixels_() (ofPixels.cpp:190)
==8509== by 0x9480E6: ofTrueTypeFont::loadGlyph(unsigned int) const (ofTrueTypeFont.cpp:730)
==8509== by 0x948B69: ofTrueTypeFont::load(ofTtfSettings const&) (ofTrueTypeFont.cpp:833)
==8509== by 0x891062: syn::mode::main::OfMyApp::setup() (of_my_app.cpp:327)
==8509== by 0x892628: ofBaseApp::setup(ofEventArgs&) (ofBaseApp.h:63)
==8509== by 0x8E6C81: std::shared_ptr<of::priv::Function<ofEventArgs, std::recursive_mutex> > ofEvent<ofEventArgs, std::recursive_mutex>::make_function<ofBaseApp>(ofBaseApp*, void (ofBaseApp::*)(ofEventArgs&), int)::{lambda(void const*, ofEventArgs&)#1}::operator()(void const*, ofEventArgs&) const (ofEvent.h:439)
==8509== by 0x8F60C8: std::_Function_handler<bool (void const*, ofEventArgs&), std::shared_ptr<of::priv::Function<ofEventArgs, std::recursive_mutex> > ofEvent<ofEventArgs, std::recursive_mutex>::make_function<ofBaseApp>(ofBaseApp*, void (ofBaseApp::*)(ofEventArgs&), int)::{lambda(void const*, ofEventArgs&)#1}>::_M_invoke(std::_Any_data const&, void const*&&, ofEventArgs&) (functional:1726)
==8509== by 0xA0D77E: std::function<bool (void const*, ofEventArgs&)>::operator()(void const*, ofEventArgs&) const (functional:2136)
==8509== by 0xA0BFAD: of::priv::Function<ofEventArgs, std::recursive_mutex>::notify(void const*, ofEventArgs&) (ofEvent.h:90)
==8509== by 0xA0AB01: ofEvent<ofEventArgs, std::recursive_mutex>::notify(ofEventArgs&) (ofEvent.h:538)
==8509== Block was alloc'd at
==8509== at 0x4C2E80F: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==8509== by 0x9AF157: ofPixels_<unsigned char>::allocate(int, int, ofPixelFormat) (ofPixels.cpp:475)
==8509== by 0x9B4AE6: ofPixels_<unsigned char>::copyFrom(ofPixels_<unsigned char> const&) (ofPixels.cpp:252)
==8509== by 0x9AEFD5: ofPixels_<unsigned char>::ofPixels_(ofPixels_<unsigned char> const&) (ofPixels.cpp:195)
==8509== by 0x9480B5: ofTrueTypeFont::loadGlyph(unsigned int) const (ofTrueTypeFont.cpp:730)
==8509== by 0x948B69: ofTrueTypeFont::load(ofTtfSettings const&) (ofTrueTypeFont.cpp:833)
==8509== by 0x891062: syn::mode::main::OfMyApp::setup() (of_my_app.cpp:327)
==8509== by 0x892628: ofBaseApp::setup(ofEventArgs&) (ofBaseApp.h:63)
==8509== by 0x8E6C81: std::shared_ptr<of::priv::Function<ofEventArgs, std::recursive_mutex> > ofEvent<ofEventArgs, std::recursive_mutex>::make_function<ofBaseApp>(ofBaseApp*, void (ofBaseApp::*)(ofEventArgs&), int)::{lambda(void const*, ofEventArgs&)#1}::operator()(void const*, ofEventArgs&) const (ofEvent.h:439)
==8509== by 0x8F60C8: std::_Function_handler<bool (void const*, ofEventArgs&), std::shared_ptr<of::priv::Function<ofEventArgs, std::recursive_mutex> > ofEvent<ofEventArgs, std::recursive_mutex>::make_function<ofBaseApp>(ofBaseApp*, void (ofBaseApp::*)(ofEventArgs&), int)::{lambda(void const*, ofEventArgs&)#1}>::_M_invoke(std::_Any_data const&, void const*&&, ofEventArgs&) (functional:1726)
==8509== by 0xA0D77E: std::function<bool (void const*, ofEventArgs&)>::operator()(void const*, ofEventArgs&) const (functional:2136)
==8509== by 0xA0BFAD: of::priv::Function<ofEventArgs, std::recursive_mutex>::notify(void const*, ofEventArgs&) (ofEvent.h:90)
==8509==
==8509== Invalid write of size 8
==8509== at 0x4C326CB: memcpy@@GLIBC_2.14 (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==8509== by 0x9B1926: ofPixels_<unsigned char>::pasteInto(ofPixels_<unsigned char>&, int, int) const (ofPixels.cpp:1391)
==8509== by 0x9498B1: ofTrueTypeFont::load(ofTtfSettings const&) (ofTrueTypeFont.cpp:932)
==8509== by 0x891062: syn::mode::main::OfMyApp::setup() (of_my_app.cpp:327)
==8509== by 0x892628: ofBaseApp::setup(ofEventArgs&) (ofBaseApp.h:63)
==8509== by 0x8E6C81: std::shared_ptr<of::priv::Function<ofEventArgs, std::recursive_mutex> > ofEvent<ofEventArgs, std::recursive_mutex>::make_function<ofBaseApp>(ofBaseApp*, void (ofBaseApp::*)(ofEventArgs&), int)::{lambda(void const*, ofEventArgs&)#1}::operator()(void const*, ofEventArgs&) const (ofEvent.h:439)
==8509== by 0x8F60C8: std::_Function_handler<bool (void const*, ofEventArgs&), std::shared_ptr<of::priv::Function<ofEventArgs, std::recursive_mutex> > ofEvent<ofEventArgs, std::recursive_mutex>::make_function<ofBaseApp>(ofBaseApp*, void (ofBaseApp::*)(ofEventArgs&), int)::{lambda(void const*, ofEventArgs&)#1}>::_M_invoke(std::_Any_data const&, void const*&&, ofEventArgs&) (functional:1726)
==8509== by 0xA0D77E: std::function<bool (void const*, ofEventArgs&)>::operator()(void const*, ofEventArgs&) const (functional:2136)
==8509== by 0xA0BFAD: of::priv::Function<ofEventArgs, std::recursive_mutex>::notify(void const*, ofEventArgs&) (ofEvent.h:90)
==8509== by 0xA0AB01: ofEvent<ofEventArgs, std::recursive_mutex>::notify(ofEventArgs&) (ofEvent.h:538)
==8509== by 0xA0A225: bool ofNotifyEvent<ofEvent<ofEventArgs, std::recursive_mutex>, ofEventArgs>(ofEvent<ofEventArgs, std::recursive_mutex>&, ofEventArgs&) (ofEventUtils.h:214)
==8509== by 0xA08430: ofCoreEvents::notifySetup() (ofEvents.cpp:249)
==8509== Address 0x1886a128 is 5,144 bytes inside a block of size 5,727 free'd
==8509== at 0x4C2F74B: operator delete[](void*) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==8509== by 0x9AF1FE: ofPixels_<unsigned char>::clear() (ofPixels.cpp:522)
==8509== by 0x9AEF67: ofPixels_<unsigned char>::~ofPixels_() (ofPixels.cpp:190)
==8509== by 0x9480E6: ofTrueTypeFont::loadGlyph(unsigned int) const (ofTrueTypeFont.cpp:730)
==8509== by 0x948B69: ofTrueTypeFont::load(ofTtfSettings const&) (ofTrueTypeFont.cpp:833)
==8509== by 0x891062: syn::mode::main::OfMyApp::setup() (of_my_app.cpp:327)
==8509== by 0x892628: ofBaseApp::setup(ofEventArgs&) (ofBaseApp.h:63)
==8509== by 0x8E6C81: std::shared_ptr<of::priv::Function<ofEventArgs, std::recursive_mutex> > ofEvent<ofEventArgs, std::recursive_mutex>::make_function<ofBaseApp>(ofBaseApp*, void (ofBaseApp::*)(ofEventArgs&), int)::{lambda(void const*, ofEventArgs&)#1}::operator()(void const*, ofEventArgs&) const (ofEvent.h:439)
==8509== by 0x8F60C8: std::_Function_handler<bool (void const*, ofEventArgs&), std::shared_ptr<of::priv::Function<ofEventArgs, std::recursive_mutex> > ofEvent<ofEventArgs, std::recursive_mutex>::make_function<ofBaseApp>(ofBaseApp*, void (ofBaseApp::*)(ofEventArgs&), int)::{lambda(void const*, ofEventArgs&)#1}>::_M_invoke(std::_Any_data const&, void const*&&, ofEventArgs&) (functional:1726)
==8509== by 0xA0D77E: std::function<bool (void const*, ofEventArgs&)>::operator()(void const*, ofEventArgs&) const (functional:2136)
==8509== by 0xA0BFAD: of::priv::Function<ofEventArgs, std::recursive_mutex>::notify(void const*, ofEventArgs&) (ofEvent.h:90)
==8509== by 0xA0AB01: ofEvent<ofEventArgs, std::recursive_mutex>::notify(ofEventArgs&) (ofEvent.h:538)
==8509== Block was alloc'd at
==8509== at 0x4C2E80F: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==8509== by 0x9AF157: ofPixels_<unsigned char>::allocate(int, int, ofPixelFormat) (ofPixels.cpp:475)
==8509== by 0x9B4AE6: ofPixels_<unsigned char>::copyFrom(ofPixels_<unsigned char> const&) (ofPixels.cpp:252)
==8509== by 0x9AEFD5: ofPixels_<unsigned char>::ofPixels_(ofPixels_<unsigned char> const&) (ofPixels.cpp:195)
==8509== by 0x9480B5: ofTrueTypeFont::loadGlyph(unsigned int) const (ofTrueTypeFont.cpp:730)
==8509== by 0x948B69: ofTrueTypeFont::load(ofTtfSettings const&) (ofTrueTypeFont.cpp:833)
==8509== by 0x891062: syn::mode::main::OfMyApp::setup() (of_my_app.cpp:327)
==8509== by 0x892628: ofBaseApp::setup(ofEventArgs&) (ofBaseApp.h:63)
==8509== by 0x8E6C81: std::shared_ptr<of::priv::Function<ofEventArgs, std::recursive_mutex> > ofEvent<ofEventArgs, std::recursive_mutex>::make_function<ofBaseApp>(ofBaseApp*, void (ofBaseApp::*)(ofEventArgs&), int)::{lambda(void const*, ofEventArgs&)#1}::operator()(void const*, ofEventArgs&) const (ofEvent.h:439)
==8509== by 0x8F60C8: std::_Function_handler<bool (void const*, ofEventArgs&), std::shared_ptr<of::priv::Function<ofEventArgs, std::recursive_mutex> > ofEvent<ofEventArgs, std::recursive_mutex>::make_function<ofBaseApp>(ofBaseApp*, void (ofBaseApp::*)(ofEventArgs&), int)::{lambda(void const*, ofEventArgs&)#1}>::_M_invoke(std::_Any_data const&, void const*&&, ofEventArgs&) (functional:1726)
==8509== by 0xA0D77E: std::function<bool (void const*, ofEventArgs&)>::operator()(void const*, ofEventArgs&) const (functional:2136)
==8509== by 0xA0BFAD: of::priv::Function<ofEventArgs, std::recursive_mutex>::notify(void const*, ofEventArgs&) (ofEvent.h:90)
==8509==
==8509== Invalid write of size 2
==8509== at 0x4C32723: memcpy@@GLIBC_2.14 (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==8509== by 0x9B1926: ofPixels_<unsigned char>::pasteInto(ofPixels_<unsigned char>&, int, int) const (ofPixels.cpp:1391)
==8509== by 0x9498B1: ofTrueTypeFont::load(ofTtfSettings const&) (ofTrueTypeFont.cpp:932)
==8509== by 0x891062: syn::mode::main::OfMyApp::setup() (of_my_app.cpp:327)
==8509== by 0x892628: ofBaseApp::setup(ofEventArgs&) (ofBaseApp.h:63)
==8509== by 0x8E6C81: std::shared_ptr<of::priv::Function<ofEventArgs, std::recursive_mutex> > ofEvent<ofEventArgs, std::recursive_mutex>::make_function<ofBaseApp>(ofBaseApp*, void (ofBaseApp::*)(ofEventArgs&), int)::{lambda(void const*, ofEventArgs&)#1}::operator()(void const*, ofEventArgs&) const (ofEvent.h:439)
==8509== by 0x8F60C8: std::_Function_handler<bool (void const*, ofEventArgs&), std::shared_ptr<of::priv::Function<ofEventArgs, std::recursive_mutex> > ofEvent<ofEventArgs, std::recursive_mutex>::make_function<ofBaseApp>(ofBaseApp*, void (ofBaseApp::*)(ofEventArgs&), int)::{lambda(void const*, ofEventArgs&)#1}>::_M_invoke(std::_Any_data const&, void const*&&, ofEventArgs&) (functional:1726)
==8509== by 0xA0D77E: std::function<bool (void const*, ofEventArgs&)>::operator()(void const*, ofEventArgs&) const (functional:2136)
==8509== by 0xA0BFAD: of::priv::Function<ofEventArgs, std::recursive_mutex>::notify(void const*, ofEventArgs&) (ofEvent.h:90)
==8509== by 0xA0AB01: ofEvent<ofEventArgs, std::recursive_mutex>::notify(ofEventArgs&) (ofEvent.h:538)
==8509== by 0xA0A225: bool ofNotifyEvent<ofEvent<ofEventArgs, std::recursive_mutex>, ofEventArgs>(ofEvent<ofEventArgs, std::recursive_mutex>&, ofEventArgs&) (ofEventUtils.h:214)
==8509== by 0xA08430: ofCoreEvents::notifySetup() (ofEvents.cpp:249)
==8509== Address 0x1886a1a8 is 5,272 bytes inside a block of size 5,727 free'd
==8509== at 0x4C2F74B: operator delete[](void*) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==8509== by 0x9AF1FE: ofPixels_<unsigned char>::clear() (ofPixels.cpp:522)
==8509== by 0x9AEF67: ofPixels_<unsigned char>::~ofPixels_() (ofPixels.cpp:190)
==8509== by 0x9480E6: ofTrueTypeFont::loadGlyph(unsigned int) const (ofTrueTypeFont.cpp:730)
==8509== by 0x948B69: ofTrueTypeFont::load(ofTtfSettings const&) (ofTrueTypeFont.cpp:833)
==8509== by 0x891062: syn::mode::main::OfMyApp::setup() (of_my_app.cpp:327)
==8509== by 0x892628: ofBaseApp::setup(ofEventArgs&) (ofBaseApp.h:63)
==8509== by 0x8E6C81: std::shared_ptr<of::priv::Function<ofEventArgs, std::recursive_mutex> > ofEvent<ofEventArgs, std::recursive_mutex>::make_function<ofBaseApp>(ofBaseApp*, void (ofBaseApp::*)(ofEventArgs&), int)::{lambda(void const*, ofEventArgs&)#1}::operator()(void const*, ofEventArgs&) const (ofEvent.h:439)
==8509== by 0x8F60C8: std::_Function_handler<bool (void const*, ofEventArgs&), std::shared_ptr<of::priv::Function<ofEventArgs, std::recursive_mutex> > ofEvent<ofEventArgs, std::recursive_mutex>::make_function<ofBaseApp>(ofBaseApp*, void (ofBaseApp::*)(ofEventArgs&), int)::{lambda(void const*, ofEventArgs&)#1}>::_M_invoke(std::_Any_data const&, void const*&&, ofEventArgs&) (functional:1726)
==8509== by 0xA0D77E: std::function<bool (void const*, ofEventArgs&)>::operator()(void const*, ofEventArgs&) const (functional:2136)
==8509== by 0xA0BFAD: of::priv::Function<ofEventArgs, std::recursive_mutex>::notify(void const*, ofEventArgs&) (ofEvent.h:90)
==8509== by 0xA0AB01: ofEvent<ofEventArgs, std::recursive_mutex>::notify(ofEventArgs&) (ofEvent.h:538)
==8509== Block was alloc'd at
==8509== at 0x4C2E80F: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==8509== by 0x9AF157: ofPixels_<unsigned char>::allocate(int, int, ofPixelFormat) (ofPixels.cpp:475)
==8509== by 0x9B4AE6: ofPixels_<unsigned char>::copyFrom(ofPixels_<unsigned char> const&) (ofPixels.cpp:252)
==8509== by 0x9AEFD5: ofPixels_<unsigned char>::ofPixels_(ofPixels_<unsigned char> const&) (ofPixels.cpp:195)
==8509== by 0x9480B5: ofTrueTypeFont::loadGlyph(unsigned int) const (ofTrueTypeFont.cpp:730)
==8509== by 0x948B69: ofTrueTypeFont::load(ofTtfSettings const&) (ofTrueTypeFont.cpp:833)
==8509== by 0x891062: syn::mode::main::OfMyApp::setup() (of_my_app.cpp:327)
==8509== by 0x892628: ofBaseApp::setup(ofEventArgs&) (ofBaseApp.h:63)
==8509== by 0x8E6C81: std::shared_ptr<of::priv::Function<ofEventArgs, std::recursive_mutex> > ofEvent<ofEventArgs, std::recursive_mutex>::make_function<ofBaseApp>(ofBaseApp*, void (ofBaseApp::*)(ofEventArgs&), int)::{lambda(void const*, ofEventArgs&)#1}::operator()(void const*, ofEventArgs&) const (ofEvent.h:439)
==8509== by 0x8F60C8: std::_Function_handler<bool (void const*, ofEventArgs&), std::shared_ptr<of::priv::Function<ofEventArgs, std::recursive_mutex> > ofEvent<ofEventArgs, std::recursive_mutex>::make_function<ofBaseApp>(ofBaseApp*, void (ofBaseApp::*)(ofEventArgs&), int)::{lambda(void const*, ofEventArgs&)#1}>::_M_invoke(std::_Any_data const&, void const*&&, ofEventArgs&) (functional:1726)
==8509== by 0xA0D77E: std::function<bool (void const*, ofEventArgs&)>::operator()(void const*, ofEventArgs&) const (functional:2136)
==8509== by 0xA0BFAD: of::priv::Function<ofEventArgs, std::recursive_mutex>::notify(void const*, ofEventArgs&) (ofEvent.h:90)
==8509==
==8509==
==8509== Process terminating with default action of signal 11 (SIGSEGV)
==8509== Bad permissions for mapped region at address 0x18C02122
==8509== at 0x4C32723: memcpy@@GLIBC_2.14 (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==8509== by 0x9B1926: ofPixels_<unsigned char>::pasteInto(ofPixels_<unsigned char>&, int, int) const (ofPixels.cpp:1391)
==8509== by 0x9498B1: ofTrueTypeFont::load(ofTtfSettings const&) (ofTrueTypeFont.cpp:932)
==8509== by 0x891062: syn::mode::main::OfMyApp::setup() (of_my_app.cpp:327)
==8509== by 0x892628: ofBaseApp::setup(ofEventArgs&) (ofBaseApp.h:63)
==8509== by 0x8E6C81: std::shared_ptr<of::priv::Function<ofEventArgs, std::recursive_mutex> > ofEvent<ofEventArgs, std::recursive_mutex>::make_function<ofBaseApp>(ofBaseApp*, void (ofBaseApp::*)(ofEventArgs&), int)::{lambda(void const*, ofEventArgs&)#1}::operator()(void const*, ofEventArgs&) const (ofEvent.h:439)
==8509== by 0x8F60C8: std::_Function_handler<bool (void const*, ofEventArgs&), std::shared_ptr<of::priv::Function<ofEventArgs, std::recursive_mutex> > ofEvent<ofEventArgs, std::recursive_mutex>::make_function<ofBaseApp>(ofBaseApp*, void (ofBaseApp::*)(ofEventArgs&), int)::{lambda(void const*, ofEventArgs&)#1}>::_M_invoke(std::_Any_data const&, void const*&&, ofEventArgs&) (functional:1726)
==8509== by 0xA0D77E: std::function<bool (void const*, ofEventArgs&)>::operator()(void const*, ofEventArgs&) const (functional:2136)
==8509== by 0xA0BFAD: of::priv::Function<ofEventArgs, std::recursive_mutex>::notify(void const*, ofEventArgs&) (ofEvent.h:90)
==8509== by 0xA0AB01: ofEvent<ofEventArgs, std::recursive_mutex>::notify(ofEventArgs&) (ofEvent.h:538)
==8509== by 0xA0A225: bool ofNotifyEvent<ofEvent<ofEventArgs, std::recursive_mutex>, ofEventArgs>(ofEvent<ofEventArgs, std::recursive_mutex>&, ofEventArgs&) (ofEventUtils.h:214)
==8509== by 0xA08430: ofCoreEvents::notifySetup() (ofEvents.cpp:249)
==8509== Thread 2 Sync:
==8509== Invalid read of size 8
==8509== at 0xA685584: free_mem (in /lib/x86_64-linux-gnu/libc-2.23.so)
==8509== by 0xA684BAF: __libc_freeres (in /lib/x86_64-linux-gnu/libc-2.23.so)
==8509== by 0x4A2868C: _vgnU_freeres (in /usr/lib/valgrind/vgpreload_core-amd64-linux.so)
==8509== Address 0xff00ff00ff0107 is not stack'd, malloc'd or (recently) free'd
==8509==
==8509==
==8509== Process terminating with default action of signal 11 (SIGSEGV)
==8509== General Protection Fault
==8509== at 0xA685584: free_mem (in /lib/x86_64-linux-gnu/libc-2.23.so)
==8509== by 0xA684BAF: __libc_freeres (in /lib/x86_64-linux-gnu/libc-2.23.so)
==8509== by 0x4A2868C: _vgnU_freeres (in /usr/lib/valgrind/vgpreload_core-amd64-linux.so)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the crash with TakaoPGothic.ttf and the listed Unicode ranges, then inspect ofTrueTypeFont.cpp around load() and loadGlyph(), together with ofPixels.cpp around pasteInto(). Use the provided Valgrind trace to investigate the invalid writes and freed memory; done means the reproduction no longer segfaults or reports those invalid writes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100