#1976 Memory usage with future and STL containers

libstdc++ (5)

Hi there,

I have found a problem when using std::future in containers. See full description of the problem here:


See also the comments of other users; in particular, someone tried gcc 4.7.2 in Linux. Therefore, everything points towards a bug in MinGW and/or its STL implementation.


The environment was Qt5.0.1, Qt Creator 2.6.2. Windows 7. Intel and AMD.

D:\Qt\Qt5\Tools\MinGW\bin>gcc -v
Using built-in specs.
Target: i686-w64-mingw32
Configured with: ../../../src/gcc-4.7.2/configure --host=i686-w64-mingw32 --buil
d=i686-w64-mingw32 --target=i686-w64-mingw32 --prefix=/temp/x32-4.7.2-posix-sjlj
-r8/prefix --with-sysroot=/temp/x32-4.7.2-posix-sjlj-r8/prefix --enable-shared -
-enable-static --enable-targets=all --enable-multilib --enable-languages=c,c++,f
ortran,lto --enable-libstdcxx-time=yes --enable-threads=posix --enable-libgomp -
-enable-lto --enable-graphite --enable-cloog-backend=isl --enable-checking=relea
se --enable-fully-dynamic-string --enable-version-specific-runtime-libs --enable
-sjlj-exceptions --disable-ppl-version-check --disable-cloog-version-check --dis
able-libstdcxx-pch --disable-libstdcxx-debug --disable-bootstrap --disable-rpath
--disable-win32-registry --disable-nls --disable-werror --disable-symvers --wit
h-gnu-as --with-gnu-ld --with-arch-32=i686 --with-arch-64=nocona --with-tune-32=
core2 --with-tune-64=core2 --with-host-libstdcxx='-static -lstdc++' --with-libic
onv --with-system-zlib --with-gmp=/temp/mingw-prereq/i686-w64-mingw32-static --w
ith-mpfr=/temp/mingw-prereq/i686-w64-mingw32-static --with-mpc=/temp/mingw-prere
q/i686-w64-mingw32-static --with-ppl=/temp/mingw-prereq/i686-w64-mingw32-static
--with-cloog=/temp/mingw-prereq/i686-w64-mingw32-static --with-pkgversion='Built
by MinGW-builds project' --with-bugurl=http://sourceforge.net/projects/mingwbui
lds/ CFLAGS='-O2 -pipe -fomit-frame-pointer -I/temp/x32-4.7.2-posix-sjlj-r8/libs
/include -I/temp/mingw-prereq/x32-zlib/include -I/temp/mingw-prereq/i686-w64-min
gw32-static/include' CXXFLAGS='-O2 -pipe -fomit-frame-pointer -I/temp/x32-4.7.2-
posix-sjlj-r8/libs/include -I/temp/mingw-prereq/x32-zlib/include -I/temp/mingw-p
rereq/i686-w64-mingw32-static/include' CPPFLAGS= LDFLAGS='-pipe -L/temp/x32-4.7.
2-posix-sjlj-r8/libs/lib -L/temp/mingw-prereq/x32-zlib/lib -L/temp/mingw-prereq/
i686-w64-mingw32-static/lib -L/temp/x32-4.7.2-posix-sjlj-r8/prefix/opt/lib'
Thread model: posix
gcc version 4.7.2 (Built by MinGW-builds project)

D:\Qt\Qt5\Tools\MinGW\bin>ld -v
GNU ld (GNU Binutils) 2.23.1

D:\Qt\Qt5\Tools\MinGW\bin>mingw32-make -v
GNU Make 3.82.90
Built for i686-w64-mingw32
Copyright (C) 1988-2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.


  • Earnie Boyd

    Earnie Boyd - 2013-05-23
    • labels: --> libstdc++
    • status: unread --> closed
    • Type: Bug --> Support
    • Category: Unknown --> component_package
  • Earnie Boyd

    Earnie Boyd - 2013-05-23

    You'll need to report this to the proper bugs list. I assume that would be libstdc++.

    • DrD

      DrD - 2013-05-23

      Thanks Earnie, but how do I do that? I am not sure of what you mean. A bit of help will be appreciated.

      Last edit: DrD 2013-05-23
      • Earnie Boyd

        Earnie Boyd - 2013-05-23
        • DrD

          DrD - 2013-05-23

          Thnaks, I'll have a look now :)

        • DrD

          DrD - 2013-05-23

          Hi Again Earnie,

          I have seen the link, thank you.
          However, I am puzzled. In the stack overflow link I provided, a user reported using gcc in linux without a problem. I am not sure, but wouldn't that rule out a problem with libstdc++?

          • Keith Marshall

            Keith Marshall - 2013-05-27

            In the stack overflow link I provided, a user reported using gcc in linux without a problem.

            Completely irrelevant, but quite typical of the blind-leading-blind misinformation frequently seen on SO.

            I am not sure, but wouldn't that rule out a problem with libstdc++?

            No; it just means that the problem lies in a section of libstdc++ code which is specific to its mingw32 build, and which is not incorporated in its Linux build. It's still the responsibility of the libstdc++ maintainers to fix, but they can't do that if no one files the bug report.

            • DrD

              DrD - 2013-05-28

              Thank you for the explanation, Keith


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks