On Sat, Sep 13, 2014 at 01:00:58PM +0100, Dominik Vogt wrote:
> On Sat, Sep 13, 2014 at 11:44:30AM +0100, Thomas Adam wrote:
> > I'm showing the fact that this NearestNeigbour function is run from
> > MvwmEvent usually, although enabling that by default causes the segfault
> > to happen more quickly so I've disabled that.
> >
>
> Do you have a reliable way to trigger this? I don't know what to do.
Shove the config snippet either into MvwmConsole or as a config file in
its own right to get mvwm to read it, and then in MvwmcCosnole, keep
entering:
NearestNeighbour
Here, after about five times of continually getting mvwm to run that
function, I see output like this to stderr:
!!!expcation: 'WindowStyle Colorset 5'
ocp_debug: 0x7f7ffffbc270: !!!J
depth : 0
orig line:
'<DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF>
<DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF>
<DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF>
<DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF>
<DF>'
curr line:
'<DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF>
<DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF>
<DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF>
<DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF><DF>'
exp line: (do_free = -1) 'WindowStyle Colorset 5'
command : 'WindowStyle'
all args : '(nil)'
pos args :
You may not be able to trigger it though.
> I think some string has been freed that the debug function tried
> to print, but I need the full stack trace, not just the call of
> the debug function. :-)
See 'mvwm-debug-gdb' attached.
> > I'm attaching the debug log (stderr) along with this email. You can see
> > the corruption in there as well.
>
> Uff, where?
See output above.
> > Remember, Dominik, this isn't running on Linux, it's OpenBSD.
>
> That doesn't matter, except that there was a memory leak because
> I used a "char : 1" insetd of "unsigend char : 1" and then
> compared with "is_created == 1". If you ever again see me
> comparing flags in C with literal literal values, please slap me.
> ;-)
Yeah. I noticed that and fixed it locally, but that hasn't resolved
this issue.
> > If you need any further infomation, let me know. I am going to look
> > into this, but you might have a quicker response than me. ;)
>
> I think set_repeat_data is the culprit. It seems to free a string
> that has already been freed. If you have patches, please don't
> commit them but send them to me.
Of course. I'll take a look.
-- Thomas Adam
#0 0x00001a4c118ce424 in strlen (str=0x1a4bcf183fb2 ' <repeats 200 times>...)
at /usr/src/lib/libc/string/strlen.c:39
#1 0x00001a4c118be708 in __vfprintf (fp=0x7f7ffffe3e20, fmt0=0x1a49c97f40cd "
orig line: '%s'\n", ap=Variable "ap" is not available.
) at /usr/src/lib/libc/stdio/vfprintf.c:880
#2 0x00001a4c118bc51f in __vfprintf (fp=0x1a4c11ae0810, fmt0=0x1a49c97f40cd "
orig line: '%s'\n", ap=Variable "ap" is not available.
) at /usr/src/lib/libc/stdio/vfprintf.c:139
#3 0x00001a4c118bf25e in vfprintf (fp=0x1a4c11ae0810, fmt0=0x1a49c97f40cd "
orig line: '%s'\n", ap=0x7f7ffffe4630)
at /usr/src/lib/libc/stdio/vfprintf.c:267
#4 0x00001a4c118a2bc6 in fprintf (fp=Variable "fp" is not available.
) at /usr/src/lib/libc/stdio/fprintf.c:45
#5 0x00001a49c96bd34c in ocp_debug (c=0x7f7ffffe47c0, msg=0x1a49c97f05f0
"!!!J") at cmdparser_old.c:76
#6 0x00001a49c9696909 in __execute_command_line (cond_rc=0x7f7ffffe5128,
exc=0x1a4cb1e0e000, xaction=0x1a4bcf183fb2 ' <repeats 200 times>...,
caller_pc=0x7f7ffffe4b50, exec_flags=256, args=0x0, has_ref_window_moved=0)
at functions.c:481
#7 0x00001a49c9697b94 in execute_function (cond_rc=0x7f7ffffe5128,
exc=0x1a4cb1e0e000, action=0x1a4bcf183fb2 ' <repeats 200 times>...,
pc=0x7f7ffffe4b50,
exec_flags=256) at functions.c:1097
#8 0x00001a49c9697cdd in execute_function_override_window
(cond_rc=0x7f7ffffe5128, exc=0x1a4c61457d00, action=0x1a4bcf183fb2 ' <repeats
200 times>...,
pc=0x7f7ffffe4b50, exec_flags=256, fw=0x1a4bff8d1000) at functions.c:1145
#9 0x00001a49c9685b38 in CMD_All (cond_rc=0x7f7ffffe5128, exc=0x1a4c61457d00,
action=0x1a4bcf183f84 ' <repeats 200 times>..., pc=0x7f7ffffe4b50)
at conditional.c:1612
#10 0x00001a49c9696b90 in __execute_command_line (cond_rc=0x7f7ffffe5128,
exc=0x1a4c4a5e5b00,
xaction=0x1a4c32971880 "All (CurrentScreen, AcceptsFocus, !Iconic, Sticky)
WindowStyle Colorset 10", caller_pc=0x7f7ffffe5000, exec_flags=256,
args=0x7f7ffffe4e90, has_ref_window_moved=0) at functions.c:536
#11 0x00001a49c96970ab in __run_complex_function_items (cond_rc=0x7f7ffffe5128,
cond=105 'i', func=0x1a4c6ee9de00, exc=0x1a4c4a5e5b00,
caller_pc=0x7f7ffffe5000, args=0x7f7ffffe4e90, has_ref_window_moved=0) at
functions.c:730
#12 0x00001a49c9697689 in execute_complex_function (cond_rc=0x7f7ffffe5128,
exc=0x1a4c4a5e5100,
action=0x1a4c9adbb100 ' <repeats 64 times>, "*MvwmButtons-Pager: Frame 2",
pc=0x7f7ffffe5000, desperate=0x7f7ffffe50f0, has_ref_window_moved=0)
at functions.c:920
#13 0x00001a49c9696c0e in __execute_command_line (cond_rc=0x0,
exc=0x1a4c556f9c00, xaction=0x1a4c614582d8 " NearestNeighbour", caller_pc=0x0,
exec_flags=256, args=0x0, has_ref_window_moved=0) at functions.c:557
#14 0x00001a49c9697b94 in execute_function (cond_rc=0x0, exc=0x1a4c556f9c00,
action=0x1a4c614582d8 " NearestNeighbour", pc=0x0, exec_flags=256)
at functions.c:1097
#15 0x00001a49c96acda9 in module_input_execute (input=0x1a4c614582c0) at
module_interface.c:714
#16 0x00001a49c96ace4c in ExecuteCommandQueue () at module_interface.c:755
#17 0x00001a49c9647b69 in My_XNextEvent (dpy=0x1a4c741ae000,
event=0x7f7ffffe54d0) at events.c:4296
#18 0x00001a49c964771b in HandleEvents () at events.c:4126
#19 0x00001a49c96711b0 in main (argc=2, argv=0x7f7ffffe5978) at mvwm.c:2548