This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
__basic_file cleanup
- To: "libstdc++@sourceware.cygnus.com" <libstdc++@sourceware.cygnus.com>
- Subject: __basic_file cleanup
- From: Vadim Egorov <egorovv@1c.ru>
- Date: Fri, 09 Jul 1999 08:30:22 +0400
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
*********************************************