Re: [Fink-devel] Problem installing sbcl [Bug in dpkg?]

2010-01-10 Thread Jesse Alama
On 2010-01-03 17:11:55 +, Martin Costabel said:

> Martin Costabel wrote:
> []
>> On 10.6/32bit: Builds but doesn't install
>> 
>>> Unpacking sbcl (from .../sbcl_1.0.34-1_darwin-i386.deb) ...
>>> ### execution of /sw32/bin/dpkg-lockwait failed, exit code 6
>>> /sw32/bin/dpkg-deb: subprocess paste killed by signal (Broken pipe)
>>> Updating the list of locally available binary packages.
>>> Scanning dists/local/main/binary-darwin-i386
>>> New package: 
>>> dists/local/main/binary-darwin-i386/sbcl_1.0.34-1_darwin-i386.deb
>>> Failed: can't install package sbcl-1.0.34-1
> 
> I have now found where this chokes: It happens when dpkg tries to
> install the file
> 
> /sw/share/doc/sbcl/html/sbcl/Method-sb_002dbsd_002dsockets_003asocket_002dmake_002dstream-_0028_0028socket-socket_0029-_0026key-input-output-_0028element_002dtype-_0027character_0029-_0028buffering-full_0029-_0028external_002dformat-default_0029-timeout_0029.html

If 
> 
> I remove this file in sbcl's InstallScript, then sbcl (1.0.33 and
> 1.0.34) installs OK on 10.6/32bit (at least sometimes, at other times it
> produces the sb-posix module build failure I have seen also on
> 10.6/64bit occasionally).
> 
> This looks like dpkg is not able to handle files with a file name longer
> than 256 characters. On the other hand, I don't understand why this bug
> only shows up on 10.6/32bit and not on 10.6/64bit nor on 10.5/32bit.

Let's go with this solution.  I think upstream will not be pleased if 
we ask them to modify their code to deal with a limitation of dpkg, so 
for now let's just trash the file with the huge name.  I've submitted 
the change package description file to my experimental branch; please 
give it a try.  Thanks for spotting this bug!

Jesse



--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
___
Fink-devel mailing list
Fink-devel@lists.sourceforge.net
http://news.gmane.org/gmane.os.apple.fink.devel
Subscription management:
https://lists.sourceforge.net/lists/listinfo/fink-devel


Re: [Fink-devel] Problem installing sbcl [Bug in dpkg?]

2010-01-05 Thread Daniel Macks
On Tue, Jan 05, 2010 at 09:39:45AM +0100, Martin Costabel wrote:
> Daniel Macks wrote:
> []
> > main/archives.c:tarobject() uses a static buffer to store a filename
> > during installation. Wanna guess the size of fnamebuf[]? Try bumping
> > it to something "much larger". Latest dpkg upstream still has this
> > same hardcoded size.
> 
> This may even be legal, seeing that /usr/include/sys/syslimits.h has
> 
> #define NAME_MAX   255   /* max bytes in a file name */
> 
> I don't know if this number includes the path component or only the 
> basename, though. The basename itself, even extended by "-dpkg-new", is 
> only 244 characters.

The open(2) manpage says:

[ENAMETOOLONG] A component of a pathname exceeded {NAME_MAX} charac-
ters, or an entire path name exceeded {PATH_MAX} char-
acters.

> As buffer overflows do not always lead to crashes, this would explain 
> the sort of non-deterministic behavior of the package.
> 
> Anayway, I guess this should be treated as a bug in sbcl. It doesn't 
> really need that outrageously named file, which only contains a URL 
> redirection, anyway, and does not seem to be linked to by any of the 
> other documentation files.

Sounds good to me.

dan

-- 
Daniel Macks
dma...@netspace.org
http://www.netspace.org/~dmacks


--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
___
Fink-devel mailing list
Fink-devel@lists.sourceforge.net
http://news.gmane.org/gmane.os.apple.fink.devel
Subscription management:
https://lists.sourceforge.net/lists/listinfo/fink-devel


Re: [Fink-devel] Problem installing sbcl [Bug in dpkg?]

2010-01-05 Thread Martin Costabel
Daniel Macks wrote:
[]
> main/archives.c:tarobject() uses a static buffer to store a filename
> during installation. Wanna guess the size of fnamebuf[]? Try bumping
> it to something "much larger". Latest dpkg upstream still has this
> same hardcoded size.

This may even be legal, seeing that /usr/include/sys/syslimits.h has

#define NAME_MAX   255   /* max bytes in a file name */

I don't know if this number includes the path component or only the 
basename, though. The basename itself, even extended by "-dpkg-new", is 
only 244 characters.

As buffer overflows do not always lead to crashes, this would explain 
the sort of non-deterministic behavior of the package.

Anayway, I guess this should be treated as a bug in sbcl. It doesn't 
really need that outrageously named file, which only contains a URL 
redirection, anyway, and does not seem to be linked to by any of the 
other documentation files.

-- 
Martin



--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
___
Fink-devel mailing list
Fink-devel@lists.sourceforge.net
http://news.gmane.org/gmane.os.apple.fink.devel
Subscription management:
https://lists.sourceforge.net/lists/listinfo/fink-devel


Re: [Fink-devel] Problem installing sbcl [Bug in dpkg?]

2010-01-03 Thread Daniel Macks
On Sun, Jan 03, 2010 at 11:09:09PM +0100, Martin Costabel wrote:
> Daniel Macks wrote:
> []
> >> This looks like dpkg is not able to handle files with a file name longer 
> >> than 256 characters. On the other hand, I don't understand why this bug 
> >> only shows up on 10.6/32bit and not on 10.6/64bit nor on 10.5/32bit.
> > 
> > Also doesn't seem to choke on 10.4/ppc. Wonder if there is some static
> > buffer used to hold a pathname? I have:
> > 
> > /usr/include/limits.h:#define   _POSIX_PATH_MAX 256
> > /usr/include/sys/param.h:#defineMAXPATHLEN  PATH_MAX
> > /usr/include/sys/syslimits.h:#definePATH_MAX 1024   /* 
> > max bytes in pathname */
> > 
> > The "paste" subprocess is in dpkg-deb/extract.c:extracthalf(), where I
> > can't decipher the forking and stream processing that is used to read
> > the .deb. Try a simpler dpkg-deb modes to make sure this is where it's
> > choking: "dpkg-deb -c foo.deb" vs "dpkg-deb -X foo.deb /tmp". I think
> > the actual archive reading is done with a system(tar) call, so that
> > command (and its platform variations, and different fink-installed
> > versions) could be another place to look for the root cause:
> > 
> >   dpkg-deb --fsys-tarfile foo.deb > archive.tar
> > 
> > to extract the .deb filesystem archive and then try 'tar -xf
> > archive.tar' with various different tar commands.
> 
> All these command-line things work correctly for me. No crash and no 
> missing files.
> 
> Two more data points: When running "fink install sbcl" or dpkg -k, after 
> the failure the file with the long name is actually installed. It is the 
> last one that is installed. The next one would be 
> Methods-common-to-all-streams.html, but it is not there. If one rune 
> install again, then the long file exists twice, once with a .dpkg-tmp 
> extension and once without. This should narrow down the point where the 
> crash happens.
> 
> There is also a crash report:
> 
> > Exception Type:  EXC_CRASH (SIGABRT)
> > Exception Codes: 0x, 0x
> > Crashed Thread:  0  Dispatch queue: com.apple.main-thread
> > 
> > Application Specific Information:
> > __abort() called
> > 
> > Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
> > 0   libSystem.B.dylib   0x90064732 __kill + 10
> > 1   libSystem.B.dylib   0x90064724 kill$UNIX2003 + 32
> > 2   libSystem.B.dylib   0x900f798d raise + 26
> > 3   libSystem.B.dylib   0x9010d9d9 __abort + 124
> > 4   libSystem.B.dylib   0x900f071c 
> > release_file_streams_for_task + 0
> > 5   dpkg0x8a6a tarobject + 6277
> > 6   dpkg0x00020a71 TarExtractor + 759
> > 7   dpkg0xbc4c process_archive + 7772
> > 8   dpkg0x997a archivefiles + 1849
> > 9   dpkg0x3748 main + 323


main/archives.c:tarobject() uses a static buffer to store a filename
during installation. Wanna guess the size of fnamebuf[]? Try bumping
it to something "much larger". Latest dpkg upstream still has this
same hardcoded size.

dan

-- 
Daniel Macks
dma...@netspace.org
http://www.netspace.org/~dmacks


--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
___
Fink-devel mailing list
Fink-devel@lists.sourceforge.net
http://news.gmane.org/gmane.os.apple.fink.devel
Subscription management:
https://lists.sourceforge.net/lists/listinfo/fink-devel


Re: [Fink-devel] Problem installing sbcl [Bug in dpkg?]

2010-01-03 Thread Martin Costabel
Daniel Macks wrote:
[]
>> This looks like dpkg is not able to handle files with a file name longer 
>> than 256 characters. On the other hand, I don't understand why this bug 
>> only shows up on 10.6/32bit and not on 10.6/64bit nor on 10.5/32bit.
> 
> Also doesn't seem to choke on 10.4/ppc. Wonder if there is some static
> buffer used to hold a pathname? I have:
> 
> /usr/include/limits.h:#define   _POSIX_PATH_MAX 256
> /usr/include/sys/param.h:#defineMAXPATHLEN  PATH_MAX
> /usr/include/sys/syslimits.h:#definePATH_MAX 1024   /* 
> max bytes in pathname */
> 
> The "paste" subprocess is in dpkg-deb/extract.c:extracthalf(), where I
> can't decipher the forking and stream processing that is used to read
> the .deb. Try a simpler dpkg-deb modes to make sure this is where it's
> choking: "dpkg-deb -c foo.deb" vs "dpkg-deb -X foo.deb /tmp". I think
> the actual archive reading is done with a system(tar) call, so that
> command (and its platform variations, and different fink-installed
> versions) could be another place to look for the root cause:
> 
>   dpkg-deb --fsys-tarfile foo.deb > archive.tar
> 
> to extract the .deb filesystem archive and then try 'tar -xf
> archive.tar' with various different tar commands.

All these command-line things work correctly for me. No crash and no 
missing files.

Two more data points: When running "fink install sbcl" or dpkg -k, after 
the failure the file with the long name is actually installed. It is the 
last one that is installed. The next one would be 
Methods-common-to-all-streams.html, but it is not there. If one rune 
install again, then the long file exists twice, once with a .dpkg-tmp 
extension and once without. This should narrow down the point where the 
crash happens.

There is also a crash report:

> Exception Type:  EXC_CRASH (SIGABRT)
> Exception Codes: 0x, 0x
> Crashed Thread:  0  Dispatch queue: com.apple.main-thread
> 
> Application Specific Information:
> __abort() called
> 
> Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
> 0   libSystem.B.dylib   0x90064732 __kill + 10
> 1   libSystem.B.dylib   0x90064724 kill$UNIX2003 + 32
> 2   libSystem.B.dylib   0x900f798d raise + 26
> 3   libSystem.B.dylib   0x9010d9d9 __abort + 124
> 4   libSystem.B.dylib   0x900f071c 
> release_file_streams_for_task + 0
> 5   dpkg0x8a6a tarobject + 6277
> 6   dpkg0x00020a71 TarExtractor + 759
> 7   dpkg0xbc4c process_archive + 7772
> 8   dpkg0x997a archivefiles + 1849
> 9   dpkg0x3748 main + 323

-- 
Martin


--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
___
Fink-devel mailing list
Fink-devel@lists.sourceforge.net
http://news.gmane.org/gmane.os.apple.fink.devel
Subscription management:
https://lists.sourceforge.net/lists/listinfo/fink-devel


Re: [Fink-devel] Problem installing sbcl [Bug in dpkg?]

2010-01-03 Thread Daniel Macks
On Sun, Jan 03, 2010 at 06:11:55PM +0100, Martin Costabel wrote:
> Martin Costabel wrote:
> []
> > On 10.6/32bit: Builds but doesn't install
> > 
> >> Unpacking sbcl (from .../sbcl_1.0.34-1_darwin-i386.deb) ...
> >> ### execution of /sw32/bin/dpkg-lockwait failed, exit code 6
> >> /sw32/bin/dpkg-deb: subprocess paste killed by signal (Broken pipe)
> >> Updating the list of locally available binary packages.
> >> Scanning dists/local/main/binary-darwin-i386
> >> New package: 
> >> dists/local/main/binary-darwin-i386/sbcl_1.0.34-1_darwin-i386.deb
> >> Failed: can't install package sbcl-1.0.34-1
> 
> I have now found where this chokes: It happens when dpkg tries to 
> install the file
> 
> /sw/share/doc/sbcl/html/sbcl/Method-sb_002dbsd_002dsockets_003asocket_002dmake_002dstream-_0028_0028socket-socket_0029-_0026key-input-output-_0028element_002dtype-_0027character_0029-_0028buffering-full_0029-_0028external_002dformat-default_0029-timeout_0029.html
> 
> If I remove this file in sbcl's InstallScript, then sbcl (1.0.33 and 
> 1.0.34) installs OK on 10.6/32bit (at least sometimes, at other times it 
> produces the sb-posix module build failure I have seen also on 
> 10.6/64bit occasionally).
> 
> This looks like dpkg is not able to handle files with a file name longer 
> than 256 characters. On the other hand, I don't understand why this bug 
> only shows up on 10.6/32bit and not on 10.6/64bit nor on 10.5/32bit.

Also doesn't seem to choke on 10.4/ppc. Wonder if there is some static
buffer used to hold a pathname? I have:

/usr/include/limits.h:#define   _POSIX_PATH_MAX 256
/usr/include/sys/param.h:#defineMAXPATHLEN  PATH_MAX
/usr/include/sys/syslimits.h:#definePATH_MAX 1024   /* max 
bytes in pathname */

The "paste" subprocess is in dpkg-deb/extract.c:extracthalf(), where I
can't decipher the forking and stream processing that is used to read
the .deb. Try a simpler dpkg-deb modes to make sure this is where it's
choking: "dpkg-deb -c foo.deb" vs "dpkg-deb -X foo.deb /tmp". I think
the actual archive reading is done with a system(tar) call, so that
command (and its platform variations, and different fink-installed
versions) could be another place to look for the root cause:

  dpkg-deb --fsys-tarfile foo.deb > archive.tar

to extract the .deb filesystem archive and then try 'tar -xf
archive.tar' with various different tar commands.

dan

-- 
Daniel Macks
dma...@netspace.org
http://www.netspace.org/~dmacks


--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
___
Fink-devel mailing list
Fink-devel@lists.sourceforge.net
http://news.gmane.org/gmane.os.apple.fink.devel
Subscription management:
https://lists.sourceforge.net/lists/listinfo/fink-devel


Re: [Fink-devel] Problem installing sbcl [Bug in dpkg?]

2010-01-03 Thread Martin Costabel
Martin Costabel wrote:
[]
> On 10.6/32bit: Builds but doesn't install
> 
>> Unpacking sbcl (from .../sbcl_1.0.34-1_darwin-i386.deb) ...
>> ### execution of /sw32/bin/dpkg-lockwait failed, exit code 6
>> /sw32/bin/dpkg-deb: subprocess paste killed by signal (Broken pipe)
>> Updating the list of locally available binary packages.
>> Scanning dists/local/main/binary-darwin-i386
>> New package: 
>> dists/local/main/binary-darwin-i386/sbcl_1.0.34-1_darwin-i386.deb
>> Failed: can't install package sbcl-1.0.34-1

I have now found where this chokes: It happens when dpkg tries to 
install the file

/sw/share/doc/sbcl/html/sbcl/Method-sb_002dbsd_002dsockets_003asocket_002dmake_002dstream-_0028_0028socket-socket_0029-_0026key-input-output-_0028element_002dtype-_0027character_0029-_0028buffering-full_0029-_0028external_002dformat-default_0029-timeout_0029.html

If I remove this file in sbcl's InstallScript, then sbcl (1.0.33 and 
1.0.34) installs OK on 10.6/32bit (at least sometimes, at other times it 
produces the sb-posix module build failure I have seen also on 
10.6/64bit occasionally).

This looks like dpkg is not able to handle files with a file name longer 
than 256 characters. On the other hand, I don't understand why this bug 
only shows up on 10.6/32bit and not on 10.6/64bit nor on 10.5/32bit.

-- 
Martin


--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
___
Fink-devel mailing list
Fink-devel@lists.sourceforge.net
http://news.gmane.org/gmane.os.apple.fink.devel
Subscription management:
https://lists.sourceforge.net/lists/listinfo/fink-devel