Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 01 Oct 1999 17:13:06 -0400 (EDT)
From:      Mike Heffner <spock@techfour.net>
To:        freebsd-questions@freebsd.org
Subject:   program breaks with stable->current upgrade
Message-ID:  <XFMail.991001171306.spock@techfour.net>

next in thread | raw e-mail | index | archive | help
hi, i have just recently upgraded to current from stable, and a program which i
 use doesn't work anymore. the program dies with a signal 8, floating point
exception during runtime. after investigating, i found that the problem is that
it uses nested calls to __builtin_apply(). (a builtin function in gcc, allows
the calling of other functions with a variable number of args). the program
worked fine under -stable, but no longer works under -current. i don't think
this is a result of not being compatible with current, but rather something
that just got accidently broken between the two distributions.

is there any way to fix this problem?  

Thanks,   
---------------------------------
Mike Heffner <spock@techfour.net>
Fredericksburg, VA
ICQ# 882073
Date: 01-Oct-99   Time: 16:59:22
---------------------------------

this is a short program which demonstrates the problem. when a function returns
that has been called with __builtin_apply() from within another function called
with __builtin_apply(), it will die/core dump with a SIGFPE.

/* example.c - spock@techfour.net */
#include <stdio.h>

int fb(int);
int fc(int);
int fa (int a){
        printf("(fa) blah = %d\n", a);
        a++;
        __builtin_apply((void *)fb, __builtin_apply_args(), 32);
        return 1;
}
int fb (int b){
        printf("(fb) blah = %d\n", b);
        b++;
        __builtin_apply((void *)fc, __builtin_apply_args(), 32);
        return 1;
}
int fc(int c){
        printf("(fc) blah = %d\n", c);
        return 1;
        /* program will crash immediately after returning from this
         * function */
}
main(){
        int blah=1;
        fa(blah);
}
/* end example.c */



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.991001171306.spock>