[Bug libstdc++/89740] reading from cin & writing to cout sync_with_stdio(false) has race conditions

2019-03-17 Thread ahu at ds9a dot nl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89740 --- Comment #4 from bert hubert --- I did a longer writeup here, where I tentatively conclude this is not a bug, just highly unfortunate: https://ds9a.nl/articles/posts/iostreams-unexpected/

[Bug libstdc++/89740] reading from cin & writing to cout sync_with_stdio(false) has race conditions

2019-03-16 Thread ahu at ds9a dot nl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89740 --- Comment #3 from bert hubert --- Note that in https://stackoverflow.com/questions/12605725/basic-thread-locking-in-c11/12608911#12608911 we read the calling flush() from two threads at the same time is not legal if the streams are

[Bug libstdc++/89740] reading from cin & writing to cout sync_with_stdio(false) has race conditions

2019-03-16 Thread ahu at ds9a dot nl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89740 --- Comment #2 from bert hubert --- Created attachment 45982 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45982=edit reproduction that actually shows the bug This is the version of the reproduction that exhibits the problem. The other

[Bug libstdc++/89740] reading from cin & writing to cout sync_with_stdio(false) has race conditions

2019-03-16 Thread ahu at ds9a dot nl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89740 --- Comment #1 from bert hubert --- Comment on attachment 45981 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45981 a small reproduction for this bug. >#include >#include >#include >#include > >using namespace std; > >void

[Bug libstdc++/89740] New: reading from cin & writing to cout sync_with_stdio(false) has race conditions

2019-03-16 Thread ahu at ds9a dot nl
rity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: ahu at ds9a dot nl Target Milestone: --- Created attachment 45981 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45981=edit a small reproduction for t

[Bug c++/66971] thread_local with external linkage and constructor cannot be compiled correctly

2017-05-28 Thread ahu at ds9a dot nl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66971 bert hubert changed: What|Removed |Added CC||ahu at ds9a dot nl --- Comment #1 from

[Bug c++/59079] New: a lambda with a parameter that depends on vector::value_type typedef leads to compiler error

2013-11-11 Thread ahu at ds9a dot nl
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ahu at ds9a dot nl Created attachment 31194 -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=31194action=edit small test file that fails to compile Thanks

[Bug c++/59079] a lambda with a parameter that depends on vector::value_type typedef leads to compiler error

2013-11-11 Thread ahu at ds9a dot nl
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59079 bert hubert ahu at ds9a dot nl changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED

[Bug libstdc++/41267] New: vector::resize() from an empty vector calls memmove for 0 bytes, wasting a lot of cpu time in a production PowerDNS

2009-09-04 Thread ahu at ds9a dot nl
++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: ahu at ds9a dot nl GCC build triplet: x86_64-unknown-linux-gnu GCC host triplet: x86_64-unknown-linux-gnu GCC target triplet: x86_64-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41267

[Bug c++/26633] New: Minimal c++ program using threads and exceptions crashes when compiled statically

2006-03-10 Thread ahu at ds9a dot nl
at gcc dot gnu dot org ReportedBy: ahu at ds9a dot nl GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26633

[Bug other/26633] [4.1/4.2 Regression] Minimal c++ program using threads and exceptions crashes when compiled statically

2006-03-10 Thread ahu at ds9a dot nl
--- Comment #3 from ahu at ds9a dot nl 2006-03-10 17:54 --- Subject: Re: [4.1/4.2 Regression] Minimal c++ program using threads and exceptions crashes when compiled statically Sure this is (exactly) related? I tried to pull in some of the symbols that might be missing to no avail

[Bug other/26633] [4.1/4.2 Regression] Minimal c++ program using threads and exceptions crashes when compiled statically

2006-03-10 Thread ahu at ds9a dot nl
--- Comment #4 from ahu at ds9a dot nl 2006-03-10 20:44 --- Andrew Pinski tells me this is a glibc TLS bug and that it should be reported to Ubuntu, which I have done here: https://launchpad.net/distros/ubuntu/+source/glibc/+bug/34362 The reduced testcase is: #include pthread.h void

[Bug tree-optimization/26570] New: -fprofile-generate -fprofile-use cause memory corruption immediately

2006-03-05 Thread ahu at ds9a dot nl
Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: ahu at ds9a dot nl GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26570

[Bug gcov/profile/26570] -fprofile-generate -fprofile-use cause memory corruption immediately

2006-03-05 Thread ahu at ds9a dot nl
--- Comment #3 from ahu at ds9a dot nl 2006-03-05 23:42 --- Thanks Nicholas, I can run the command you suggest without errors (I saved the file as exploit.cc). However, if I compile first with -fprofile-generate, then run it once, and then add -fprofile-use, it reports: $ g++ -O2

[Bug gcov/profile/26570] [4.1/4.2 Regression] -fprofile-generate -fprofile-use cause memory corruption immediately

2006-03-05 Thread ahu at ds9a dot nl
--- Comment #7 from ahu at ds9a dot nl 2006-03-06 00:10 --- The crasher bugs go away from release 4.1.0 when never running with -fprofile-use and -fprofile-generate simultaneously. There is another 'checksum mismatch' issue with PowerDNS: base64.cc: In function âcharunnamed

[Bug libstdc++/24704] __gnu_cxx::__exchange_and_add is called even for single threaded applications

2005-11-08 Thread ahu at ds9a dot nl
--- Comment #10 from ahu at ds9a dot nl 2005-11-08 10:15 --- An easy solution might be to check for __gthread_active_p() in bits/basic_string before calling __exchange_and_add, and to do this locally and non-atomically otherwise. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24704

[Bug libstdc++/24704] New: __gnu_cxx::__exchange_and_add is out of line and called even for single threaded applications using std::string

2005-11-07 Thread ahu at ds9a dot nl
Product: gcc Version: 4.0.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: ahu at ds9a dot nl GCC build triplet: i486-linux-gnu GCC host

[Bug libstdc++/24704] __gnu_cxx::__exchange_and_add is out of line and called even for single threaded applications using std::string

2005-11-07 Thread ahu at ds9a dot nl
--- Comment #1 from ahu at ds9a dot nl 2005-11-07 12:39 --- that would be http://wiki.powerdns.com - not sure how I mistyped that. Also, the application in question is rather string-happy, which is probably why the exchange_and_add thing shows up so much. -- http://gcc.gnu.org

[Bug libstdc++/24704] __gnu_cxx::__exchange_and_add is out of line and called even for single threaded applications using std::string

2005-11-07 Thread ahu at ds9a dot nl
--- Comment #3 from ahu at ds9a dot nl 2005-11-07 17:00 --- I've now verified that even when the entire compiler is compiled with --enable-threads=single, the resulting libstdc++ does the full 'lock; xadd' thing in __exchange_and_add, which I consider a bug (and more importantly, so