[lkml]   [2000]   [Jul]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectSIGSEGV on fclose.
    On linux I get a SIGSEGV, Segmentation fault if I close a nonopen file.

    On unix platforms, this is either simply ignored or an appropiate
    errormessage is returned, and according to the linux manualpage fclose
    on linux should return EBADF.

    I have testet the following example on AIX 4.3, Solaris 7, FreeBSD 4.0,
    TRU64, HPUX 10.20, SCO ODT5, linux kernel 2.2.15 and linux kernel

    in case you wonder: the problem arises from a program that closes a
    file twice because it does not know that the file is allready closed.


    #include <stdio.h>

    FILE *new;

    main () {

    fclose (new); /* <---- SIGSEGV on linux only */

    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 13:57    [W:0.021 / U:51.524 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site