From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Sat, 29 Sep 2007 17:28:46 +0200 From: Martin Neubauer To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Subject: Re: [9fans] Page problems Message-ID: <20070929152846.GC801@shodan.homeunix.net> References: <20070929142156.GA801@shodan.homeunix.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Topicbox-Message-UUID: c769a8e6-ead2-11e9-9d60-3106f5b1d025 * erik quanstrom (quanstro@quanstro.net) wrote: > in order for im to return nil, this test has to be true > > if((page < 0 || page >= doc->npage) && !doc->fwdonly) > return nil; > > i think the question is, why is page out of range and what's it's value? > > - erik That happens at startup with the -i option. Somewhere in main is a call of initgfx(nil, 0, nil, nil, 0) in that case. This leads to doc->npage being 0 which puts any value of page out of range in this case. Essentially it's something of a timing issue. Page wants to display an image and looks for it in the cache. At that point the cache is empty because page gets the data via the plumber and the event loop hasn't yet started to process plumbing messages. At least that's as far as I have understood what's going on. And it probably isn't the cause for Greg's problem (which I couldn't reproduce). Martin