This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

__basic_file cleanup


Hello,

When I tried to run a simple 'hello world' program with ElectricFence 
I got segmentation fault in _IO_flush_all on exit. 

The problem is that if __basic_file wasn't opened it leaves pointer to 
itself in libio file descriptor list after it's deletion.

The following patch fixes the problem.

Vadim.


1999-07-09  Vadim Egorov  <egorovv@1c.ru>

	* stc/basic_file.cc:  cleanup in __basic_file destructor

Index: basic_file.cc
===================================================================
RCS file: /cvs/libstdc++/libstdc++/src/basic_file.cc,v
retrieving revision 1.16
diff -c -r1.16 basic_file.cc
*** basic_file.cc	1999/05/05 00:39:12	1.16
--- basic_file.cc	1999/07/09 04:18:59
***************
*** 50,55 ****
--- 50,57 ----
  	if (!(_IO_file_flags & _IO_DELETE_DONT_CLOSE))
  	  _IO_SYSCLOSE(this);
        }
+     else
+       _IO_un_link(this);
    }
        
    __basic_file*


-- 
*********************************************
Vadim Egorov, 1C      *       Вадим Егоров,1C
egorovv@1c.ru         *         egorovv@1c.ru
*********************************************


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]