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

Bug#345821: marked as done (libstdc++6: Documentation bug in ext/stdio_filebuf.h)



Your message dated Tue, 21 Feb 2006 18:12:15 +0000
with message-id <874q2s60ow.fsf@hardknott.home.whinlatter.ukfsn.org>
and subject line Close
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: libstdc++6
Version: 4.0.2-5
Severity: normal

Using libstdc++, I've got code like this:

  __gnu_cxx::stdio_filebuf<char> fdbuf(fd, std::ios::in);

The doxygen docs for this fd ctor say "The file descriptor will be
automatically closed when the stdio_filebuf is closed/destroyed.", but I
appear to be leaking fds due to making the assumption I was passing
ownership of the fd to this streambuf, and not closing it by hand.

Is this a documentation bug?

I've checked <ext/stdio_filebuf.h>, and I can't see any referece to
close().  The docs for the FILE* ctor say " The FILE* will **not** be
automatically closed when the stdio_filebuf is closed/destroyed.", so it
looks like the docs are wrong in this case.

If this is true, just adding "not" should fix it:

-- System Information:
--- stdio_filebuf.h.old	2006-01-03 18:49:58.653951737 +0000
+++ stdio_filebuf.h	2006-01-03 18:50:31.536432330 +0000
@@ -72,7 +72,7 @@
        *  @param  size  Optimal or preferred size of internal buffer, in chars.
        *
        *  This constructor associates a file stream buffer with an open
-       *  POSIX file descriptor. The file descriptor will be automatically
+       *  POSIX file descriptor. The file descriptor will not be automatically
        *  closed when the stdio_filebuf is closed/destroyed.
       */
       stdio_filebuf(int __fd, std::ios_base::openmode __mode,

I also filed this upstream
(http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25653).


Regards,
Roger


Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (990, 'unstable')
Architecture: powerpc (ppc)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)

Versions of packages libstdc++6 depends on:
ii  gcc-4.0-base                  4.0.2-5    The GNU Compiler Collection (base 
ii  libc6                         2.3.5-10   GNU C Library: Shared libraries an
ii  libgcc1                       1:4.0.2-5  GCC support library

libstdc++6 recommends no packages.

-- no debconf information


--- End Message ---
--- Begin Message ---
This was not a bug (confirmed with upstream), so I'm closing the bug.


Regards,
Roger

-- 
Roger Leigh
                Printing on GNU/Linux?  http://gutenprint.sourceforge.net/
                Debian GNU/Linux        http://www.debian.org/
                GPG Public Key: 0x25BFB848.  Please sign and encrypt your mail.

Attachment: pgpedlOowUYq3.pgp
Description: PGP signature


--- End Message ---

Reply to: