ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: Ivan Zakharyaschev <imz@altlinux.org>
To: ALT Linux Team development discussions <devel@lists.altlinux.org>
Subject: Re: [devel] re APT patch with impossible error on "Can't allocate an item of size zero"
Date: Thu, 13 Feb 2020 17:51:47 +0300 (MSK)
Message-ID: <alpine.LFD.2.20.2002131749050.6363@imap.altlinux.org> (raw)
In-Reply-To: <2007feb6-b08c-b463-a0fe-d51a264bee45@altlinux.org>

[-- Attachment #1: Type: text/plain, Size: 1850 bytes --]


On Thu, 13 Feb 2020, Aleksei Nikiforov wrote:

> 13.02.2020 05:08, Ivan Zakharyaschev пишет:
> > В ветке sisyphus_one_more_time в
> > git://git.altlinux.org/people/darktemplar/packages/apt.git в коммите
> > 
> > commit f53c1af17e2997ff6d2e23139bc61f5d5c82a547
> > Author: Aleksei Nikiforov <darktemplar@altlinux.org>
> > Date:   Tue Jun 11 14:53:47 2019 +0300
> > 
> >      dynamic memory management: apt-pkg/pkgcachegen.{cc,h} changes
> >      
> >      make the used MMap moveable (and therefore dynamic resizeable) by
> >      applying (some) mad pointer magic
> >      
> >      Ported from Apt from Debian
> >      
> >      Closes: https://bugzilla.altlinux.org/37373
> >      
> >      Change-Id: I4583e13077e7504ec8f59df4bcf3bc825eaf6202
> > 
> > есть такой hunk касательно DynamicMMap::RawAllocate():
> > 
> > diff --git a/apt/apt-pkg/contrib/mmap.cc b/apt/apt-pkg/contrib/mmap.cc
> > index d7a5c3a68..36dc11524 100644
> > --- a/apt/apt-pkg/contrib/mmap.cc
> > +++ b/apt/apt-pkg/contrib/mmap.cc
> > @@ -226,6 +245,12 @@ unsigned long DynamicMMap::RawAllocate(unsigned long
> > Size,unsigned long Aln)
> >      size in the file. */
> >   unsigned long DynamicMMap::Allocate(unsigned long ItemSize)
> >   {
> > +   if (ItemSize == 0)
> > +   {
> > +      _error->Error("Can't allocate an item of size zero");
> > +      return 0;
> > +   }
> > +
> >      // Look for a matching pool entry
> >      Pool *I;
> >      Pool *Empty = 0;
> > 
> > (Весь контекст изменений в этой функции в конце письма.)
> > 
> > Во-первых, почему бы это изменение не оформить отдельным коммитом, ведь
> 
> Если в этом есть необходимость, пожалуй, можно вынести это изменение в
> отдельный коммит. А она есть?

Не берусь оценить серьёзность необходимости, но так же нам (нынешним и 
будущим APT-программистам) легче будет изучать изменения.

-- 
Best regards,
Ivan

      parent reply	other threads:[~2020-02-13 14:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-13  2:08 Ivan Zakharyaschev
2020-02-13  2:43 ` Ivan Zakharyaschev
2020-02-13 12:59 ` Aleksei Nikiforov
2020-02-13 14:10   ` Ivan Zakharyaschev
2020-02-13 17:05     ` Ivan Zakharyaschev
2020-02-17  8:41     ` Ivan Zakharyaschev
2020-02-17 14:05       ` Andrey Savchenko
2020-02-17 17:48         ` Ivan Zakharyaschev
2020-02-17 21:35       ` Dmitry V. Levin
2020-02-17 21:58         ` Ivan Zakharyaschev
2020-02-13 14:51   ` Ivan Zakharyaschev [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.2.20.2002131749050.6363@imap.altlinux.org \
    --to=imz@altlinux.org \
    --cc=devel@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git