Subject: Bug#3523: "strace ipcs" core dumps

From: [email-masked] (Neil Turton)
Date: Fri, 5 Jul 96 17:29 BST

Package: strace
Version: 3.0-5

  The above version of strace core dumps when it encounters a ipc
system call.  I can reproduce the problem reliably on three machines,
and the problem does not occur with version 3.0-3 on any of the
machines.  If you have any trouble reproducing this, I have a core
file.  I have deleted lines from the typescript below, but have made
it clear where I have done so.  System call 0x75=117 is ipc.

  I am using kernel version 2.0.0 and one machine was running the
distributed kernel.

  Script started on Fri Jul  5 16:52:57 1996
  userg:~# strace-3.0-5 ipcs
  mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 4294967295, 0) = 0x40006000
[ipcs loads it's shared libraries and checks out the locale]
  fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(4, 192), ...}) = 0
  brk(0x800a000)                          = 0x800a000
  ioctl(1, 0x5401, {B9600 opost isig icanon echo ...}) = 0
  write(1, "\n", 1
  )                       = 1
  Segmentation fault (core dumped)
  userg:~# ./strace-3.0-3 ipcs
  mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|0x20, 4294967295, 0) = 0x40006000
[much the same as above.  MAP_ANONYMOUS's different etc.]
  fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(4, 192), ...}) = 0
  brk(0x800a000)                          = 0x800a000
  ioctl(1, TCGETS, {B9600 opost isig icanon echo ...}) = 0
  write(1, "\n", 1
  )                       = 1
  shmat(0, 0xe, 0, 0xbffffdd4)            = 0
  write(1, "------ Shared Memory Segments --"..., 39------ Shared Memory Segments --------
  ) = 39
[ipcs does a couple of other ipc calls, and displays the information]
  write(1, "\n", 1
  )                       = 1
  _exit(0)                                = ?
  userg:~# strace strace-3.0-5 ipcs
  mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 4294967295, 0) = 0x40006000
[etc...]
  --- SIGCHLD (Child exited) ---
  sigprocmask(SIG_SETMASK, [], NULL)      = 0
  wait4(-1, [WIFSTOPPED(s) && WSTOPSIG(s) == SIGTRAP], 0, NULL) = 1721
  sigprocmask(SIG_BLOCK, [HUP INT QUIT TERM], NULL) = 0
  ptrace(PTRACE_PEEKUSER, 1721, 4*ORIG_EAX, [0x4]) = 0
  ptrace(PTRACE_PEEKUSER, 1721, 4*EAX, [0x1]) = 0
  write(2, ")                       = 1\n", 28)                       = 1
  ) = 28
  ptrace(PTRACE_SYSCALL, 1721, 0x1, 0)    = 0
  --- SIGCHLD (Child exited) ---
  sigprocmask(SIG_SETMASK, [], NULL)      = 0
  wait4(-1, [WIFSTOPPED(s) && WSTOPSIG(s) == SIGTRAP], 0, NULL) = 1721
  sigprocmask(SIG_BLOCK, [HUP INT QUIT TERM], NULL) = 0
  ptrace(PTRACE_PEEKUSER, 1721, 4*ORIG_EAX, [0x75]) = 0
  ptrace(PTRACE_PEEKUSER, 1721, 4*EAX, [0xffffffda]) = 0
  ptrace(PTRACE_PEEKUSER, 1721, 4*EBX, [0x18]) = 0
  ptrace(PTRACE_PEEKUSER, 1721, 4*ECX, [0]) = 0
  ptrace(PTRACE_PEEKUSER, 1721, 4*EDX, [0xe]) = 0
  ptrace(PTRACE_PEEKUSER, 1721, 4*ESI, [0]) = 0
  ptrace(PTRACE_PEEKUSER, 1721, 4*EDI, [0xbffffdd4]) = 0
  --- SIGSEGV (Segmentation fault) ---
  +++ killed by SIGSEGV +++
  userg:~# exit
  exit

  Script done on Fri Jul  5 16:53:37 1996

Neil.
+--------------------------------------------------+----------------------+
| Neil Turton, Assistant computer officer          | Snail Mail to:       |
|  Churchill College                               |  Churchill college,  |
| http://www.chu.cam.ac.uk/home/ndt1001/home.html  |  Cambridge. CB3 0DS. |
+--------------------------------------------------+----------------------+
| GCM(M) d H s+:- !g p0>+ !au(-) a- w+ v C+++@ UL++++$(+++) P+ L+++ 3-    |
| E++ N-(+) K- W--- M-- V po Y+ t-- 5 !j R- G? !tv(-) b+ D+ B? e+++ u(*)  |
| h-- f !r>+++ n+ y?                                                      |
+-------------------------------------------------------------------------+

---

From: [email-masked] (Wichert Akkerman)
Date: Mon, 8 Jul 1996 14:25:12 +0200 (MDT)

'lo!

:->   The above version of strace core dumps when it encounters a ipc
:-> system call.  I can reproduce the problem reliably on three machines,
:-> and the problem does not occur with version 3.0-3 on any of the
:-> machines.

I've uploaded strace_3.1-2 sometime ago to master. Could you check if
the problem also occurs on that version? I'll try to reproduce the
problem over here.

Grtz,
  Wichert.

---

From: Neil Turton <[email-masked]>
Date: Tue, 9 Jul 96 09:58 BST

Hello!

> the problem also occurs on that version? I'll try to reproduce the

  It doesn't seem to have surfaced yet.  At least I couldn't find it.
The latest I could find was 3.0-5.  I presume I'm looking in the right
place: "{stable,unstable}/binary-i386/devel/strace*".

Neil.