From: Grigory Batalov <bga@altlinux.ru>
To: devel-kernel@altlinux.ru
Subject: [d-kernel] shmctl: Invalid argument
Date: Tue, 9 Dec 2003 17:29:32 +0300
Message-ID: <20031209172932.709fe253.bga@altlinux.ru> (raw)
[-- Attachment #1: Type: text/plain, Size: 1100 bytes --]
Здравствуйте!
После переезда с ядра 2.4.20-alt10-smp на 2.4.22-std-smp-alt12
от программы amdump (пакет amanda) наблюдаются сообщения:
taper: FATAL shmctl: Invalid argument
Я просмотрел исходники taper, его манипуляции с памятью
можно упростить до прилагаемого файла.
Указанное сообщение соответствует коду в taper.c:
if(shmid == -1) return; /* nothing to destroy */
if(shmctl(shmid, IPC_RMID, NULL) == -1) {
error("shmctl: %s", strerror(errno));
}
При запуске shmtest обычным пользователем видно, что память
выделяется и затем (через заданные 5 сек.) освобождается:
$ ipcs
------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x00000000 262150 bga 700 1048576 1
<skip>
Однако, на ядре 2.4.20-alt10-smp программа завершается
молча, а на 2.4.22-std-smp-alt12 выходит сообщение:
./shmtest: : Unknown error 2339276
С чем это может быть связано?
На сервере два процессора, 2 Гб памяти, остальные пакеты -
из Мастера 2.2.
--
Григорий Баталов,
группа техподдержки
ОАО "Ковдорский ГОК"
[-- Attachment #2: shmtest.c --]
[-- Type: text/plain, Size: 774 bytes --]
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <errno.h>
#include <stdio.h>
#include <unistd.h>
int main(void)
{
int shmid = -1;
char *result;
shmid = shmget(IPC_PRIVATE, 1024*1024, IPC_CREAT|0700);
if(shmid == -1) {
error("shmget: %s", strerror(errno));
exit(1);
}
result = (char *)shmat(shmid, NULL, 0);
if(result == (char *)-1) {
int save_errno = errno;
if(shmctl(shmid, IPC_RMID, NULL) == -1) {
error("shmctl: %s", strerror(errno));
}
errno = save_errno;
error("shmat: %s", strerror(errno));
exit(1);
}
sleep(5);
if(shmctl(shmid, IPC_RMID, NULL) == -1) {
error("shmctl: %s", strerror(errno));
exit(1);
}
if(shmdt(result) == -1) {
error("shmdt: %s", strerror(errno));
exit(1);
}
exit(0);
}
next reply other threads:[~2003-12-09 14:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-12-09 14:29 Grigory Batalov [this message]
2003-12-09 14:50 ` Dmitry V. Levin
2003-12-09 14:55 ` Sergey Vlasov
2003-12-10 6:42 ` Grigory Batalov
2003-12-11 9:57 ` Denis Ovsienko
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=20031209172932.709fe253.bga@altlinux.ru \
--to=bga@altlinux.ru \
--cc=devel-kernel@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 kernel packages development
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/devel-kernel/0 devel-kernel/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-kernel devel-kernel/ http://lore.altlinux.org/devel-kernel \
devel-kernel@altlinux.org devel-kernel@altlinux.ru devel-kernel@altlinux.com
public-inbox-index devel-kernel
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.devel-kernel
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git