Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!rochester!pt.cs.cmu.edu!wb1.cs.cmu.edu!avie From: avie@wb1.cs.cmu.edu (Avadis Tevanian) Newsgroups: comp.os.mach Subject: Re: bug in Mach 2.5 in copy-on-write? Message-ID: <10107@pt.cs.cmu.edu> Date: 4 Aug 90 06:39:37 GMT References: <10871@spool.cs.wisc.edu> Organization: NeXT, Inc. Lines: 21 In article <10871@spool.cs.wisc.edu> shekita@provolone.cs.wisc.edu (E Shekita) writes: > >for (i = 0; i < 100; i++) { .... > source_page[0] = 'a'; .... > vm_read(task_self(), (vm_address_t) source_page, vm_page_size, > (vm_address_t*) &destination_page, &readCount); .... > destination_page[0] = 'b'; No bug here... if you remember that both the source and destination pages are set to copy-on-write then you realize that each time you touch the source page after the vm_read you generate another COW fault. The result you get of 199 is exactly as expected. -- Avadis Tevanian, Jr. (Avie) Manager, System Software NeXT, Inc. avie@NeXT.COM