There is a small performance summary chart in the UP docs, and it is failing on window close. Something in the 2D graphics layer seems to be amiss. I haven't run the code to get an image capture in a while, but this was working a few months ago (as far as I recall). I'm on rev [r5031] at the moment.
Code attached. The barchart issue may be a red herring, not sure.
I haven't spent any time in the debugger yet, as I'm hoping it's an obvious fix. If not, add a note, and I'll see what I can figure out, or at least try and narrow it down.
Hi Brian, this is not reproducing for me on an Ubuntu 16.04 machine. What is your "unicon -features" ?
I'll try and dig in, and narrow it down, Jafar.
With -g turned up:
charting.icn pass
Only happens when two Fg colour functions are used:
Using both Fg functions causes an issue, none or either, does not.
Hope that helps tracking down the issue
Last edit: Brian Tiffin 2017-04-12
Brian, I didn't forget about this but I couldn't get it to reporduce for me. Do you know which of these pointers is bad?
wd->colors[wd->colors[wd->buckets[i]].next].prev = wc->prev
wd and wc are passed to the fucntion and they looked good. But there are colors with prev/next and bucket with prev/next and one of those is going bad probably. Can you please narrow it down?
Thanks!
I have just tested this on my Centos 6.9 system and have got the following error
charting
Run-time error 142
File charting.icn; Line 105
attempt to read/write on closed window
offending value: window_-1:-1()
Traceback:
main()
Event(window_-1:-1()) from line 105 in charting.icn
I get the same error as Bruce got,
kubuntu zesty 64 on [r5615],
concurrent debug build.
Related
Commit: [r5615]
Brian, would it be ok for me to put
charting.icn
in tests/graphics?
We need much more test coverage here.
Absolutely ok. I tagged the sources as public domain.
Bug [#228], gpxtest gives me the same error on close via 'X' button.
Related
Bugs: #228
Brian, I am using gcc 6.3, no segfault.
I almost recall a use-after free bug in windows attribs; maybe 5 years ago?
maybe something in my notes...
./configure --enable-debug
# ^ thanks, Jafar!
make Unicon
valgrind src/runtime/iconx charting
# ^ 61 errors. (Note that
valgrind charting
does not give src line#s for errors.)
Thanks, Brian, charting.icn is in [r5620].
Related
Commit: [r5620]
The use after free was bug [#97],
but AFAICT you did not call WAttrib().
Could be another use after free, of course.
Related
Bugs:
#97Still no luck in reproducing this on a coule of Ubuntu 64-bit machines.
[r5625], debug build:
valgrind --track-origins=yes $BASE/src/runtime/iconx ./charting
# ^ no errors until close:
HTH
Related
Commit: [r5625]
we are doing qevent() after a wclose() two lines above. Not sure if that is valid. Want to try moving that after BlkD line and see what happens?
Last edit: Jafar 2017-09-04
qevent after BlkD...
same error, now at line 850, qevent line
Can you run under gdb to print the values of the variables? Is wb null or trash ?
Brian, do you have any environment variables set as MALLOC*?
set | grep MALLOC
Did you use default configure?
No env vars re MALLOC, and yes on default ./configure.
Well except I'm now running a build with --enable-debug to run some gdb.
But good point, I'll start digging through environment space and dot-files to see if some local setting is triggering the fault here.
And it is still happening with latest. On q to quit in gdb:
Last edit: Brian Tiffin 2017-09-05
Breakpoint 1, handle_misc (wd=0x555555950fa0, w=0x555555943ac0) at rxwin.ri:850
# ^ after wclose, qevent :
850 if (ret) return 1;
(gdb) print wb
$1 = (wbp) 0x555555943ac0 # unchanged
(gdb) print wb->window
$2 = (wsp) 0x5555559466f0 # reasonable
(gdb) cont
Continuing.
Run-time error 142
...
What puzzles me is:
Brian gets a segfault in wclose();
valgrind reports no error there, but
a use-after-free (non-fatal)
in the following qevent()
then many more before a
run-time error stop.
Brian, what version window manager, X, etc., do you have? what color depth? bpp?
Have you tried charting with another xserver? another color depth?
Jafar, qevent's 1st arg, wb->window, was already freed, by
free_window() in wclose(), refcount was 0.
The freed wb->window's refcount is trashed now, over 1 billion, when qevent is called.
wb->refcount is also trashed, over 1 Billion.
If wb->window->refcount was 1 and wclose() returns 0, wb is gone.
AFAICT wclose() return value is never used, so we could fix it to only return 0 if wb is really gone.
If I use q to quit, valgrind shows 0 errors, normal exit, success.
Closing by clicking X : 41 errors,
runtime error.