Re: Important - MM panic in 2.1.109 [PATCH + Oops]

Michael L. Galbraith (mikeg@weiden.de)
Wed, 22 Jul 1998 16:37:29 +0200 (MET DST)


This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime@docserver.cac.washington.edu for more info.

---876492614-694105881-901118249=:440
Content-Type: TEXT/PLAIN; charset=US-ASCII

On Fri, 17 Jul 1998, Itai Nahshon wrote:

> 1. I sent a similar report some time ago.. the panic still happens.
> The problem is when unmapping the last part (but not all) of
> a segment acquired by shmget + shmat. Ref count goes down to 0
> and then the segment is reused!!

Hi Folks,

I've attached an oops for _real_ hackers to examine. Patch follows.
It should illuminate the problem, and at least does stop the oops.

<CRINGE>

--- linux-2.1.111-pre1/ipc/shm.c.org Wed Jul 22 13:07:27 1998
+++ linux-2.1.111-pre1/ipc/shm.c Wed Jul 22 15:56:50 1998
@@ -626,7 +626,12 @@
remove_attach(shp,shmd); /* remove from shp->attaches */
shp->shm_lpid = current->pid;
shp->shm_dtime = CURRENT_TIME;
- if (--shp->shm_nattch <= 0 && shp->shm_perm.mode & SHM_DEST)
+ /* FIXME: If vm_end = vm_start, we are doing unmap_fixup().
+ * This is very fragile and stupid. It's also the best I
+ * could come up with without special casing unmap_fixup().
+ */
+ if (--shp->shm_nattch <= 0 && shp->shm_perm.mode & SHM_DEST
+ && shmd->vm_end != shmd->vm_start)
killseg (id);
}

</CRINGE>

We accept VISA, MASTERCARD, cool ideas...

Energize Scotty! ;-)

-Mike

---876492614-694105881-901118249=:440
Content-Type: TEXT/PLAIN; charset=US-ASCII; name=shm_oops
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.3.95.980722163729.440B@mikeg.weiden.de>
Content-Description: the oops

c2htX29wZW46IHVudXNlZCBpZD0wIFBBTklDDQpVbmFibGUgdG8gaGFuZGxl
IGtlcm5lbCBOVUxMIHBvaW50ZXIgZGVyZWZlcmVuY2UgYXQgdmlydHVhbCBh
ZGRyZXNzIDAwMDAwMDI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x
M2VhMzMgPHNobV9jbG9zZSs0Yy83Nj4gIDg5IDQxIDE4ICAgICAgIAltb3Zs
ICAgJWVheCwweDE4KCVlY3gpDQpDb2RlOiBjMDEzZWEzYyA8c2htX2Nsb3Nl
KzU1Lzc2PiAgNjYgOGIgNDEgMjQgICAgCW1vdncgICAweDI0KCVlY3gpLCVh
eA0KQ29kZTogYzAxM2VhNDAgPHNobV9jbG9zZSs1OS83Nj4gIDg5IGM3ICAg
ICAgICAgIAltb3ZsICAgJWVheCwlZWRpDQpDb2RlOiBjMDEzZWE0MiA8c2ht
X2Nsb3NlKzViLzc2PiAgNGYgICAgICAgICAgICAgCWRlY2wgICAlZWRpDQo=
---876492614-694105881-901118249=:440--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html