<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif;font-size:12pt"><div class="" style=""><span class="" style="">Hmm, that sorta figures.</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class=""><span class="" style="">I've got lots of t_atom * arrays and I'm getting some values from four separate arrays, setting them in another array and outputting the final array as a list. When I put the post() message in after the outlet_list() message it works, but when I don't it just outputs a list of 0's, regardless of the values I got.</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal;
 background-color: transparent;" class=""><span class="" style=""><br class="" style=""></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class=""><span class="" style="">I'll try to run it with gdb and a simple test patch later on - I'm curious to know what the cause is as it's happened to me a few times.</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class=""><span class="" style=""><br class="" style=""></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class=""><span class=""
 style="">Cheers,</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class=""><span class="" style="">Ed</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class=""><span class="" style=""><br></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class="">(simplified) code extract, if you're curious:</div><div style="background-color: transparent;" class=""><span class="" style="white-space:pre">#define ELEMENTS 4</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family:
 HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class=""><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class="">njsequence_float(t_njsequence *x, t_floatarg fin) {</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class=""><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class="">int inPos = (int)fin;</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica,
 Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class=""><br></div><div style="background-color: transparent;" class=""><span class="" style="white-space: pre;">x->offset_1 = atom_getfloatarg(inPos, MAXENTRIES, x->x_tracks.offset_1);</span><span class="" style="">
</span></div><div class="" style=""><span class="" style="white-space: pre;">x->offset_2 = atom_getfloatarg(inPos, MAXENTRIES, x->x_tracks.offset_2);</span><span class="" style="">
</span></div><div class="" style=""><span class="" style="white-space: pre;">x->offset_3 = atom_getfloatarg(inPos, MAXENTRIES, x->x_tracks.offset_3);</span><span class="" style="">
</span></div><div class="" style=""><span class="" style="white-space: pre;">x->offset_4 = atom_getfloatarg(inPos, MAXENTRIES, x->x_tracks.offset_4);</span><span class="" style="white-space:pre">
</span></div><div class="" style=""><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class="">SETFLOAT(&x->x_tracks.offsetList[0],x->offset_1);</div><div style="background-color: transparent;" class="">SETFLOAT(&x->x_tracks.offsetList[1],x->offset_2);</div><div style="background-color: transparent;" class="">SETFLOAT(&x->x_tracks.offsetList[2],x->offset_3);</div><div style="background-color: transparent;" class="">SETFLOAT(&x->x_tracks.offsetList[3],x->offset_4);</div><div style="background-color: transparent;" class=""><span class="" style="white-space:pre"><br></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color:
 transparent;" class="">outlet_list(x->offsets, gensym("list"), ELEMENTS, x->x_tracks.offsetList);</div><div style="background-color: transparent;" class="">post("normal! OFFSETS:::: %d, %d, %d, %d",(int)x->offset_1,(int)x->offset_2,(int)x->offset_3,(int)x->offset_4);</div><div class="" style=""><span style="font-size: 12pt;">}</span><br></div><div class="" style=""></div><div class="" style=""><br></div><div class="" style="">I could post the whole thing, but you probably have better things to do than sift through >1300 lines of code</div><div class="" style=""> </div><div class="" style="">Ninja Jamm - a revolutionary new music remix app from Ninja Tune and Seeper, for iPhone and iPad<br class="" style="">http://www.ninjajamm.com/</div><div class="" style=""><br class="" style=""><br class="" style=""></div><div class="" style="">Gemnotes-0.2: Live music notation for Pure Data, now with dynamics!<br class=""
 style="">http://sharktracks.co.uk/ </div> <div class="qtdSeparateBR"><br><br></div><div class="yahoo_quoted" style="display: block;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif; font-size: 12pt;" class=""> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif; font-size: 12pt;" class=""> <div dir="ltr" class="" style=""> <font size="2" face="Arial" class="" style=""> On Friday, 12 September 2014, 2:46, Miller Puckette <msp@ucsd.edu> wrote:<br class="" style=""> </font> </div> <blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; margin-top: 5px; padding-left: 5px;" class="">  <br class="" style=""><br class="" style=""> <div class="" style="">This has happened to me occasionally in the past.  I think it's usually<br clear="none" class="" style="">that some routine that is getting called after post() is accessing
 an<br clear="none" class="" style="">automatic variable (on the stack) without having set it earlier.  The<br clear="none" class="" style="">post() call is simply changing the behavior by using the stack<br clear="none" class="" style="">itself.<br clear="none" class="" style=""><br clear="none" class="" style="">If you can't catch it with gdb (which might allow you to avoid adding printout)<br clear="none" class="" style="">another strategy is to try moving the post() line further down in the code -<br clear="none" class="" style="">if by moving it below some other line you make it fail again, some function<br clear="none" class="" style="">call in that line might be doing the bad access.<br clear="none" class="" style=""><br clear="none" class="" style="">cheers<br clear="none" class="" style="">M<br clear="none" class="" style=""><div class="" id="yqtfd70100" style=""><br clear="none" class="" style="">On Fri, Sep 12, 2014 at 01:27:53AM +0100,
 Ed Kelly wrote:<br clear="none" class="" style="">> Hi devs,<br clear="none" class="" style="">> <br clear="none" class="" style="">> I've recently, and a number of times in the past had a problem with writing externals which is this:<br clear="none" class="" style="">> An external is supposed to output something (such as a list) from an internally stored array, and it does not work.<br clear="none" class="" style="">> When I add a <br clear="none" class="" style="">> post("This is this %d",x->theValue);<br clear="none" class="" style="">> It starts working.<br clear="none" class="" style="">> This has happened to my code more than once, both in Pd under Linux and in libPd in iOS. It's happened not just recently, but over a number of years.<br clear="none" class="" style="">> I wonder if there is a relationship between Pd and the use of internal arrays that has to be cemented in some way before it can work, and if there is
 some problem in the Pd code (or I might be stupid about something).<br clear="none" class="" style="">> I'll try to find a simple way of demonstrating this - the current extern is about 1800 lines of C, but maybe I can cook up a test if I have time.<br clear="none" class="" style="">> <br clear="none" class="" style="">> Has anyone else had this problem?<br clear="none" class="" style="">> Ed <br clear="none" class="" style="">>  <br clear="none" class="" style="">> Ninja Jamm - a revolutionary new music remix app from Ninja Tune and Seeper, for iPhone and iPad<br clear="none" class="" style="">> <a shape="rect" href="http://www.ninjajamm.com/" target="_blank" class="" style="">http://www.ninjajamm.com/</a><br clear="none" class="" style="">> <br clear="none" class="" style="">> <br clear="none" class="" style="">> Gemnotes-0.2: Live music notation for Pure Data, now with dynamics!<br clear="none" class=""
 style="">> <a shape="rect" href="http://sharktracks.co.uk/" target="_blank" class="" style="">http://sharktracks.co.uk/ </a><br clear="none" class="" style=""><br clear="none" class="" style="">> _______________________________________________<br clear="none" class="" style="">> Pd-dev mailing list<br clear="none" class="" style="">> <a shape="rect" ymailto="mailto:Pd-dev@lists.iem.at" href="mailto:Pd-dev@lists.iem.at" class="" style="">Pd-dev@lists.iem.at</a><br clear="none" class="" style="">> <a shape="rect" href="http://lists.puredata.info/listinfo/pd-dev" target="_blank" class="" style="">http://lists.puredata.info/listinfo/pd-dev</a><br clear="none" class="" style=""><br clear="none" class="" style=""></div><br class="" style=""><br class="" style=""></div> </blockquote>  </div> </div>   </div> </div></body></html>