[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[microblaze-uclinux] Kernel crash




I am trying to write a program on my uClinux/Microblaze board.
The code is like this:

--------------------------------------------------
#include <stdio.h>
FILE *fd;
int main(int argc,char** argv){
        if(argc<2){
                printf("Hello World\n");
        }
        else{
                printf("Hello %s\n",argv[1]);
        }
/*
        if (fd = fopen("test", 'w') == NULL) {
                printf("file open failed\n");
                exit(0);
        };
*/
        fputs("this is output test\n", fd);

        exit(0);
}


It was compiled and than tested on my board. The system got hanged. I
know that I mistakenly used "fd" before it's assigned to a file. But
should the OS give me a "segmentation fault" instead of freeze? I never
had this kind of problem on normal Linux before.


Jun


___________________________
microblaze-uclinux mailing list
microblaze-uclinux@itee.uq.edu.au
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/