reassign 552125 libdpkg-ruby1.8 owner 552125 ! quit On Sun, Oct 25, 2009 at 07:24:42PM +0100, Francesco Poli wrote: > On Fri, 23 Oct 2009 09:36:53 -0500 Joseph Rawson wrote: > > Hi Joseph, > thanks for reporting this issue. > > [...] > > I got this error while upgrading to sid today: > > > > /usr/lib/ruby/1.8/debian.rb:905:in `initialize': regular expression too > > big: > > (a long list of packages, separated with "|", then) > > > > > > (RegexpError) > > from /usr/lib/ruby/1.8/debian.rb:905:in `new' > > from /usr/lib/ruby/1.8/debian.rb:905:in `initialize' > > from /usr/sbin/apt-listbugs:995:in `new' > > from /usr/sbin/apt-listbugs:995:in `create' > > from /usr/sbin/apt-listbugs:1375 > > E: Sub-process /usr/sbin/apt-listbugs apt || exit 10 returned an error code > > (10) > > E: Failure running script /usr/sbin/apt-listbugs apt || exit 10 > > A package failed to install. Trying to recover: > > By looking at the error message you received, it seems that the large > number of packages to be upgraded caused an attempt to build too big a > regular expression. > How many packages were you trying to upgrade in one single step? > > I don't think that the Ruby Regexp class has some hard-coded limitation > for the regular expression length. Can it be that it failed because it > went out of available memory? > What is the total capacity of the main memory on your system? >
I took a read through ruby's code. apparently it does have a hard-coded limitation. ruby would have said "memory exhausted" if it was a problem with the system not having enough memory. assuming that I'm reading the code correctly, it looks like we could do this instead: info =~ /Packages: (.*)/; pkgs.include?($1) I wonder if that would cause a performance hit (or other undesired side affects). If not we could just build up an array of regexps (to keep it correctly sized) and test against all of them. > By looking at the code, the line of code that causes the issue is > basically > /usr/sbin/apt-listbugs:995 > (in apt-listbugs/0.0.89) > which is now moved to > /usr/share/apt-listbugs/apt-listbugs/logic.rb:806 > (in apt-listbugs/0.1.0 and in master branch on the git repository) > but is unchanged, as the substance of the rest of the create() method. > This means that upgrading to current apt-listbugs/0.1.0 won't probably > help in solving the issue. > > However, the error is actually generated by > /usr/lib/ruby/1.8/debian.rb:905 > (in package libdpkg-ruby1.8/0.3.2). > thanks for doing this analysis. > I think that, if there's a way to cope with this issue (maybe by > splitting too long regular expressions into partial regular expressions > based on shorter package sub-lists?), it should be implemented at the > libdpkg-ruby1.8 level, rather than at the apt-listbugs level. > I agree. > I would like to hear from Ryan (the other co-maintainer of > apt-listbugs): if Ryan agrees with this analysis, I think the bug > should be re-assigned to libdpkg-ruby1.8 version 0.3.2 and fixed there. > > Ryan, what do you think? > I will look into this further and come up with a solution. -- _________________________ Ryan Niebur ryanrya...@gmail.com
signature.asc
Description: Digital signature