ALT Linux Team development discussions
 help / color / mirror / Atom feed
* [devel] Ошибка выделения памяти в malloc в 32-х битной архитектуре
@ 2015-07-25  3:17 Hihin Ruslan
  2015-07-25  9:53 ` Dmitry V. Levin
  0 siblings, 1 reply; 9+ messages in thread
From: Hihin Ruslan @ 2015-07-25  3:17 UTC (permalink / raw)
  To: devel

[-- 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 --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-07-27 11:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-25  3:17 [devel] Ошибка выделения памяти в malloc в 32-х битной архитектуре Hihin Ruslan
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           ` Хихин Руслан

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