From owner-freebsd-hackers Mon Dec 11 22:25:22 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id WAA10445 for hackers-outgoing; Mon, 11 Dec 1995 22:25:22 -0800 (PST) Received: from yokogawa.co.jp (yhqfm.yokogawa.co.jp [202.33.29.34]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id WAA10439 for ; Mon, 11 Dec 1995 22:25:14 -0800 (PST) Received: from sjc.yokogawa.co.jp ([133.140.4.100]) by yokogawa.co.jp (8.6.9+2.4Wb3/3.3Wb4-firewall:08/09/94) with SMTP id PAA29538 for ; Tue, 12 Dec 1995 15:25:11 +0900 Received: from leia.pa.yokogawa.co.jp by sjc.yokogawa.co.jp (4.1/6.4J.6-YOKOGAWA-R/GW) id AA07147; Tue, 12 Dec 95 15:25:10 JST Received: from cabbage by leia.pa.yokogawa.co.jp (16.8/6.4J.6-YOKOGAWA/pa) id AA27525; Tue, 12 Dec 95 15:25:09 +0900 Received: by cabbage.pa.yokogawa.co.jp (16.6/3.3Wb) id AA08759; Tue, 12 Dec 95 15:25:33 +0900 Date: Tue, 12 Dec 95 15:25:33 +0900 From: Mihoko Tanaka Message-Id: <9512120625.AA08759@cabbage.pa.yokogawa.co.jp> To: freebsd-hackers@freebsd.org Subject: ipcs bug Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-hackers@freebsd.org Precedence: bulk Hi all, I found a trouble in 'ipcs' command. If SHMMNI is bigger than MSGMNI, ipcs occurs core dump. The 'ipcs' allocates the buffer for the shared memory information , but its size is wrong. In /usr/src/usr.bin/ipcs/ipcs.c: if (display & SHMINFO) { struct shmid_ds *xshmids; kvm_read(kd, symbols[X_SHMSEGS].n_value, &shmsegs, sizeof(shmsegs)); xshmids = malloc(sizeof(struct shmid_ds) * msginfo.msgmni); ~~~~~~~~~~~~~~~ I think that it should be 'shminfo.msgmni' ----------------- cut here ---------------------------------- --- ipcs.c Mon Sep 19 19:24:38 1994 +++ ipcs.c.new Tue Dec 12 15:08:07 1995 @@ -310,7 +310,7 @@ struct shmid_ds *xshmids; kvm_read(kd, symbols[X_SHMSEGS].n_value, &shmsegs, sizeof(shmsegs)); - xshmids = malloc(sizeof(struct shmid_ds) * msginfo.msgmni); + xshmids = malloc(sizeof(struct shmid_ds) * shminfo.shmmni); kvm_read(kd, (u_long) shmsegs, xshmids, sizeof(struct shmid_ds) * shminfo.shmmni); ----------------- cut here ---------------------------------- -- Mihoko Tanaka