Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Using valgrind: Invalid read of size 1

262 views
Skip to first unread message

tombert

unread,
Jun 13, 2017, 3:00:57 PM6/13/17
to
While trying to tackle some SIGSEGV I am experimenting with valgrind and immediately get an error on startup. Could this be a false positive or something of concern?

thx


==19569== Invalid read of size 1
==19569== at 0x4C2F1B4: strcmp (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==19569== by 0x911E4C6: _XimUnRegisterIMInstantiateCallback (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==19569== by 0x9105F10: XUnregisterIMInstantiateCallback (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==19569== by 0x89FDD19: InstantiateIMCallback (tkUnixEvent.c:681)
==19569== by 0x911E3B4: _XimRegisterIMInstantiateCallback (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==19569== by 0x9105EA9: XRegisterIMInstantiateCallback (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==19569== by 0x89FD3EB: TkpOpenDisplay (tkUnixEvent.c:184)
==19569== by 0x892CC3E: GetScreen (tkWindow.c:463)
==19569== by 0x892C9FF: CreateTopLevelWindow (tkWindow.c:346)
==19569== by 0x892D70E: TkCreateMainWindow (tkWindow.c:852)
==19569== by 0x893CB16: CreateFrame (tkFrame.c:582)
==19569== by 0x893C63C: TkListCreateFrame (tkFrame.c:468)
==19569== Address 0x619d8e0 is 0 bytes inside a block of size 9 free'd
==19569== at 0x4C2BDEC: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==19569== by 0x9114E0F: XSetLocaleModifiers (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==19569== by 0x89FDDAB: OpenIM (tkUnixEvent.c:725)
==19569== by 0x89FDCED: InstantiateIMCallback (tkUnixEvent.c:680)
==19569== by 0x911E3B4: _XimRegisterIMInstantiateCallback (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==19569== by 0x9105EA9: XRegisterIMInstantiateCallback (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==19569== by 0x89FD3EB: TkpOpenDisplay (tkUnixEvent.c:184)
==19569== by 0x892CC3E: GetScreen (tkWindow.c:463)
==19569== by 0x892C9FF: CreateTopLevelWindow (tkWindow.c:346)
==19569== by 0x892D70E: TkCreateMainWindow (tkWindow.c:852)
==19569== by 0x893CB16: CreateFrame (tkFrame.c:582)
==19569== by 0x893C63C: TkListCreateFrame (tkFrame.c:468)

tombert

unread,
Jun 13, 2017, 3:09:20 PM6/13/17
to

Christian Gollwitzer

unread,
Jun 13, 2017, 4:58:08 PM6/13/17
to
Am 13.06.17 um 21:09 schrieb tombert:
Reading your ticket description, it also seems that this is a
multithreading issue. Valgrind has a special tool for that called
"helgrind" which detects problems with concurrent memory access.

Christian

tombert

unread,
Jun 14, 2017, 6:46:22 PM6/14/17
to
Yes this is a multi-threading issue. But I am doing [package re Tk] only in the main thread.
I tried another approach by connecting tkcon via remote sockets, so not to have tk in any thread and it seems I am not able to reproduce any crash above at all. So I wonder if [package re Tk] also does something in the queue of the other threads, even if there is no Tk.

The script I posted that crashes Tk in an multi-threaded environment is fairly simple and seems to have something to do with message queuing. My concern is that I won't be able to fix/find other bugs until this one is closed. Unfort. this bug is unassigned since two weeks - even though it's a SIGSEGV.

Thx for the helgrind tip - I tried and found something interesting I posted here:
https://core.tcl.tk/thread/tktview/44499074cb431338a001c9d381913ffca29961d3


Thomas
0 new messages