[PD-dev] External development: PD crash using pd_symbol without associated receiver in patch

Miller Puckette msp at ucsd.edu
Tue May 12 05:30:13 CEST 2015


It's slightly different - the symbol might or might not have already been
created (gensym() creates it if necessary) but the s_thing field will be
nonzero only if something has been bound to the symbol (i.e., some object
has named itself that).  When such an object is destroyed it's up to the
object to get itself off the s_thing field (pd_unbind()) so that nobody will
mistakenly try to dereference the pointer to it any more.

cheers
Miller

On Tue, May 12, 2015 at 01:59:04AM +0100, Alexandre Clément wrote:
> Perfect!
> 
> Just to make sure I understand what's going on, the code was trying to
> access a non-existent pointer to the symbol, right? That condition just
> verifies if the symbol corresponding to "code" has been created and
> therefore exists in the symbol table, before trying to adress it.
> 
> So in other words, would it be possible (for example) to check from one
> external if a given symbol/object has been created in another external
> (check its existence in the symbol table)?
> 
> Thanks a lot for the help!
> 
> Cheers,
> Alex
> 
> On 12 May 2015 at 00:07, Miller Puckette <msp at ucsd.edu> wrote:
> 
> > Try this:
> >
> > if (gensym("code")->s_thing)
> >         pd_symbol(gensym("code")->s_thing, gensym("content"));
> >
> > cheers
> > Miller
> >
> > On Mon, May 11, 2015 at 07:58:19PM +0100, Alexandre Clément wrote:
> > > Hello all
> > > First ever mail to this list, so bear with me if I trample on any
> > > netiquette rules.
> > >
> > > So, in short, I'm working on a simple external, taking a float and
> > > converting it to int, then to hex (no biggie) before sending it out via a
> > > "send" cordless message.
> > >
> > > I'm using:
> > >
> > > pd_symbol(gensym("code")->s_thing, gensym("content"));
> > >
> > > Everything works fine and dandy IF i have a receive object in the patch
> > > waiting for that "code" target.
> > > If, however, I remove it or have no receiver at all, PD hangs and
> > crashes.
> > >
> > > Since this is supposed to be a part of a libPD embedded mobile app, its
> > my
> > > only means of communicating to the wrapper-app...
> > > FYI: developing in C, on windows 7 with Eclipse Luna.
> > > These crashes are happening in "regular" desktop PD, so not a libPD
> > issue.
> > > Tried using GDB by attaching it to PD, but can't really get any useful
> > info
> > > from the debug messages shown in the debug perspective in Eclipse.
> > >
> > >
> > > Any insight on the matter would be greatly appreciated!
> > >
> > > Cheers,
> > > Alex
> >
> > > _______________________________________________
> > > Pd-dev mailing list
> > > Pd-dev at lists.iem.at
> > > http://lists.puredata.info/listinfo/pd-dev
> >
> >



More information about the Pd-dev mailing list