Skip Menu |
 

This queue is for tickets about the PAR-Packer CPAN distribution.

Report information
The Basics
Id: 33358
Status: resolved
Priority: 0/
Queue: PAR-Packer

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: Cannot run Tk program, no X11 connection
A trivial Tk program does not run with PAR on my system (FreeBSD 6.2, recent X server, perl 5.8.8). The script is the following: #!/usr/bin/perl -w use Tk; $top = new MainWindow; MainLoop; __END__ I package the script with pp -o tk tk.pl Running "tk" gives the following error: Xlib: connection to ":0.0" refused by server Xlib: No protocol specified couldn't connect to display ":0.0" at Tk/MainWindow.pm line 55. MainWindow->new() at script/tk.pl line 3 Exitcode 255 tk.pl runs OK. If I run both through truss, then I see that tk.pl loads the ~/.Xauthority file while the packaged tk skips this section. This is the trace of the "good" one: connect(4,{ AF_UNIX "/tmp/.X11-unix/X0" },19) = 0 (0x0) __sysctl(0x7fffffffd868,0x2,0x7fffffffd8a0,0x7fffffffd860,0x0,0x0) = 0 (0x0) fcntl(4,F_SETFD,FD_CLOEXEC) = 0 (0x0) access("/home/e/eserte/.Xauthority",4) = 0 (0x0) open("/home/e/eserte/.Xauthority",O_RDONLY,0666) = 5 (0x5) fstat(5,{mode=-rw------- ,inode=16638851,size=757,blksize=4096}) = 0 (0x0) read(5,"\^A\0\0\^Qbiokovo.herceg.de\0\^B"...,4096) = 757 (0x2f5) read(5,0x53b000,4096) = 0 (0x0) close(5) = 0 (0x0) break(0x8c2000) = 0 (0x0) mmap(0x0,12288,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,4294967295,0x7fff000000 00) = 34365214720 (0x800539000) munmap(0x80052f000,4096) = 0 (0x0) writev(0x4,0x7fffffffdb50,0x4) = 48 (0x30) fcntl(4,F_GETFL,) = 2 (0x2) fcntl(4,F_SETFL,O_NONBLOCK|0x2) = 0 (0x0) And this is the trace of the "bad" one: connect(6,{ AF_UNIX "/tmp/.X11-unix/X0" },19) = 0 (0x0) __sysctl(0x7fffffffd218,0x2,0x7fffffffd250,0x7fffffffd210,0x0,0x0) = 0 (0x0) fcntl(6,F_SETFD,FD_CLOEXEC) = 0 (0x0) writev(0x6,0x7fffffffd500,0x1) = 12 (0xc) fcntl(6,F_GETFL,) = 2 (0x2) fcntl(6,F_SETFL,O_NONBLOCK|0x2) = 0 (0x0) Regards, Slaven
Download (untitled) / with headers
text/plain 2.5k
On Sun Feb 17 16:44:48 2008, SREZIC wrote: Show quoted text
> A trivial Tk program does not run with PAR on my system (FreeBSD 6.2, > recent X server, perl 5.8.8). The script is the following: > > #!/usr/bin/perl -w > use Tk; > $top = new MainWindow; > MainLoop; > __END__ > > I package the script with > > pp -o tk tk.pl > > Running "tk" gives the following error: > > Xlib: connection to ":0.0" refused by server > Xlib: No protocol specified > > couldn't connect to display ":0.0" at Tk/MainWindow.pm line 55. > MainWindow->new() at script/tk.pl line 3 > Exitcode 255 > > tk.pl runs OK. If I run both through truss, then I see that tk.pl > loads > the ~/.Xauthority file while the packaged tk skips this section. > > This is the trace of the "good" one: > > connect(4,{ AF_UNIX "/tmp/.X11-unix/X0" },19) = 0 (0x0) > __sysctl(0x7fffffffd868,0x2,0x7fffffffd8a0,0x7fffffffd860,0x0,0x0) = 0 > (0x0) > fcntl(4,F_SETFD,FD_CLOEXEC) = 0 (0x0) > access("/home/e/eserte/.Xauthority",4) = 0 (0x0) > open("/home/e/eserte/.Xauthority",O_RDONLY,0666) = 5 (0x5) > fstat(5,{mode=-rw------- ,inode=16638851,size=757,blksize=4096}) = 0 > (0x0) > read(5,"\^A\0\0\^Qbiokovo.herceg.de\0\^B"...,4096) = 757 (0x2f5) > read(5,0x53b000,4096) = 0 (0x0) > close(5) = 0 (0x0) > break(0x8c2000) = 0 (0x0) >
mmap(0x0,12288,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,4294967295,0x7fff000000 Show quoted text
> 00) = 34365214720 (0x800539000) > munmap(0x80052f000,4096) = 0 (0x0) > writev(0x4,0x7fffffffdb50,0x4) = 48 (0x30) > fcntl(4,F_GETFL,) = 2 (0x2) > fcntl(4,F_SETFL,O_NONBLOCK|0x2) = 0 (0x0) > > And this is the trace of the "bad" one: > > connect(6,{ AF_UNIX "/tmp/.X11-unix/X0" },19) = 0 (0x0) > __sysctl(0x7fffffffd218,0x2,0x7fffffffd250,0x7fffffffd210,0x0,0x0) = 0 > (0x0) > fcntl(6,F_SETFD,FD_CLOEXEC) = 0 (0x0) > writev(0x6,0x7fffffffd500,0x1) = 12 (0xc) > fcntl(6,F_GETFL,) = 2 (0x2) > fcntl(6,F_SETFL,O_NONBLOCK|0x2) = 0 (0x0) > > Regards, > Slaven
Another data point: it seems that **environ is somehow destroyed in the packaged script (destroyed means: if I run the attached script, then a lot of spaces is returned, and only two PAR variables look OK). %ENV looks OK, but it seems that Tk uses XAUTHORITY from **environ. If I set $ENV{XAUTHORITY} manually, then everything seems to work.
Download environ.pl
text/x-perl 237b
#!/usr/bin/perl -w use FindBin; use Inline C => <<'EOC'; void show_environ() { char** e = environ; while(*e) { fprintf(stderr,"<%s>\n", *e); e++; } } EOC show_environ(); $ENV{XAUTHORITY} = "XXX"; show_environ(); __END__
Download (untitled) / with headers
text/plain 291b
Hi Slaven, sorry for the delay. I can't keep up with PAR bugs any more. Unfortunately, I can't reproduce the bug. I'm using perl 5.10.0, PAR 0.979, PAR::Packer 0.980, Tk 804.028 on a SuSe Linux 9.x (2.6.5-7.257-smp). So I guess this issue is stalled for now. Sorry. Best regards, Steffen
Download (untitled) / with headers
text/plain 429b
On 2008-05-14 11:17:53, SMUELLER wrote: Show quoted text
> Hi Slaven, > > sorry for the delay. I can't keep up with PAR bugs any more. > > Unfortunately, I can't reproduce the bug. I'm using perl 5.10.0, PAR > 0.979, PAR::Packer 0.980, Tk 804.028 on a SuSe Linux 9.x (2.6.5-7.257-smp). > > So I guess this issue is stalled for now. Sorry.
I also cannot reproduce the problem anymore with recent PAR::Packer. Assume fixed. Regards, Slaven


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.