Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug in [jmmmp/matrixctrl] - only one object per pd session allowed #850

Open
jmmmp opened this issue Dec 27, 2019 · 5 comments
Open

bug in [jmmmp/matrixctrl] - only one object per pd session allowed #850

jmmmp opened this issue Dec 27, 2019 · 5 comments

Comments

@jmmmp
Copy link

@jmmmp jmmmp commented Dec 27, 2019

This is the first time I see something like this: the object [jmmmp/matrixctrl] can only be created once in a pd session. After the first time, any other instance will appear as text (no gui); if something is sent to it, it behaves as [zexy/lister] - including opening its help patch when requested. (Btw, lister isn't used in this abstraction)

I installed many pd versions, and found out that the last version where this works is pd-0.46-7 - in windows 7.

Is it possible to track down what changed? This object uses zexy, iemmatrix and list-abs.

(matrixctrl is a pd abstraction emulating the same object in max/msp, to control mtx_*~)

@umlaeute

This comment has been minimized.

Copy link
Contributor

@umlaeute umlaeute commented Dec 27, 2019

this sounds like some memory corruption.
which libraries are loaded? what happens if you don't load any libraries? ...

@jmmmp

This comment has been minimized.

Copy link
Author

@jmmmp jmmmp commented Dec 27, 2019

@umlaeute

This comment has been minimized.

Copy link
Contributor

@umlaeute umlaeute commented Dec 27, 2019

please do not add "other small bugs" to this bug-report (unless you are very confident that they are indeed the same bug)

@umlaeute

This comment has been minimized.

Copy link
Contributor

@umlaeute umlaeute commented Dec 27, 2019

note to myself: it seems that the problem is, that class_loadsym ought to be pushed to a stack rather instead of a single global variable:

pure-data/src/m_class.c

Lines 898 to 907 in 628a8d3

class_loadsym = s;
pd_globallock();
if (sys_load_lib(canvas_getcurrent(), s->s_name))
{
tryingalready++;
typedmess(dummy, s, argc, argv);
tryingalready--;
return;
}
class_loadsym = 0;

and then:

pure-data/src/m_class.c

Lines 458 to 469 in 628a8d3

if (class_loadsym)
{
/* if we're loading an extern it might have been invoked by a
longer file name; in this case, make this an admissible name
too. */
const char *loadstring = class_loadsym->s_name;
size_t l1 = strlen(s->s_name), l2 = strlen(loadstring);
if (l2 > l1 && !strcmp(s->s_name, loadstring + (l2 - l1)))
class_addmethod(pd_objectmaker, (t_method)newmethod,
class_loadsym,
vec[0], vec[1], vec[2], vec[3], vec[4], vec[5]);
}

@jmmmp

This comment has been minimized.

Copy link
Author

@jmmmp jmmmp commented Jan 10, 2020

Any prediction on when that zexy issue will be solved? I might release a new version of jmmmp soonish, if it's worth waiting I can do it.

umlaeute added a commit that referenced this issue Jan 14, 2020
… objectname

alternatively, the check whether the extern has "been invoked by a longer
file name; in this case, make this an admissible name" needs to be made
more intelligent, e.g. longname.endswith("/"+shortname)

Closes: #850
umlaeute added a commit that referenced this issue Jan 16, 2020
… when loading a library)

Closes: #850
this is an improved fix, that actually tries to solve the underlying
problem (using the wrong name for registering a long-alias)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.