[Bug libstdc++/20579] New: Segmentation fault after exception in list and set destructors

2005-03-21 Thread vldmrrr at yahoo dot com
The following program generates segmentation fault when exception is thrown from
constructor. The fault happens if type of CONTAINER is std::list or std::set,
but does not happen if its type is std::vector or if CONTAINER is ommited from
TST class. Also tested on linux with same resutls.
  Program source:-
#include 

class TST {
std::list CONTAINER;
public:
TST(int i) {
if (i==0) {
delete this;
throw 1;
}
}
~TST() {
printf("Destructor\n");
}
};

int main() {
TST* tst = NULL;
try {
 tst = new TST(0);
}
catch (int i) {
printf("Caught %d\n",i);
}
if (tst != NULL)
delete tst;
}
---
Compile command output:
---
$ g++ -v -save-temps tst.cpp
Reading specs from C:/MinGW/bin/../lib/gcc-lib/mingw32/3.3.3/specs 
Configured with: ../gcc/configure --with-gcc --with-gnu-ld --with-gnu-as
--host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls
--enable-languages=c,c++,f77,ada,objc,java --disable-win32-registry
--disable-shared --enable-sjlj-exceptions --enable-libgcj --disable-java-awt
--without-x --enable-java-gc=boehm --disable-libgcj-debug --enable-interpreter
--enable-hash-synchronization
Thread model: win32
gcc version 3.3.3 (mingw special)
 C:\MinGW\bin\..\lib\gcc-lib\mingw32\3.3.3\cc1plus.exe -E -D__GNUG__=3 -quiet -v
-iprefix C:\MinGW\bin\../lib/gcc-lib/mingw32/3.3.3/ -D__GNUC__=3
-D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=3 tst.cpp tst.ii
ignoring nonexistent directory "C:/MinGW/mingw32/include"
ignoring nonexistent directory "/mingw/mingw32/include"
#include "..." search starts here:
#include <...> search starts here:
 C:/MinGW/include/c++/3.3.3
 C:/MinGW/include/c++/3.3.3/mingw32
 C:/MinGW/include/c++/3.3.3/backward
 C:/MinGW/include
 C:/MinGW/lib/gcc-lib/mingw32/3.3.3/include
 /mingw/include/c++/3.3.3
 /mingw/include/c++/3.3.3/mingw32
 /mingw/include/c++/3.3.3/backward
 /mingw/include
 /mingw/include
 /mingw/lib/gcc-lib/mingw32/3.3.3/include
 /mingw/include
End of search list.
 C:\MinGW\bin\..\lib\gcc-lib\mingw32\3.3.3\cc1plus.exe -fpreprocessed tst.ii
-quiet -dumpbase tst.cpp -auxbase tst -version -o tst.s
GNU C++ version 3.3.3 (mingw special) (mingw32)
compiled by GNU C version 3.3.3 (mingw special).
GGC heuristics: --param ggc-min-expand=60 --param ggc-min-heapsize=57214
 C:\MinGW\bin\..\lib\gcc-lib\mingw32\3.3.3\..\..\..\..\mingw32\bin\as.exe
--traditional-format -o tst.o tst.s
 C:\MinGW\bin\..\lib\gcc-lib\mingw32\3.3.3\..\..\..\..\mingw32\bin\ld.exe
-Bdynamic /mingw/lib/crt2.o C:/MinGW/bin/../lib/gcc-lib/mingw32/3.3.3/crtbegin.o
-LC:/MinGW/bin/../lib/gcc-lib/mingw32/3.3.3 -LC:/MinGW/bin/../lib/gcc-lib
-L/mingw/lib/gcc-lib/mingw32/3.3.3
-LC:/MinGW/bin/../lib/gcc-lib/mingw32/3.3.3/../../../../mingw32/lib
-L/mingw/lib/gcc-lib/mingw32/3.3.3/../../../../mingw32/lib -L/mingw/lib
-LC:/MinGW/bin/../lib/gcc-lib/mingw32/3.3.3/../../..
-L/mingw/lib/gcc-lib/mingw32/3.3.3/../../.. tst.o -lstdc++ -lmingw32 -lgcc
-lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -lmingw32
-lgcc -lmoldname -lmingwex -lmsvcrt
C:/MinGW/bin/../lib/gcc-lib/mingw32/3.3.3/crtend.o

-- 
   Summary: Segmentation fault after exception in list and set
destructors
   Product: gcc
   Version: 3.3.3
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: libstdc++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: vldmrrr at yahoo dot com
CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: mingw32
  GCC host triplet: mingw32
GCC target triplet: mingw32


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20579


[Bug libstdc++/20579] Segmentation fault after exception in list and set destructors

2005-03-21 Thread vldmrrr at yahoo dot com

--- Additional Comments From vldmrrr at yahoo dot com  2005-03-21 17:56 
---
Created an attachment (id=8427)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=8427&action=view)
preprocessed file


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20579


[Bug libstdc++/20579] Segmentation fault after exception in list and set

2005-03-21 Thread vldmrrr at yahoo dot com


-- 
   What|Removed |Added

Summary|Segmentation fault after|Segmentation fault after
   |exception in list and set   |exception in list and set
   |destructors |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20579


[Bug libstdc++/20579] Segmentation fault after exception in list and set destructors

2005-03-21 Thread vldmrrr at yahoo dot com

--- Additional Comments From vldmrrr at yahoo dot com  2005-03-21 19:17 
---
(In reply to comment #3)

Ok, thanks, now it is clear. 

-- 
   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20579


[Bug ada/39602] New: Clock function freezes in infinite loop when run under wine on linux

2009-03-31 Thread vldmrrr at yahoo dot com
Here is the program:
--tst.adb--
with Ada.Calendar;
with Ada.Text_IO;use Ada.Text_IO;
procedure tst is
t: Ada.Calendar.Time;
begin
Put_Line ("Calling clock");
t := Ada.Calendar.Clock;
Put_Line ("Got clock" );
end tst;
---

Built program runs fine under windows xp. When the same executable is run under
wine on linux it freezes without any printouts. The program is spinning inside
the loop in function System.OS_Primitives.Get_Base_Time
(lib\gcc\i686-pc-mingw32\4.3.3\adainclude\s-osprim.adb):

--s-osprim.adb---
  --  Here we must be sure that both of these calls are done in a short
  --  amount of time. Both are base time and should in theory be taken
  --  at the very same time.

  loop
 GetSystemTimeAsFileTime (Base_Time'Access);

 if QueryPerformanceCounter (Base_Ticks'Access) = Win32.FALSE then
pragma Assert
  (Standard.False,
   "Could not query high performance counter in Clock");
null;
 end if;

 GetSystemTimeAsFileTime (Test_Now'Access);

 exit when Test_Now - Base_Time = Max_Elapsed;
  end loop;
-

Apparently the assumption does not hold under wine and loop is never exited.
What this code tries to achieve is close correlation between times returned by
GetSystemTimeAsFileTime and QueryPerformanceCounter. But in actual place where
the two values are used (the Clock function) the same effort is not made, so it
looks like that this approach will not achieve what it is intended for. I
suggest removing this loop altogether.


-- 
   Summary: Clock function freezes in infinite loop when run under
wine on linux
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: ada
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: vldmrrr at yahoo dot com
 GCC build triplet: i686-pc-mingw32
  GCC host triplet: i686-pc-mingw32
GCC target triplet: i686-pc-mingw32


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39602