Subject: Re: 4.99.36 very unstable for me(tm)
To: Andrew Doran <ad@netbsd.org>
From: Thomas Klausner <wiz@NetBSD.org>
List: current-users
Date: 11/18/2007 19:31:56
--HlL+5n6rz5pIUxbD
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Sun, Nov 18, 2007 at 03:06:12PM +0000, Andrew Doran wrote:
> I think this is hardware related. What kind of CPU do you have?

cpu0 at mainbus0 apid 0: (boot processor)
cpu0: AMD Athlon(tm) 64 Processor 3500+, 2210.31 MHz
cpu0: features:
efdbfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR>
cpu0: features: efdbfbff<PGE,MCA,CMOV,PAT,PSE36,MPC,NOX,MMXX,MMX>
cpu0: features: efdbfbff<FXSR,SSE,SSE2,RDTSCP,LONG,3DNOW2,3DNOW>
cpu0: features2: 2001<SSE3>
cpu0: I-cache 64 KB 64B/line 2-way, D-cache 64 KB 64B/line 2-way
cpu0: L2 cache 512 KB 64B/line 16-way
cpu0: ITLB 32 4 KB entries fully associative, 8 4 MB entries fully
associative
cpu0: DTLB 32 4 KB entries fully associative, 8 4 MB entries fully
associative
cpu0: AMD Power Management features: 3f<STC,TM,TTP,VID,FID,TS>
cpu0: calibrating local timer
cpu0: apic clock running at 200 MHz
cpu0: 8 page colors

> - Job control signals sent from a tty don't work correctly.

Ah, I've seen that one as well.

For perl, I extracted the problematic code from the configure
script. The attached program prints "that's all right, then" on
NetBSD-2.0.2/i386, but dumps core on 4.99.36/amd64. There is one
compilation warning on amd64, which I don't see on the older i386:
foo.c: In function 'myvfprintf':
foo.c:15: warning: passing argument 3 of 'ivfprintf' from incompatible pointer type

(gdb) r
Starting program: perltest

Program received signal SIGBUS, Bus error.
0x00007f7ffdbc654a in strlen () from /usr/lib/libc.so.12
(gdb) bt
#0  0x00007f7ffdbc654a in strlen () from /usr/lib/libc.so.12
#1  0x00007f7ffdbbf827 in __vfprintf_unlocked () from /usr/lib/libc.so.12
#2  0x00007f7ffdbc0614 in vfprintf () from /usr/lib/libc.so.12
#3  0x00000000004009c5 in ivfprintf (f=0x5012d8,
    fmt=0x400bb6 "%s%cs all right, then\n", valp=0x7f7fffffe298) at foo.c:9
#4  0x00000000004009ec in myvfprintf (f=0x5012d8,
    fmt=0x400bbe "l right, then\n", val=0x7f7fffffe2d0) at foo.c:15
#5  0x0000000000400acf in myprintf (fmt=0x400bb6 "%s%cs all right, then\n")
    at foo.c:23
#6  0x0000000000400b08 in main (ac=1, av=0x7f7fffffe410) at foo.c:31

 Thomas

--HlL+5n6rz5pIUxbD
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="perltest.c"

#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>

int
ivfprintf(FILE *f, const char *fmt, va_list *valp)
{
  return vfprintf(f, fmt, *valp);
}
 
int    
myvfprintf(FILE *f, const  char *fmt, va_list val)
{
  return ivfprintf(f, fmt, &val);
}
      
int
myprintf(char *fmt, ...) 
{
  va_list val;
  va_start(val, fmt);
  return myvfprintf(stdout, fmt, val); 
}         

int
main(int ac, char **av)
{
  signal(SIGSEGV, exit);

  myprintf("%s%cs all right, then\n", "that", '\'');                            
  exit(0);      
}

--HlL+5n6rz5pIUxbD--