From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Hideki Yamamoto" Date: Thu, 04 Apr 2002 10:29:46 +0000 Subject: Re: [Linux-ia64] SIGILL errors in strncpu (NAT consumption) Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-ia64@vger.kernel.org Hi there, I have a favor to ask David. If possible, plase give me the patch you had resolved this problem. I have been looking for the patch in all email(linux-ia64) but I could not find this patch. Thanks. > David Mosberger took a look at the strncpy code & spotted > the error: > > From David: > >> I took a closer look and there seem to be several bugs in the routine: > >> > >> (1) I don't think it's save to do: > >> > >> chk.s r[MEMLAT], .recovery3 > >> mov value = r[MEMLAT] > >> > >> in the same cycle. In the patch below, I fixed this by adding a > >> stop bit, but obviously it would be better to avoid that (either > >> by re-ordering the code or by adding a pipeline stage). > >> > >> (2) stop bit was missing after br.cloop.dptk > >> > >> (3) off-by-one error in .recovery4 code: the destination should be > >> r[MEMLAT-1], not r[MEMLAT] > >> > >> (4) I believe the address calcuation in .recovery3 and .recovery4 may > >> also be off by 8; this is just based on eye-balling the code though, > >> so I may be wrong > >> > >> Hope this helps, > >> > >> --david > >> > > > ---- > Test case - run ~12 copies of this in parallel. > > #include > #include > #include > #include > > char *dest, *src; > > void > sigill_handler(int sig) > { > fprintf(stderr,"SIGILL: pid %d, dest 0x%lx, src 0x%lx\n", > getpid(), (long)dest, (long)src); > exit(1); > } > > int > main() { > time_t temp1; > char *p, buffer[1024]; > > signal(SIGILL, sigill_handler); > > time(&temp1); > src = ctime(&temp1); > > dest = buffer; > > printf("%d\n", strlen(src)); > > while(1) > strncpy(buffer,src,strlen(src)); > } > > > -- > Thanks > > Jack Steiner (651-683-5302) (vnet 233-5302) steiner@sgi.com > > > _______________________________________________ > Linux-IA64 mailing list > Linux-IA64@linuxia64.org > http://lists.linuxia64.org/lists/listinfo/linux-ia64 >