ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: Igor Homyakov <homyakov@ramax.spb.ru>
To: ALT Devel discussion list <devel@altlinux.ru>
Cc: ldv@altlinux.ru
Subject: Re: [devel] [Monit] SIGSEGV ][
Date: Fri, 29 Aug 2003 15:01:14 +0400
Message-ID: <20030829110114.GB18868@kadath.office.spb.ramax.ru> (raw)
In-Reply-To: <20030821123315.GA24314@osdn.org.ua>


Экспериментальным путем выяснилось что этот именно резолвер.

workaround:
 - писать полный e-mail в alert, то есть вместо
   alert admin
   хотя бы    
   alert admin@localhost

 - всегда писать по какому IP проверять соединение,
   вместо
   port 22 use proto ssh
   писать
   host 10.4.1.10 port 22 use proto ssh

SIGSEGV имеет весьма интересное свойство, если смотреть traceback
то валиться совершенно в другом мечте (например у меня падало на 
вызове syslog, а при отладке казалось что память портил перед этим sprinf)

вот что по этому поводу сказал Ulrich Drepper:
Every program which crashes is glibc's fault.  Get real. 
Any malloc operation after a heap corruption will cause the
program to crash at the next allocation.  A bug in the
program before a syslog() call will cause syslog to fail but
it is not the cause.

танцы с glibc-nss-2.2.6-alt0.3 мне в своё время не помогли

* Michael Shigorin <mike@osdn.org.ua> [030821 16:32]:
> On Wed, Sep 25, 2002 at 01:45:53PM +0400, Dmitry V. Levin wrote:
> > > > > > > > > У меня странная картина, monit из Сизифа валиться на пустом месте 
> > > > > > > > > с SIGSERV. А собранный локально нормально работает.
> > > > > > Если приложение многопоточное и при этом нити используют get{host,net}by*,
> > > > > > то 99% что #0001259; traceback при этом ведет в libnss_XXX.
> > > > В таком случае применимы те же workaround'ы, что и для mysqld.
> > glibc-nss-2.2.6-alt0.3

> Так.  А что делать, если локально собранный 3.2-alt1 имени Игоря
> валится, причем даже при /etc/monitrc вида

> ---
> set daemon 120
> set logfile syslog
> set mailserver localhost
> set mail-format {
>         from: root@inmetex.com.ua
>         subject: [monit] -- $PROGRAM $EVENT on $HOST at $DATE
>         message:
> }
> check syslogd with pidfile /var/run/syslogd.pid
>         start program = "/etc/init.d/syslogd start"
>         stop  program = "/etc/init.d/syslogd stop"
>         alert admin 
>         group system
> ---

> (разумеется, /var/run/syslogd.pid существует и содержит правильный PID)

> Конец strace -ff выглядит так:

> ---
> read(4, "127.0.0.1\t\tlocalhost.localdomain"..., 4096) = 43
> read(4, "", 4096)                       = 0
> close(4)                                = 0
> munmap(0x123000, 4096)                  = 0
> uname({sys="Linux", node="trickster.inmetex", ...}) = 0
> read(3, "", 8192)                       = 0
> ioctl(3, TCGETS or SNDCTL_TMR_TIMEBASE, 0xbffff270) = -1 ENOTTY (Inappropriate ioctl for device)
> close(3)                                = 0
> munmap(0x122000, 4096)                  = 0
> stat64("/var/run/syslogd.pid", {st_mode=S_IFREG|0644, st_size=5, ...}) = 0
> stat64("/var/run/syslogd.pid", {st_mode=S_IFREG|0644, st_size=5, ...}) = 0
> open("/var/run/syslogd.pid", O_RDONLY)  = 3
> fstat64(3, {st_mode=S_IFREG|0644, st_size=5, ...}) = 0
> mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x122000
> read(3, "1186\n", 4096)                 = 5
> close(3)                                = 0
> munmap(0x122000, 4096)                  = 0
> getpgid(0x4a2)                          = 1186
> getuid32()                              = 0
> stat64("/var/run/monit.pid", 0xbffff770) = -1 ENOENT (No such file or directory)
> --- SIGSEGV (Segmentation fault) @ 0 (0) ---
> +++ killed by SIGSEGV +++
> ---

> touch /var/run/monit.pid или помещение туда несуществующего PID =>

> ---
> stat64("/var/run/monit.pid", {st_mode=S_IFREG|0644, st_size=5, ...}) = 0
> stat64("/var/run/monit.pid", {st_mode=S_IFREG|0644, st_size=5, ...}) = 0
> open("/var/run/monit.pid", O_RDONLY)    = 3
> fstat64(3, {st_mode=S_IFREG|0644, st_size=5, ...}) = 0
> mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x122000
> read(3, "2325\n", 4096)                 = 5
> close(3)                                = 0
> munmap(0x122000, 4096)                  = 0
> getpgid(0x915)                          = -1 ESRCH (No such process)
> --- SIGSEGV (Segmentation fault) @ 0 (0) ---
> +++ killed by SIGSEGV +++
> ---

> Помещение туда PID "левого" существующего процесса приводит к отправке ему
> SIGUSR1 и счастливому завершению monit:

> ---
> stat64("/var/run/monit.pid", {st_mode=S_IFREG|0644, st_size=6, ...}) = 0
> stat64("/var/run/monit.pid", {st_mode=S_IFREG|0644, st_size=6, ...}) = 0
> open("/var/run/monit.pid", O_RDONLY)    = 3
> fstat64(3, {st_mode=S_IFREG|0644, st_size=6, ...}) = 0
> mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x122000
> read(3, "31193\n", 4096)                = 6
> close(3)                                = 0
> munmap(0x122000, 4096)                  = 0
> getpgid(0x79d9)                         = 31193
> kill(31193, SIGUSR1)                    = 0
> write(2, "monit daemon at 31193 awakened\n", 31monit daemon at 31193 awakened
> ) = 31
> _exit(0)                                = ?
> ---

> Для удобства:
> ftp://ftp.altlinux.org/pub/people/mike/misc/monit-3.2-alt1.src.rpm

> -- 
>  ---- WBR, Michael Shigorin <mike@altlinux.ru>
>   ------ Linux.Kiev http://www.linux.kiev.ua/




-- 
Igor V. Homyakov                         RAMAX International
System Administrator         Banking Technologies Department
<igor.homyakov(at)ramax.ru>              http://www.ramax.ru


  reply	other threads:[~2003-08-29 11:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-23 15:57 [devel] [Monit] SIGSEGV Igor Homyakov
2002-09-23 16:24 ` Dmitry V. Levin
2002-09-23 16:12   ` Igor Homyakov
2002-09-23 16:46     ` Dmitry V. Levin
2002-09-23 16:48       ` Igor Homyakov
2002-09-23 17:15         ` Dmitry V. Levin
2002-09-25  8:49           ` Igor Homyakov
2002-09-25  9:45             ` Dmitry V. Levin
2003-08-21 12:33               ` [devel] [Monit] SIGSEGV ][ Michael Shigorin
2003-08-29 11:01                 ` Igor Homyakov [this message]
2003-08-29 11:03                   ` [devel] " Michael Shigorin

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=20030829110114.GB18868@kadath.office.spb.ramax.ru \
    --to=homyakov@ramax.spb.ru \
    --cc=devel@altlinux.ru \
    --cc=ldv@altlinux.ru \
    /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