[Bug libstdc++/43259] ext/profile/all.cc fails on Solaris
--- Comment #2 from ebotcazou at gcc dot gnu dot org 2010-03-04 17:45 --- Same on SPARC/Solaris 10: http://gcc.gnu.org/ml/gcc-testresults/2010-03/msg00295.html Present on SPARC/Solaris 9: http://gcc.gnu.org/ml/gcc-testresults/2010-03/msg00294.html but the error is different: /nile.build/botcazou/gcc-head/sparc-sun-solaris2.9/sparc-sun-solaris2.9/libstdc\ ++-v3/include/profile/impl/profiler_trace.h:559:62: error: 'setenv' was not dec\ lared in this scope -- ebotcazou at gcc dot gnu dot org changed: What|Removed |Added CC||ebotcazou at gcc dot gnu dot ||org Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 GCC build triplet|i386-pc-solaris2.11 |*-*-solaris2.* GCC host triplet|i386-pc-solaris2.11 |*-*-solaris2.* GCC target triplet|i386-pc-solaris2.11 |*-*-solaris2.* Last reconfirmed|-00-00 00:00:00 |2010-03-04 17:45:46 date|| Summary|ext/profile/all.cc fails on |ext/profile/all.cc fails on |Solaris 11/x86 |Solaris http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43259
[Bug libstdc++/43259] ext/profile/all.cc fails on Solaris
--- Comment #3 from paolo dot carlini at oracle dot com 2010-03-05 10:07 --- Adding Silvius in CC. -- paolo dot carlini at oracle dot com changed: What|Removed |Added CC||rus at google dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43259
[Bug libstdc++/43259] ext/profile/all.cc fails on Solaris
--- Comment #4 from ro at gcc dot gnu dot org 2010-03-05 18:40 --- Assigned to Silvius as requested. -- ro at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|unassigned at gcc dot gnu |rus at google dot com |dot org | Status|NEW |ASSIGNED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43259
[Bug libstdc++/43259] ext/profile/all.cc fails on Solaris
--- Comment #5 from ebotcazou at gcc dot gnu dot org 2010-03-05 23:17 --- For the sake of completeness, the error on Solaris 8 is the same as on Solaris 9. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43259
[Bug libstdc++/43259] ext/profile/all.cc fails on Solaris
--- Comment #6 from paolo dot carlini at oracle dot com 2010-03-21 01:44 --- *** Bug 43457 has been marked as a duplicate of this bug. *** -- paolo dot carlini at oracle dot com changed: What|Removed |Added CC||danglin at gcc dot gnu dot ||org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43259
[Bug libstdc++/43259] ext/profile/all.cc fails on Solaris
--- Comment #7 from paolo dot carlini at oracle dot com 2010-03-21 01:59 --- Silvius, when you will go through the various roblems on non-linux systems for this test, also remember that setenv, as used in profiler_trace.h for example, isn't always available, must be wrapped in #ifdef _GLIBCXX_HAVE_SETENV -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43259
[Bug libstdc++/43259] ext/profile/all.cc fails on Solaris
--- Comment #8 from rus at google dot com 2010-03-21 04:52 --- Good point. I don't think that setenv should be there in the first place actually. I'll try to fix that as well. Just FYI, I'm planning to fix all the reported libstdc++ profile issues around second week of April. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43259
[Bug libstdc++/43259] ext/profile/all.cc fails on Solaris
--- Comment #9 from paolo dot carlini at oracle dot com 2010-03-21 11:13 --- Excellent, Silvius. Note, I'm not 100% sure about possible deadlines for 4.5.0: I think the second week of April will be still ok, but I would suggest keeping an eye to the gcc list and be prepared to move earlier the most trivial / urgent fixes. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43259
[Bug libstdc++/43259] ext/profile/all.cc fails on Solaris
--- Comment #10 from paolo dot carlini at oracle dot com 2010-03-21 19:15 --- *** Bug 43468 has been marked as a duplicate of this bug. *** -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43259
[Bug libstdc++/43259] ext/profile/all.cc fails on Solaris
--- Comment #11 from paolo dot carlini at oracle dot com 2010-04-09 10:08 --- *** Bug 43683 has been marked as a duplicate of this bug. *** -- paolo dot carlini at oracle dot com changed: What|Removed |Added CC||kgardas at objectsecurity ||dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43259
[Bug libstdc++/43259] ext/profile/all.cc fails on Solaris
--- Comment #12 from ro at gcc dot gnu dot org 2010-04-28 18:36 --- Any progress on this? The bug is open for almost 2 months now. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43259
[Bug libstdc++/43259] ext/profile/all.cc fails on Solaris
--- Comment #13 from rus at google dot com 2010-04-28 19:06 --- Subject: Re: ext/profile/all.cc fails on Solaris On Wed, Apr 28, 2010 at 11:36 AM, ro at gcc dot gnu dot org wrote: > > > --- Comment #12 from ro at gcc dot gnu dot org 2010-04-28 18:36 --- > Any progress on this? The bug is open for almost 2 months now. > I looked at it already, but it wasn't the quick fix I expected. I did not anticipate having to support systems without static mutex initialization. Will fix it one way or another soon. Silvius -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43259
[Bug libstdc++/43259] ext/profile/all.cc fails on Solaris
--- Comment #14 from rus at google dot com 2010-05-05 03:08 --- Created an attachment (id=20559) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20559&action=view) use ext/concurrence __mutex instead of pthread_mutex_t Could you please try this patch out on your system? It appears to work on the few examples I tried on linux x86_64. [Many tests are currently broken in profile mode so I can't test it thoroughly.] -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43259
[Bug libstdc++/43259] ext/profile/all.cc fails on Solaris
--- Comment #15 from kgardas at objectsecurity dot com 2010-05-05 10:45 --- Created an attachment (id=20560) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20560&action=view) Output of compiler patched with 43259-0504.patch on SunOS 5.11 snv_134 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43259
[Bug libstdc++/43259] ext/profile/all.cc fails on Solaris
--- Comment #16 from kgardas at objectsecurity dot com 2010-05-05 10:46 --- (From update of attachment 20560) Hello, unfortunately your patch is still not working, but it seems you've solved originally reported issue. See attached log file for compilers complains with your patch applied. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43259
[Bug libstdc++/43259] ext/profile/all.cc fails on Solaris
--- Comment #17 from rus at google dot com 2010-05-06 02:03 --- Created an attachment (id=20574) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20574&action=view) Wrote custom algos, removed include algorithm, minor fixes. This should fix several issues. I still see failing tests but they all seem to be either synopsis.cc which have been failing for a while, or failures related to my system/config (only runtime backtrace failures). Could you please try this patch and let me know if it fixes this issue and does not introduce regressions for you. -- rus at google dot com changed: What|Removed |Added Attachment #20559|0 |1 is obsolete|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43259
[Bug libstdc++/43259] ext/profile/all.cc fails on Solaris
--- Comment #18 from rus at google dot com 2010-05-06 02:18 --- Created an attachment (id=20575) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20575&action=view) Minor fix to previous patch. Here's a minor fix. It will not affect tests, but just in case you're trying it for real, this fixes diagnostic sorting, which had gotten broken in the last patch. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43259
[Bug libstdc++/43259] ext/profile/all.cc fails on Solaris
--- Comment #19 from paolo dot carlini at oracle dot com 2010-05-06 16:24 --- Note that in all those patches, the open curly brackets are in the wrong place: in GCC, C++ runtime included, must *always* follow a newline. Just stylistic issues, of course. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43259
[Bug libstdc++/43259] ext/profile/all.cc fails on Solaris
--- Comment #20 from rus at google dot com 2010-05-06 19:43 --- (In reply to comment #19) > Note that in all those patches, the open curly brackets are in the wrong > place: > in GCC, C++ runtime included, must *always* follow a newline. Just stylistic > issues, of course. > Thank you for pointing that out. I'll go ahead and make changes throughout the profile extension -- though I'll do it in a separate changelist. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43259
[Bug libstdc++/43259] ext/profile/all.cc fails on Solaris
--- Comment #21 from paolo dot carlini at oracle dot com 2010-05-06 20:24 --- At your ease of course. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43259
[Bug libstdc++/43259] ext/profile/all.cc fails on Solaris
--- Comment #22 from kgardas at objectsecurity dot com 2010-05-07 06:53 --- Viola! Something happens now! Thanks for fixing this. $ cat test-profile-mode.cc #include using namespace std; int main() { vector v; for (int k = 0; k < 1024; ++k) v.insert(v.begin(), k); } $ c++ -D_GLIBCXX_PROFILE test-profile-mode.cc $ ./a.out $ ls -la libstdcxx-profile.* -rw-r--r-- 1 karelkarel520 May 7 08:52 libstdcxx-profile.conf.out -rw-r--r-- 1 karelkarel152 May 7 08:52 libstdcxx-profile.raw -rw-r--r-- 1 karelkarel268 May 7 08:52 libstdcxx-profile.txt $ uname -a SunOS thinkpad 5.11 snv_134 i86pc -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43259
[Bug libstdc++/43259] ext/profile/all.cc fails on Solaris
--- Comment #23 from rus at google dot com 2010-05-07 17:49 --- Subject: Re: ext/profile/all.cc fails on Solaris On Thu, May 6, 2010 at 11:53 PM, kgardas at objectsecurity dot com wrote: > > > --- Comment #22 from kgardas at objectsecurity dot com 2010-05-07 06:53 > --- > Viola! Something happens now! Thanks for fixing this. Great! Sure, no problem. Let me know if you need help with anything in the profile extension. In particular, let me know if there's a class of diagnostics you'd like added to the few ones already there, or if you find bugs in the current diagnostics. Silvius -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43259
[Bug libstdc++/43259] ext/profile/all.cc fails on Solaris
--- Comment #24 from paolo dot carlini at oracle dot com 2010-05-09 16:57 --- Silvius, can you prepare a simple patch vs current gcc-4_5-branch? We have time for mainline, but it is also safe to apply at the same time something simple to mainline too and then improve it. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43259
[Bug libstdc++/43259] ext/profile/all.cc fails on Solaris
--- Comment #25 from paolo at gcc dot gnu dot org 2010-05-11 10:22 --- Subject: Bug 43259 Author: paolo Date: Tue May 11 10:22:18 2010 New Revision: 159268 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=159268 Log: 2010-05-11 Silvius Rus PR libstdc++/43259 * include/profile/impl/profiler_algos.h: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * include/profile/impl/profiler.h (_GLIBCXX_PROFILE_DEFINE_UNINIT_DATA): Add. * include/profile/impl/profiler_trace.h (__mutex_t, __lock, __unlock): Remove. (__lock_object_table, __lock_stack_table): Remove. Replace uses with calls to __gnu_cxx::__mutex::lock. (__unlock_object_table, __unlock_stack_table): Remove. Replace uses with calls to __gnu_cxx::__mutex::unlock. (__warn, __cost_factor_writer, __cost_factor_setter): Add. * testsuite/ext/profile/profiler_algos.cc: New. Added: trunk/libstdc++-v3/include/profile/impl/profiler_algos.h Modified: trunk/libstdc++-v3/ChangeLog trunk/libstdc++-v3/include/Makefile.am trunk/libstdc++-v3/include/Makefile.in trunk/libstdc++-v3/include/profile/impl/profiler.h trunk/libstdc++-v3/include/profile/impl/profiler_trace.h -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43259
[Bug libstdc++/43259] ext/profile/all.cc fails on Solaris
--- Comment #26 from paolo at gcc dot gnu dot org 2010-05-11 10:23 --- Subject: Bug 43259 Author: paolo Date: Tue May 11 10:23:20 2010 New Revision: 159269 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=159269 Log: 2010-05-11 Silvius Rus PR libstdc++/43259 * include/profile/impl/profiler_algos.h: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * include/profile/impl/profiler.h (_GLIBCXX_PROFILE_DEFINE_UNINIT_DATA): Add. * include/profile/impl/profiler_trace.h (__mutex_t, __lock, __unlock): Remove. (__lock_object_table, __lock_stack_table): Remove. Replace uses with calls to __gnu_cxx::__mutex::lock. (__unlock_object_table, __unlock_stack_table): Remove. Replace uses with calls to __gnu_cxx::__mutex::unlock. (__warn, __cost_factor_writer, __cost_factor_setter): Add. * testsuite/ext/profile/profiler_algos.cc: New. Added: trunk/libstdc++-v3/testsuite/ext/profile/profiler_algos.cc -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43259
[Bug libstdc++/43259] ext/profile/all.cc fails on Solaris
--- Comment #27 from paolo at gcc dot gnu dot org 2010-05-14 11:40 --- Subject: Bug 43259 Author: paolo Date: Fri May 14 11:40:05 2010 New Revision: 159389 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=159389 Log: 2010-05-14 Silvius Rus PR libstdc++/43259 * include/profile/impl/profiler.h (_GLIBCXX_PROFILE_DEFINE_UNINIT_DATA): Add. * include/profile/impl/profiler_trace.h (__mutex_t, __lock, __unlock): Remove. (__lock_object_table, __lock_stack_table): Remove. Replace uses with calls to __gnu_cxx::__mutex::lock. (__unlock_object_table, __unlock_stack_table): Remove. Replace uses with calls to __gnu_cxx::__mutex::unlock. Modified: branches/gcc-4_5-branch/libstdc++-v3/ChangeLog branches/gcc-4_5-branch/libstdc++-v3/include/profile/impl/profiler.h branches/gcc-4_5-branch/libstdc++-v3/include/profile/impl/profiler_trace.h -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43259
[Bug libstdc++/43259] ext/profile/all.cc fails on Solaris
--- Comment #28 from paolo dot carlini at oracle dot com 2010-05-14 11:41 --- Fixed for 4.5.1. -- paolo dot carlini at oracle dot com changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED Target Milestone|--- |4.5.1 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43259
[Bug libstdc++/43259] ext/profile/all.cc fails on Solaris 11/x86
--- Comment #1 from redi at gcc dot gnu dot org 2010-03-04 17:44 --- The problematic line expands to: static pthread_mutex_t __global_lock(PTHREAD_MUTEX_INITIALIZER); which is clearly wrong when PTHREAD_MUTEX_INITIALIZER is of the form {...} As you suggest, it should be using gthreads, but a simpler fix for now would be to avoid using _GLIBCXX_PROFILE_DEFINE_DATA and declare __get___global_lock directly in profiler_trace.h, something like: inline __mutex_t& __get___global_lock() { static __mutex_t __global_lock = PTHREAD_MUTEX_INITIALIZER; return __global_lock; } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43259