Invalid read of size 1

21 views
Skip to first unread message

holm.h...@gmail.com

unread,
Apr 20, 2017, 12:21:46 PM4/20/17
to fltk.general

Hi,

I try to check my program using valgrind. I got error/warning regarding initialization of the fonts.

I do the same check on the the 'utf8' demo-program in the test-directory :

fltk-1.3.3/test $ valgrind ./utf8
==17155== Memcheck, a memory error detector
==17155== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==17155== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==17155== Command: ./utf8
==17155==
==17155== Invalid read of size 1
==17155==    at 0x425433: put_font_size(char const*, int) (in /home/hholm/src/fltk-1.3.3/test/utf8)
==17155==    by 0x41AAF4: fl_new_ic() (in /home/hholm/src/fltk-1.3.3/test/utf8)
==17155==    by 0x41AE7E: fl_init_xim() (in /home/hholm/src/fltk-1.3.3/test/utf8)
==17155==    by 0x41BD95: fl_open_display(_XDisplay*) (in /home/hholm/src/fltk-1.3.3/test/utf8)
==17155==    by 0x42B064: Fl::set_fonts(char const*) (in /home/hholm/src/fltk-1.3.3/test/utf8)
==17155==    by 0x4062BF: make_font_chooser() (in /home/hholm/src/fltk-1.3.3/test/utf8)
==17155==    by 0x404B54: main (in /home/hholm/src/fltk-1.3.3/test/utf8)
==17155==  Address 0xffeffe568 is on thread 1's stack
==17155==  1096 bytes below stack pointer
==17155==
............. more of the same errors/warnings..?

I do not like these warnings. Is this something to worry about ?
The program runs fine, but valgrind indicate that there may be an issue..

Best regards
Håvard

Albrecht Schlosser

unread,
Apr 20, 2017, 2:16:44 PM4/20/17
to fltkg...@googlegroups.com
This sounds very much like an already resolved issue, but I don't
remember the details. Your log seems to indicate that you're using FLTK
1.3.3 which is really old. Please try 1.3.4 and report if you find the
same or similar valgrind warnings.

FWIW, I tried test/utf8 with FLTK 1.3.4 and didn't get the warnings
reported by you. I got two warnings, but these warnings are not
repeated, and they seem to be caused deeply in X11 functions which we
likely can't "fix".

Here's an excerpt of my log (sorry if it gets wrapped):

==23962== Syscall param writev(vector[...]) points to uninitialised byte(s)
==23962== at 0x71DB3F0: __writev_nocancel (syscall-template.S:84)
==23962== by 0x76B6F28: ??? (in
/usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0)
==23962== by 0x76B731C: ??? (in
/usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0)
==23962== by 0x76B73A4: xcb_writev (in
/usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0)
==23962== by 0x56BA4AD: _XSend (in
/usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==23962== by 0x56BA7F4: _XFlush (in
/usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==23962== by 0x569BE49: XFlush (in
/usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==23962== by 0x4245F5: Fl::flush() (Fl.cxx:794)
==23962== by 0x424398: Fl::wait(double) (Fl.cxx:604)
==23962== by 0x424629: Fl::run() (Fl.cxx:622)
==23962== by 0x42248D: main (utf8.cxx:708)
==23962== Address 0x8630701 is 16,257 bytes inside a block of size
16,384 alloc'd
==23962== at 0x4C2FB55: calloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==23962== by 0x56AA692: XOpenDisplay (in
/usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==23962== by 0x455AE2: fl_open_display() (Fl_x.cxx:679)
==23962== by 0x473278: Fl::set_fonts(char const*)
(fl_set_fonts_xft.cxx:220)
==23962== by 0x42063B: make_font_chooser() (utf8.cxx:429)
==23962== by 0x421A3A: main (utf8.cxx:578)
==23962==


holm.h...@gmail.com

unread,
Apr 23, 2017, 7:44:06 AM4/23/17
to fltk.general, Albrech...@online.de
Thank you,

1.3.4 works fine and without these warnings.

Best regards
Håvard

Albrecht Schlosser

unread,
Apr 23, 2017, 8:44:23 AM4/23/17
to fltkg...@googlegroups.com
On 23.04.2017 13:44 holm.h...@gmail.com wrote:
>
> 1.3.4 works fine and without these warnings.

I'm glad it works for you, so the bug was obviously fixed.

Thanks for confirmation!

Reply all
Reply to author
Forward
0 new messages