Bug#413078: Gcc does not work after kernel upgrade
On Fri, 2 Mar 2007 01:39:16 -0700
dann frazier <dannf@debian.org> wrote:
> On Fri, Mar 02, 2007 at 02:13:22PM +0800, Andrew Buckeridge wrote:
> > package: linux-image-2.6.18-4-amd64
> > version: 2.6.18.dfsg.1-11
> >
> > Trivial program now segfault and/or get garbled data from functions.
>
> Please include an example program, and instructions on compiling it.
Right, there is no such thing as a trivial program.
andrewb@thot:~/public_html/c-run$ gcc-3.3 -o 4155-date 4155-date.c; ./4155-date
Segmentation fault
andrewb@thot:~/public_html/c-run$ gcc-3.4 -o 4155-date 4155-date.c; ./4155-date
Segmentation fault
andrewb@thot:~/public_html/c-run$ gcc-4.0 -o 4155-date 4155-date.c; ./4155-date
Segmentation fault
andrewb@thot:~/public_html/c-run$ gcc-4.1 -o 4155-date 4155-date.c; ./4155-date
4280320909.M2475556863P9914.thot
Tue Jul 15 11:33:33 1969
Tue, 15 Jul 1969 19:33:33 +0800
andrewb@thot:~/public_html/c-run$ gcc -o 4155-date 4155-date.c; ./4155-date
4280320909.M2475556863P9914.thot
Tue Jul 15 11:33:33 1969
Tue, 15 Jul 1969 19:33:33 +0800
> Also, what kernel did you upgrade from where this program did work?
kernel-image-2.6.8-12-amd64-k8
2.6.8-16sarge6
>
> --
> dann frazier
>
>
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <unistd.h>
#include <sys/time.h>
#include <string.h>
#include <time.h>
#include <alloca.h>
/* This shite is good for debugging non-std ANSI/ISO C */
/* +Ve == bytes written -Ve == bytes required */
int vunprintf(int fdout, int r, const char *fmt, va_list ap) {
int i;
char *p;
p=alloca(r);
i=vsnprintf(p,r,fmt,ap);
if(i<0)
return 1-2*r;
if(i<r)
return write(fdout,p,i);
else
return -i;
}
/* +Ve == bytes written -Ve == failure */
int vuprintf(int fdout, const char *fmt, va_list ap) {
int i=BUFSIZ;
i=vunprintf(fdout, i, fmt, ap);
if(i<0)
i=vunprintf(fdout, 1-i, fmt, ap);
return i;
}
int uprintf(int fdout, const char *fmt, ...) {
va_list ap;
int r;
va_start(ap, fmt);
r=vuprintf(fdout, fmt, ap);
va_end(ap);
return r;
}
int uputs(char *s, int fdout) {
int l;
l=strlen(s);
if(l>0)
return write(fdout,s,l);
else
return l;
}
int main() {
char *s, h[32], r[64];
int l;
struct timeval *tp;
/* time_t tr; */
/* tr=time(0); */ /* BROKEN arg must be NULL */
l=gettimeofday(tp, 0);
gethostname(h,32);
h[31]=0;
/* Maildir date for message file names */
/*
uprintf(1,"sizeof(tp->tv_sec)==%d %u\n",sizeof(tp->tv_sec),tp->tv_sec);
uprintf(1,"sizeof(tp->tv_usec)==%d %u\n",sizeof(tp->tv_usec),tp->tv_usec);
*/
uprintf(1,"%lu.M%06luP%d.%s\n",tp->tv_sec,
tp->tv_usec,getppid(),h);
/*
fprintf(stdout,"%lu.M%06luP%d.%s\n",tp->tv_sec,
tp->tv_usec,getppid(),h);
fflush(stdout);
*/
/* RFC 4155 date for "^From " headers */
s=asctime(gmtime(&(tp->tv_sec)));
uputs(s,1);
/* RFC 822 date for emails */
strftime(r,64,"%a, %e %b %Y %H:%M:%S %z%n",
localtime(&(tp->tv_sec)));
r[63]=0;
uputs(r,1);
return 0;
/*
exit(0);
*/
}
Reply to: