[Bug c++/52108] New: declval() with incomplete type
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52108 Bug #: 52108 Summary: declval() with incomplete type Classification: Unclassified Product: gcc Version: 4.5.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: hidden_p...@mail.ru Created attachment 26563 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26563 bug illustration Wrong report about 'incomplete type'. Situation has relation to type selection technique. Key string in the example is template static decltype( declval(), declval()) __test_p( int ); First declval (declval) and comma operator required for problem demonstration. Another condition is usage of x-pair. For testcase, see attached file. Compilation: c++ -std=gnu++0x -c test.cc
[Bug c++/16625] Discarded Linkonce sections in .rodata
--- Comment #38 from hidden_peak at mail dot ru 2007-03-05 14:53 --- (In reply to comment #37) > > Can I reproduce it on Linux? > May be comment #21 help you? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16625
[Bug c/31007] wrong 64bit constant calculation
--- Comment #7 from hidden_peak at mail dot ru 2007-03-01 15:13 --- My mistake. Sorry. -- hidden_peak at mail dot ru changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution||INVALID http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31007
[Bug c/31007] wrong 64bit constant calculation
--- Comment #6 from hidden_peak at mail dot ru 2007-03-01 15:11 --- > Shifting unsigned numbers doesn't replicate the sign bit. unsigned ui3 = ~((1 << 31) >> 3); printf( "%x\n", ui3 ); give me wrong result fff ? -- hidden_peak at mail dot ru changed: What|Removed |Added Status|RESOLVED|UNCONFIRMED Resolution|INVALID | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31007
[Bug c/31007] wrong 64bit constant calculation
--- Comment #5 from hidden_peak at mail dot ru 2007-03-01 15:05 --- Do you mean this treatment: ~((1ULL << 63ULL) >> 3ULL) -> ~(1ULL << 60ULL) -> efff ? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31007
[Bug c/31007] wrong 64bit constant calculation
--- Comment #3 from hidden_peak at mail dot ru 2007-03-01 14:48 --- ~((1ULL << 63ULL) >> 3ULL): ( 0001 << 63) -> 8000 (unsigned!) (8000 >> 3 ) -> f000 (due to sign bit) ~(f000 ) -> 0fff ffff ffff Right? -- hidden_peak at mail dot ru changed: What|Removed |Added Status|RESOLVED|UNCONFIRMED Resolution|INVALID | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31007
[Bug c/31007] wrong 64bit constant calculation
--- Comment #1 from hidden_peak at mail dot ru 2007-03-01 12:30 --- > (instead of 7fff 7fff) Correct should be fff and fff. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31007
[Bug c/31007] New: wrong 64bit constant calculation
#include #include int main() { uint64_t ui4 = ~((1ULL << 63ULL) >> 3ULL); union { uint64_t i64; struct { uint32_t lo; uint32_t hi; } i32; } ui5; ui5.i64 = ui4; printf( "%llx %x\n", ui4, ui5.i32.hi ); return 0; } Return efff efff (instead of 7fff 7fff). Appropriate expression for 32bit constant give expected result. -- Summary: wrong 64bit constant calculation Product: gcc Version: 4.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: hidden_peak at mail dot ru 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=31007
[Bug c++/26773] New: array initialization
Program #include struct A { A() { printf( "%p %p\n", &buf[0], this ); } A( int j ) : i(j) { printf( "%p %p\n", &buf[0], this ); } A( const A& a ) : i(a.i) { printf( "%p %p\n", &buf[0], this ); } A& operator =( const A& a ) { printf( "%p %p\n", &buf[0], this ); return *this; } A& operator =( int j ) { printf( "%p %p\n", &buf[0], this ); return *this; } ~A() { printf( "%p %p\n", &buf[0], this ); } int i; char buf[2]; }; struct B { A a1; }; const A a1 = 1; int main() { printf( "-- 0\n" ); { const B b[] = { {a1} }; } printf( "-- 1\n" ); { const B b; } printf( "-- 2\n" ); return 0; } give output like 0x8049b1c 0x8049b18 -- 0 0xbfd9a6a8 0xbfd9a6a4 // !!! 0xbfd9a6b8 0xbfd9a6b4 // !!! -- 1 0xbfd9a6a8 0xbfd9a6a4 0xbfd9a6a8 0xbfd9a6a4 -- 2 0x8049b1c 0x8049b18 i.e. &*this and &buf[0] are differ in dtor and ctor in case of array initialization with aggregate. -- Summary: array initialization Product: gcc Version: 3.4.4 Status: UNCONFIRMED Severity: critical Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: hidden_peak at mail dot ru 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=26773
[Bug c++/24189] crash at exit after dlclose with -fuse-cxa-atexit
--- Comment #16 from hidden_peak at mail dot ru 2005-11-27 17:40 --- Thanks for explanation. Link to this issue: http://www.codesourcery.com/cxx-abi/abi.html#dso-dtor (for archive/reference purposes). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24189
[Bug c++/24189] crash at exit after dlclose with -fuse-cxa-atexit
--- Comment #14 from hidden_peak at mail dot ru 2005-11-27 16:48 --- Created an attachment (id=10348) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10348&action=view) __cxa_atexit and __cxa_finalize that work correctly cxa.c contain code with __cxa_atexit and __cxa_finalize that work correctly with gcc 3.4.x (really I am check only 3.4.4). Useful when builded as so library and used in LD_PRELOAD to fix glibc problem. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24189
[Bug c++/24189] crash at exit after dlclose with -fuse-cxa-atexit
--- Comment #13 from hidden_peak at mail dot ru 2005-11-27 16:41 --- This is really bug in glibc: __cxa_finalize don't call all registered handlers in case of NULL argument (glibc 2.2.5 has this bug, but 2.3.2 already not). But nevertheless, the problem still present at platforms without glibc. Really, I wonder why code specific for C++ language support (and even more: specific for gcc) should be in glibc? May be the better place is one of crt*.o? -- hidden_peak at mail dot ru changed: What|Removed |Added CC||hidden_peak at mail dot ru http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24189
[Bug c++/16625] Discarded Linkonce sections in .rodata
--- Comment #21 from hidden_peak at mail dot ru 2005-10-25 11:46 --- May be is not gcc bug, but ld: the sample work with GNU ld version 2.12.90.0.1 20020307 Debian/GNU Linux, work with warnings with GNU ld version 2.15.94.0.2.2 20041220 (SuSE Linux) and don't work with ld 2.16.x (all with gcc 3.4.4). -- hidden_peak at mail dot ru changed: What|Removed |Added CC||hidden_peak at mail dot ru http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16625
[Bug c++/24189] crash at exit after dlclose with -fuse-cxa-atexit
--- Comment #12 from hidden_peak at mail dot ru 2005-10-06 11:28 --- Really, I wonder why code specific for C++ language support should be in glibc? What about platforms without glibc? May be code to call dtors should be in crtbegin/crtbeginS? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24189
[Bug c++/24189] crash at exit after dlclose with -fuse-cxa-atexit
--- Comment #11 from hidden_peak at mail dot ru 2005-10-04 15:55 --- Sometimes test run fine fror me too, but (the same build and same evironment!) sometimes not. This like depends upon garbage... Well, as expected---call of dtor of died object. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24189
[Bug c++/24189] crash at exit after dlclose with -fuse-cxa-atexit
--- Comment #10 from hidden_peak at mail dot ru 2005-10-04 15:49 --- Like my. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24189
[Bug c++/24189] crash at exit after dlclose with -fuse-cxa-atexit
--- Comment #7 from hidden_peak at mail dot ru 2005-10-04 14:17 --- But may be this is problem in crtbeginS.o or crtendS.o? I.e. in something like __cxa_finalize: > nm /opt/gcc-3.4.4/lib/gcc/i686-pc-linux-gnu/3.4.4/crtbeginS.o U _GLOBAL_OFFSET_TABLE_ w _Jv_RegisterClasses ? __CTOR_LIST__ ? __DTOR_LIST__ ? __JCR_LIST__ w __cxa_finalize t __do_global_dtors_aux D __dso_handle b completed.1 0060 t frame_dummy d p.0 > nm /opt/gcc-3.4.4/lib/gcc/i686-pc-linux-gnu/3.4.4/crtendS.o U _GLOBAL_OFFSET_TABLE_ ? __CTOR_END__ ? __DTOR_END__ ? __FRAME_END__ ? __JCR_END__ t __do_global_ctors_aux BTW, due to access to free memory the result may be SIGFAULT or not. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24189
[Bug c++/24189] crash at exit after dlclose with -fuse-cxa-atexit
--- Comment #6 from hidden_peak at mail dot ru 2005-10-04 14:04 --- May be. Just for info: Debian GNU/Linux 3.0 ('woody'), Linux peak 2.6.12.5 #1 SMP Mon Aug 29 17:22:33 MSD 2005 i686 unknown -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24189
[Bug c++/24189] crash at exit after dlclose with -fuse-cxa-atexit
--- Comment #4 from hidden_peak at mail dot ru 2005-10-04 13:54 --- > What is the version of glibc you have? I have 2.3.3. 2.2.5 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24189
[Bug c++/24189] crash at exit after dlclose with -fuse-cxa-atexit
--- Comment #2 from hidden_peak at mail dot ru 2005-10-04 13:49 --- Created an attachment (id=9870) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9870&action=view) testcase Unpack, (cd dlclose-cxa; x.sh). Script (bash) x.sh compile and run test; crash at exit. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24189
[Bug c++/24189] New: crash at exit after dlclose with -fuse-cxa-atexit
Program open DSO with dlopen; DSO has has any C++ global (static) object; program close DSO with dlclose; crash at program exit. Compiler use -fuse-cxa-atexit option, compiler was builded as Reading specs from /opt/gcc-3.4.4/lib/gcc/i686-pc-linux-gnu/3.4.4/specs Configured with: ./configure --enable-__cxa_atexit --enable-threads --with-system-zlib --enable-languages=c,c++,java --prefix=/opt/gcc-3.4.4 Thread model: posix gcc version 3.4.4 Possible crash reason: call of dtor of static object in DSO after DSO was unloaded. Test: > cat test.cc #include //#include //#include //using namespace std; typedef void *(*func_type)(); int main() { void *lh = dlopen( "./libtestg.so", RTLD_LAZY ); //cerr << hex << (unsigned)lh << dec << endl; func_type f = (func_type)dlsym( lh, "func" ); f(); dlclose( lh ); return 0; } > cat testlib.cc //#include //using namespace std; extern "C" void func(); class A { public: A(); ~A(); private: char *p; }; A::A() { /* p = new char [50]; */ } A::~A() { /* delete [] p; */ } static A a; // <- crash at call cxa_atexit after dlclose? //static char b[30]; void func() { // A a; //a = new A; // cerr << "Hello\n"; } > cat x.sh #!/bin/bash CXX=c++ ${CXX} -pthread -fexceptions -fident -g -fuse-cxa-atexit -c -o test.o test.cc ${CXX} -pthread -fexceptions -fident -g -fuse-cxa-atexit -nostdlib -o test `for o in crt{1,i,begin}.o; do ${CXX} -print-file-name=\$o; done` test.o -lsupc++ -ldl -lgcc_s -lpthread -lc -lm `for o in crt{end,n}.o; do ${CXX} -print-file-name=\$o; done` ${CXX} -pthread -fexceptions -fident -fPIC -g -fuse-cxa-atexit -c -o testlib.o testlib.cc ${CXX} -pthread -fexceptions -fident -fPIC -g -fuse-cxa-atexit -shared -Wl,-hlibtestg.so.0.0 -nostdlib -o libtestg.so.0.0.0 `for o in crt{i,beginS}.o; do ${CXX} -print-file-name=\$o; done` testlib.o -lgcc_s -lsupc++ -lpthread -lc -lm `for o in crt{endS,n}.o; do ${CXX} -print-file-name=\$o; done` rm -f libtestg.so.0.0; ln -s libtestg.so.0.0.0 libtestg.so.0.0; rm -f libtestg.so.0; ln -s libtestg.so.0.0 libtestg.so.0; rm -f libtestg.so; ln -s libtestg.so.0 libtestg.so ./test -- Summary: crash at exit after dlclose with -fuse-cxa-atexit Product: gcc Version: 3.4.4 Status: UNCONFIRMED Severity: critical Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: hidden_peak at mail dot ru 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=24189