hi

On 2010-09-29 03:58, Paul Wise wrote:
> On Tue, 2010-09-28 at 16:01 +0200, Paul Brossier wrote:

> I've never installed puredata before, so I definitely don't have another
> binary on my machine. Hans did a demo of it at DebConf10 for me on his
> computer and I decided to try it when I got back home.
> 
> Perhaps this is an architecture-specific issue? I'm on amd64 and the
> other person who mentioned their arch seems to use i386.

i have now tested on an amd64, and cannot reproduce the bug either
(sidenote: the machine in question has been in use for ages)
> 
> p...@chianamo:~$ which puredata
> /usr/bin/puredata
[...]

thanks for the additional info.
> p...@chianamo:~$ /usr/bin/puredata
> tcl: /usr/lib/pd/bin/bin/pd.tk: can't open script
> pd: exiting
> p...@chianamo:~$ which puredata
> /usr/bin/puredata
> p...@chianamo:~$ dpkg -S /usr/bin/puredata
> puredata: /usr/bin/puredata
> p...@chianamo:~$ debsums -sa puredata
> p...@chianamo:~$ puredata
> tcl: /usr/lib/pd/bin/bin/pd.tk: can't open script
> ^CPd: signal 2
> p...@chianamo:~$ ls -l /usr/bin/puredata 
> lrwxrwxrwx 1 root root 2 Aug 15 17:02 /usr/bin/puredata -> pd*
> p...@chianamo:~$ file /usr/bin/pd
> /usr/bin/pd: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically 
> linked (uses shared libs), for GNU/Linux 2.6.18, stripped
> p...@chianamo:~$ dpkg -S /usr/bin/pd
> puredata: /usr/bin/pd
> p...@chianamo:~$ which pd
> /usr/bin/pd
> p...@chianamo:~$ pd
> tcl: /usr/lib/pd/bin/bin/pd.tk: can't open script
> ^CPd: signal 2
> p...@chianamo:~$ dpkg -L puredata | xargs grep pd.tk
> Binary file /usr/lib/pd/bin/pd-gui matches


> p...@chianamo:~$ /usr/lib/pd/bin/pd-gui
> sh: /usr/lib/pd/bin/../bin/pd: not found

yes, this is "kind-of" expected behaviour.
you usually don't start "pd-gui" on its own (neither do you start pd.tk
on its own)

> p...@chianamo:~$ pd -verbose
> Pd version 0.42-6
> compiled 01:37:11 Sep 29 2010
> port 5402
> TCL_LIBRARY="/usr/lib/pd/tcl/library" TK_LIBRARY="/usr/lib/pd/tk/library"     
>              "/usr/lib/pd/bin/pd-gui" 5402
> Waiting for connection request... 
> tcl: /usr/lib/pd/bin/bin/pd.tk: can't open script


pd does some (not-so) magic, to find the pd.tk lying next to the pd-gui
binary.
since the pd-gui binary is "/usr/lib/pd/bin/pd-gui" (according to "pd
-verbose") it should find the script as /usr/lib/pd/bin/pd.tk

attached is the isolated code that does the name-mangling.
to test, compile it with "make pdpath" and then run:
$ ./pdpath /usr/lib/pd/bin/pd-gui"
this should give you something like:
checking './pdpath' -> '.' -> './bin/pd.tk'
checking '/usr/lib/pd/bin/pd-gui' -> '/usr/lib/pd' ->
'/usr/lib/pd/bin/pd.tk'


> ... connected
> OSS: requested audio buffer size 8816 limited to 8192
> OSS: issuing first ADC 'read' ... ...done.
> pd: exiting
> 
> After rebuilding it with debug symbols I did some debugging and found:
> 
> sys_startgui gets called with guidir="/usr/lib/pd/bin"
> 
> sys_guicmd gets set to "TCL_LIBRARY=\"/usr/lib/pd/tcl/library\"
> TK_LIBRARY=\"/usr/lib/pd/tk/library\"", ' ' <repeats 18 times>,
> "\"/usr/lib/pd/bin/pd-gui\" 5400\n"
> 
> I can't figure out how to debug pd-gui.


aye, that's a bit tricky:
you have to create a proxy-server for the communication between pd & pd-gui:
$ cd /tmp
$ mknod backpipe p
$ netcat -l -p 8000 0<backpipe | netcat -l -p 7000 1>backpipe

in another terminal, you then connect pd to the proxy:
$ /usr/bin/pd -guiport 8000

and in a third terminal, start pd-gui
$ /usr/lib/pd/bin/pd-gui 7000


> 
> Also, there are some "interesting" warnings in the build logs:
> 
> https://buildd.debian.org/fetch.cgi?&pkg=puredata&ver=0.42.6-1%2Bb1&arch=amd64&stamp=1279403523&file=log
> https://buildd.debian.org/fetch.cgi?pkg=puredata&arch=i386&ver=0.42.6-1%2Bb1&stamp=1279404893&file=log&as=raw

i fail to see the "interesting" warnings (unless you allude to the
"xport_dynamic" stuff, which is interesting somehow, but unfortunately
totally unrelated (this warning only appears when building plugins,
which you are currently not loading)

mfgasdr
IOhannes
#include <string.h>
#include <stdlib.h>
#include <stdio.h>

#define GUISTRING 1000
static char *pdgui_path = NULL;


void pdgui_setname(char *s)
{
    char *t;
    char *str;
    int n;
    if (t = strrchr(s, '/')) str = s, n = (t-s) + 1;
    else str = "./", n = 2;
    if (n > GUISTRING-100) n = GUISTRING-100;
    if(pdgui_path)
      free(pdgui_path);

    pdgui_path = malloc(n+9);

    strncpy(pdgui_path, str, n);
    while (strlen(pdgui_path) > 0 && pdgui_path[strlen(pdgui_path)-1] == '/')
        pdgui_path[strlen(pdgui_path)-1] = 0;
    if (t = strrchr(pdgui_path, '/'))
        *t = 0;
}

void pdgui_test(char *root, char*s) {
    char buf[GUISTRING];
    pdgui_setname(root);
    strcpy(buf, pdgui_path);
    strcat(buf, "/bin/");
    strcat(buf, s);
    printf("checking '%s' -> '%s' -> '%s'\n", root, pdgui_path, buf);

}

int main(int argc, char **argv) {
  while(argc-->0) {
    pdgui_test(*argv++, "pd.tk");
  }

  return 0;

}

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to