ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: Hihin Ruslan <ruslandh@gmail.com>
To: devel@lists.altlinux.org
Subject: [devel] Ошибка выделения памяти в malloc в 32-х битной архитектуре
Date: Sat, 25 Jul 2015 06:17:28 +0300
Message-ID: <201507250617.36319@ruslandh> (raw)

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

Здравствуйте !

Разбираясь с тем, почему происходит выпадение в core 32-битной 
версии palemoon, пришёл к выводу, что падение происходит в 
функции malloc, а именно на этом участке кода (файл malloc.c из 
glibc-core):

Вызов из palemoon:
 options = malloc (sizeof (cairo_font_options_t));

Код malloc.c:
стр 3350
  if (in_smallbin_range(nb)) {
    idx = smallbin_index(nb);
    bin = bin_at(av,idx);

    if ( (victim = last(bin)) != bin) {
      if (victim == 0) /* initialization check */
	malloc_consolidate(av);
      else {
	bck = victim->bk;
===> (стр 3359)	if (__builtin_expect (bck->fd != victim, 0))
	  {
	    errstr = "malloc(): smallbin double linked list corrupted";
	    goto errout;
	  }
	set_inuse_bit_at_offset(victim, nb);
	bin->bk = bck;
	bck->fd = bin;

	if (av != &main_arena)
	  victim->size |= NON_MAIN_ARENA;
	check_malloced_chunk(av, victim, nb);
	void *p = chunk2mem(victim);
	if (__builtin_expect (perturb_byte, 0))
	  alloc_perturb (p, bytes);
	return p;
      }
    }

А именно, судя по всему в victim->bk находится 0, и bck->fd 
превращается в null->fd.

Это глюк malloc, или неправильное обращение от palemoon?
Мне всё-же кажется, что самого glibc.

-- 
  А ещё говорят так  (fortune):
 
If men acted after marriage as they do during courtship, there 
would be fewer divorces -- and more bankruptcies. -- Frances 
Rodman 
________________________________________________________________________
С уважением Хихин Руслан

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

             reply	other threads:[~2015-07-25  3:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-25  3:17 Hihin Ruslan [this message]
2015-07-25  9:53 ` Dmitry V. Levin
2015-07-25  9:57   ` Руслан Хихин
2015-07-25 10:33     ` Dmitry V. Levin
2015-07-25 15:05       ` Hihin Ruslan
2015-07-25 15:39       ` Hihin Ruslan
2015-07-25 15:51         ` Dmitry V. Levin
2015-07-25 17:20           ` Hihin Ruslan
2015-07-27 11:16           ` Хихин Руслан

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=201507250617.36319@ruslandh \
    --to=ruslandh@gmail.com \
    --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