<div dir="auto">Ran the regression test and it apparently passed. Starting purr-data with -send init and -send init bang did nothing (what should command line look like to autostart?), so I hooked up a bang where init was supposed to go and ran it that way. Commit is now up on my branch. Will make a merge request shortly.<div dir="auto"><br></div><div dir="auto">How is the plot business progressing, namely the inability to click on bars and points in the toplevel window?<br><br><div data-smartmail="gmail_signature" dir="auto">Best,<br><br>Ico<br><br>-- <br>Ivica Ico Bukvic, D.M.A.<br>Director, Creativity + Innovation<br>Institute for Creativity, Arts, and Technology<br><br>Virginia Tech<br>Creative Technologies in Music<br>School of Performing Arts – 0141<br>Blacksburg, VA 24061<br>(540) 231-6139<br><a href="mailto:ico@vt.edu">ico@vt.edu</a><br><br><a href="http://www.icat.vt.edu">www.icat.vt.edu</a><br><a href="http://www.performingarts.vt.edu">www.performingarts.vt.edu</a><br><a href="http://l2ork.icat.vt.edu">l2ork.icat.vt.edu</a><br><a href="http://ico.bukvic.net">ico.bukvic.net</a></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jun 18, 2020, 21:44 Jonathan Wilkes <<a href="mailto:jon.w.wilkes@gmail.com">jon.w.wilkes@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Woah-- wait a sec:<br>
<br>
    -->     for (g = x->gl_list; g2 = g->g_next; g = g2)<br>
                     ;<br>
<br>
As weird as it is, that algorithm is sound. And the bug with ", f 12;"<br>
was in the condition<br>
before this one.<br>
<br>
If there is an invalid read by simply walking the glist, then the<br>
glist has been corrupted.<br>
<br>
So I would check the code for pasting patch snippets to see if there<br>
is anything that<br>
is corrupting the glist.<br>
<br>
E.g., neglecting to set g->g_next for the final node. Stuff like that.<br>
<br>
-Jonathan<br>
<br>
On Thu, Jun 18, 2020 at 9:03 PM Jonathan Wilkes <<a href="mailto:jon.w.wilkes@gmail.com" target="_blank" rel="noreferrer">jon.w.wilkes@gmail.com</a>> wrote:<br>
><br>
> On Thu, Jun 18, 2020 at 8:55 PM Ivica Ico Bukvic <<a href="mailto:ico@vt.edu" target="_blank" rel="noreferrer">ico@vt.edu</a>> wrote:<br>
> ><br>
> > I am not even sure if we need to check for argc... That said, the<br>
> > warning for some reason is not being triggered.<br>
><br>
> Please run purr-data/scripts/regression_test.pd to make sure this<br>
> isn't breaking anything.<br>
><br>
> ><br>
> > Lastly, please note that creating a patch in purr-data and saving it<br>
> > still results in the legacy <command>, f <num>; format for describing<br>
> > the custom width of an object.<br>
><br>
> Ooh, we need to change that.<br>
><br>
> We should open both formats and only save the sane one.<br>
><br>
> -Jonathan<br>
><br>
> ><br>
> > Best,<br>
> ><br>
> > Ico<br>
> ><br>
> > On 6/18/2020 8:53 PM, Ivica Ico Bukvic wrote:<br>
> > > How about simply changing the following inside canvas_f:<br>
> > ><br>
> > >     if (pd_class(last_typedmess_pd) == canvas_class &&<br>
> > >         (t_canvas *)last_typedmess_pd == x &&<br>
> > >         last_typedmess == gensym("restore"))<br>
> > ><br>
> > > to:<br>
> > ><br>
> > >     if (s == gensym("f") && argc >= 1)<br>
> > ><br>
> > > Seems to have fixed the segfault on Linux and Windows.<br>
> > ><br>
> > > Best,<br>
> > ><br>
> > > Ico<br>
> > ><br>
> > > On 6/18/2020 4:53 PM, Jonathan Wilkes wrote:<br>
> > >> On Thu, Jun 18, 2020 at 4:29 PM Ivica Ico Bukvic <<a href="mailto:ico@vt.edu" target="_blank" rel="noreferrer">ico@vt.edu</a>> wrote:<br>
> > >>> It's by far the most SNAFU'd implementation of a for loop I've ever<br>
> > >>> seen. So much so, I am not even sure what it exactly does:<br>
> > >>><br>
> > >>>      -->     for (g = x->gl_list; g2 = g->g_next; g = g2)<br>
> > >>>                       ;<br>
> > >> This is all about that inane ", f $value" syntax that Miller wrote,<br>
> > >> didn't<br>
> > >> test, and then got changed in a later Pd Vanilla version.<br>
> > >><br>
> > >> This bug is probably from Purr Data attempted to support this<br>
> > >> deprecated ", f 12;"<br>
> > >> syntax plus the fixed behavior that just uses "#X f 12;" on the next<br>
> > >> line.<br>
> > >><br>
> > >> I'd like to continue supporting both syntaxes, otherwise uses of the<br>
> > >> old syntax<br>
> > >> will hit the bug and be sad.<br>
> > >><br>
> > >> See the note in line above `t_symbol *last_typedmess;` to understand<br>
> > >> what's going<br>
> > >> on.<br>
> > >><br>
> > >> I'll drill down on this later and see what's up.<br>
> > >><br>
> > >> And just to be clear-- I only attempted to do damage control around that<br>
> > >> looper, I didn't write it. (Yet another reason why we should just be<br>
> > >> using arrays,<br>
> > >> but that's for another time.)<br>
> > >><br>
> > >> -Jonathan<br>
> > >><br>
> > >>> I am assuming it is looking for the last element in the gl_list. If so,<br>
> > >>> I have no idea how this has worked so far, since I do not see any kind<br>
> > >>> of a check whether g->g_next is not NULL... This is also the only place<br>
> > >>> in the entire function (canvas_f) that uses t_gobj *g2.<br>
> > >>><br>
> > >>> Running uner that assumption, I refactored it as:<br>
> > >>><br>
> > >>> g = x->gl_list;<br>
> > >>> if (g) // probably unnecessary but hey let's be pedantic<br>
> > >>>       while (g->g_next)<br>
> > >>>           g = g->g_next;<br>
> > >>><br>
> > >>> Once this is implemented, the segfault now happens on line 2282<br>
> > >>> (immediately below) on the first pd_checkobject(&g->g_pd) which also<br>
> > >>> segfaults with an invalid read of size 8...<br>
> > >>><br>
> > >>><br>
> > >>> On 6/18/2020 4:13 PM, Jonathan Wilkes wrote:<br>
> > >>>> On Thu, Jun 18, 2020 at 3:32 PM Ivica Bukvic <<a href="mailto:ico@vt.edu" target="_blank" rel="noreferrer">ico@vt.edu</a>> wrote:<br>
> > >>>>> Valgrind is a bit more descriptive. It does not happen every time<br>
> > >>>>> but it does happen nonetheless. Looks like Windows is a lot less<br>
> > >>>>> forgiving. I was pasting the content of a simple patch multiple<br>
> > >>>>> times (close the window, new window, paste again):<br>
> > >>>>><br>
> > >>>>> #N canvas 487 261 450 300 10;<br>
> > >>>>> #X floatatom 145 63 5 0 0 0 - - -, f 5;<br>
> > >>>>> #X obj 241 123 print;<br>
> > >>>>> #X floatatom 126 134 5 0 0 0 - - -, f 5;<br>
> > >>>>> #X connect 0 0 1 0;<br>
> > >>>>><br>
> > >>>>> ==12982== Invalid read of size 8<br>
> > >>>>> ==12982==    at 0x436EF3: canvas_f (g_canvas.c:2273)<br>
> > >>>> Something's off for me because 2273 isn't inside canvas_f().<br>
> > >>>><br>
> > >>>> Can you tell me what's at that line number in whatever is your<br>
> > >>>> current branch?<br>
> > >>>><br>
> > >>>> -Jonathan<br>
> > >>>><br>
> > >>>>> ==12982==    by 0x49B977: pd_typedmess (m_class.c:779)<br>
> > >>>>> ==12982==    by 0x49B7DD: pd_typedmess (m_class.c:883)<br>
> > >>>>> ==12982==    by 0x4A4D80: binbuf_eval (m_binbuf.c:937)<br>
> > >>>>> ==12982==    by 0x4AC56B: socketreceiver_read (s_inter.c:615)<br>
> > >>>>> ==12982==    by 0x4AB554: sys_domicrosleep.constprop.3<br>
> > >>>>> (s_inter.c:226)<br>
> > >>>>> ==12982==    by 0x4AE35A: sys_pollgui (s_inter.c:1155)<br>
> > >>>>> ==12982==    by 0x4A84B9: m_pollingscheduler (m_sched.c:542)<br>
> > >>>>> ==12982==    by 0x4A84B9: m_mainloop (m_sched.c:622)<br>
> > >>>>> ==12982==    by 0x4AAEF9: sys_main (s_main.c:440)<br>
> > >>>>> ==12982==    by 0x5ED882F: (below main) (libc-start.c:291)<br>
> > >>>>> ==12982==  Address 0x8 is not stack'd, malloc'd or (recently) free'd<br>
> > >>>>> ==12982==<br>
> > >>>>> ==12982==<br>
> > >>>>> ==12982== Process terminating with default action of signal 11<br>
> > >>>>> (SIGSEGV)<br>
> > >>>>> ==12982==  Access not within mapped region at address 0x8<br>
> > >>>>> ==12982==    at 0x436EF3: canvas_f (g_canvas.c:2273)<br>
> > >>>>> ==12982==    by 0x49B977: pd_typedmess (m_class.c:779)<br>
> > >>>>> ==12982==    by 0x49B7DD: pd_typedmess (m_class.c:883)<br>
> > >>>>> ==12982==    by 0x4A4D80: binbuf_eval (m_binbuf.c:937)<br>
> > >>>>> ==12982==    by 0x4AC56B: socketreceiver_read (s_inter.c:615)<br>
> > >>>>> ==12982==    by 0x4AB554: sys_domicrosleep.constprop.3<br>
> > >>>>> (s_inter.c:226)<br>
> > >>>>> ==12982==    by 0x4AE35A: sys_pollgui (s_inter.c:1155)<br>
> > >>>>> ==12982==    by 0x4A84B9: m_pollingscheduler (m_sched.c:542)<br>
> > >>>>> ==12982==    by 0x4A84B9: m_mainloop (m_sched.c:622)<br>
> > >>>>> ==12982==    by 0x4AAEF9: sys_main (s_main.c:440)<br>
> > >>>>> ==12982==    by 0x5ED882F: (below main) (libc-start.c:291)<br>
> > >>>>> ==12982==  If you believe this happened as a result of a stack<br>
> > >>>>> ==12982==  overflow in your program's main thread (unlikely but<br>
> > >>>>> ==12982==  possible), you can try to increase the size of the<br>
> > >>>>> ==12982==  main thread stack using the --main-stacksize= flag.<br>
> > >>>>> ==12982==  The main thread stack size used in this run was 8388608.<br>
> > >>>>> ==12982==<br>
> > >>>>> ==12982== HEAP SUMMARY:<br>
> > >>>>> ==12982==     in use at exit: 355,586 bytes in 3,885 blocks<br>
> > >>>>> ==12982==   total heap usage: 7,748 allocs, 3,863 frees, 2,870,428<br>
> > >>>>> bytes allocated<br>
> > >>>>> ==12982==<br>
> > >>>>> ==12982== LEAK SUMMARY:<br>
> > >>>>> ==12982==    definitely lost: 416 bytes in 9 blocks<br>
> > >>>>> ==12982==    indirectly lost: 85 bytes in 10 blocks<br>
> > >>>>> ==12982==      possibly lost: 43,438 bytes in 1,323 blocks<br>
> > >>>>> ==12982==    still reachable: 311,647 bytes in 2,543 blocks<br>
> > >>>>> ==12982==         suppressed: 0 bytes in 0 blocks<br>
> > >>>>> ==12982== Rerun with --leak-check=full to see details of leaked<br>
> > >>>>> memory<br>
> > >>>>> ==12982==<br>
> > >>>>> ==12982== For counts of detected and suppressed errors, rerun<br>
> > >>>>> with: -v<br>
> > >>>>> ==12982== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0<br>
> > >>>>> from 0)<br>
> > >>>>><br>
> > >>>>> --<br>
> > >>>>> Ivica Ico Bukvic, D.M.A.<br>
> > >>>>> Director, Creativity + Innovation<br>
> > >>>>> Institute for Creativity, Arts, and Technology<br>
> > >>>>><br>
> > >>>>> Virginia Tech<br>
> > >>>>> Creative Technologies in Music<br>
> > >>>>> School of Performing Arts – 0141<br>
> > >>>>> Blacksburg, VA 24061<br>
> > >>>>> (540) 231-6139<br>
> > >>>>> <a href="mailto:ico@vt.edu" target="_blank" rel="noreferrer">ico@vt.edu</a><br>
> > >>>>><br>
> > >>>>> <a href="http://ci.icat.vt.edu" rel="noreferrer noreferrer" target="_blank">ci.icat.vt.edu</a><br>
> > >>>>> <a href="http://www.icat.vt.edu" rel="noreferrer noreferrer" target="_blank">www.icat.vt.edu</a><br>
> > >>>>> <a href="http://www.performingarts.vt.edu" rel="noreferrer noreferrer" target="_blank">www.performingarts.vt.edu</a><br>
> > >>>>> <a href="http://l2ork.icat.vt.edu" rel="noreferrer noreferrer" target="_blank">l2ork.icat.vt.edu</a><br>
> > >>>>> <a href="http://ico.bukvic.net" rel="noreferrer noreferrer" target="_blank">ico.bukvic.net</a><br>
> > >>> --<br>
> > >>> Ivica Ico Bukvic, D.M.A.<br>
> > >>> Director, Creativity + Innovation<br>
> > >>> Institute for Creativity, Arts, and Technology<br>
> > >>><br>
> > >>> Virginia Tech<br>
> > >>> Creative Technologies in Music<br>
> > >>> School of Performing Arts – 0141<br>
> > >>> Blacksburg, VA 24061<br>
> > >>> (540) 231-6139<br>
> > >>> <a href="mailto:ico@vt.edu" target="_blank" rel="noreferrer">ico@vt.edu</a><br>
> > >>><br>
> > >>> <a href="http://www.icat.vt.edu" rel="noreferrer noreferrer" target="_blank">www.icat.vt.edu</a><br>
> > >>> <a href="http://www.performingarts.vt.edu" rel="noreferrer noreferrer" target="_blank">www.performingarts.vt.edu</a><br>
> > >>> <a href="http://l2ork.icat.vt.edu" rel="noreferrer noreferrer" target="_blank">l2ork.icat.vt.edu</a><br>
> > >>> <a href="http://ico.bukvic.net" rel="noreferrer noreferrer" target="_blank">ico.bukvic.net</a><br>
> > >>><br>
> > >> .<br>
> > ><br>
> > --<br>
> > Ivica Ico Bukvic, D.M.A.<br>
> > Director, Creativity + Innovation<br>
> > Institute for Creativity, Arts, and Technology<br>
> ><br>
> > Virginia Tech<br>
> > Creative Technologies in Music<br>
> > School of Performing Arts – 0141<br>
> > Blacksburg, VA 24061<br>
> > (540) 231-6139<br>
> > <a href="mailto:ico@vt.edu" target="_blank" rel="noreferrer">ico@vt.edu</a><br>
> ><br>
> > <a href="http://www.icat.vt.edu" rel="noreferrer noreferrer" target="_blank">www.icat.vt.edu</a><br>
> > <a href="http://www.performingarts.vt.edu" rel="noreferrer noreferrer" target="_blank">www.performingarts.vt.edu</a><br>
> > <a href="http://l2ork.icat.vt.edu" rel="noreferrer noreferrer" target="_blank">l2ork.icat.vt.edu</a><br>
> > <a href="http://ico.bukvic.net" rel="noreferrer noreferrer" target="_blank">ico.bukvic.net</a><br>
> ><br>
</blockquote></div>