From: Ivan Zakharyaschev <imz@altlinux.org>
To: ALT Linux Team development discussions <devel@lists.altlinux.org>
Subject: Re: [devel] [SCM] packages/apt: tags/0.5.15lorg2-alt74
Date: Tue, 22 Oct 2019 19:52:08 +0300 (MSK)
Message-ID: <alpine.LFD.2.20.1910221948520.28829@imap.altlinux.org> (raw)
In-Reply-To: <20191022153259.GA1096@altlinux.org>
[-- Attachment #1: Type: text/plain, Size: 2316 bytes --]
On Tue, 22 Oct 2019, Dmitry V. Levin wrote:
> On Tue, Oct 22, 2019 at 03:28:40PM +0300, Anton Farygin wrote:
> > On 22.10.2019 11:32, Dmitry V. Levin wrote:
> > > On Tue, Oct 22, 2019 at 03:01:16AM +0300, Michael Shigorin wrote:
> > >> On Tue, Oct 22, 2019 at 02:42:06AM +0300, Dmitry V. Levin wrote:
> > >>> On Tue, Sep 17, 2019 at 09:05:15AM +0000, Aleksei Nikiforov wrote:
> > >>>> Update of /people/darktemplar/packages/apt.git
> > >>>> 0.5.15lorg2-alt74
> > >>>> - Added debugging output for allocation functions.
> > >>>> - Fixed dynamic memory allocation pointer arithmetics issue.
> > >>> Жаль, что вы не дождались первого апреля, но всё равно спасибо,
> > >>> шутка получилась отличная.
> > >> В смысле про fixed?
> > > Именно.
> > >
> > > Этот патч увеличивает расход оперативной памяти apt'ом в среднем в полтора
> > > раза, но не исправляет UB с арифметикой указателей, поскольку MMap::Base
> > > как был невыровненным, так и остался невыровненным. В отличие от Debian,
> > > между прочим, где по умолчанию MMap::Base выровнен на начало страницы.
> > >
> > Я не вижу разницы в адресе MMap::Base на Debian и у нас - в обоих
> > случаях он выровнен на начало страницы.
>
> У Алексея:
>
> void *tmp_base = realloc(Base, newSize);
>
> if (debug_grow)
> _error->Warning(_("DynamicMMap::Grow: realloc from %llu to %llu, result: %s"), WorkSpace, newSize, (tmp_base == n
>
> if (tmp_base == NULL)
> return false;
>
> Base = tmp_base;
Если не ошибаюсь, realloc используется только в особых случаях (когда в
файл не можем писать, например, когда не-root).
Проблема с попорченными адресами на e2k проявлялась одинаково и при
использовании mremap, и при realloc.
Может быть, есть какая-то разница с Debian в первоначальной аллокации, но
в той части, где делаются последующие mremap, нет, насколько я понимаю.
> В Debian по умолчанию:
>
> #ifdef MREMAP_MAYMOVE
>
> if ((Flags & Moveable) == Moveable)
> Base = mremap(Base, WorkSpace, newSize, MREMAP_MAYMOVE);
> else
> #endif
> Base = mremap(Base, WorkSpace, newSize, 0);
>
> if(Base == MAP_FAILED)
> return false;
>
> Всё ещё не видно разницы?
>
>
> --
> ldv
>
next prev parent reply other threads:[~2019-10-22 16:52 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-21 23:42 ` Dmitry V. Levin
2019-10-22 0:01 ` Michael Shigorin
2019-10-22 8:32 ` Dmitry V. Levin
2019-10-22 12:28 ` Anton Farygin
2019-10-22 12:46 ` Anton Farygin
2019-10-22 15:32 ` Dmitry V. Levin
2019-10-22 15:51 ` Anton Farygin
2019-10-22 16:52 ` Ivan Zakharyaschev [this message]
2019-10-24 13:59 ` Aleksei Nikiforov
2019-10-24 15:10 ` Andrey Savchenko
2019-10-24 15:29 ` Aleksei Nikiforov
2019-10-24 15:50 ` Andrey Savchenko
2019-10-24 16:01 ` Aleksei Nikiforov
2019-10-24 16:54 ` Andrey Savchenko
2019-10-25 7:23 ` Aleksei Nikiforov
2019-10-22 4:06 ` Anton Farygin
2019-10-22 15:35 ` Alexey Tourbin
2019-10-23 12:46 ` Dmitry V. Levin
2019-10-24 13:58 ` Aleksei Nikiforov
2019-10-24 15:20 ` Ivan Zakharyaschev
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.1910221948520.28829@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