Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » U++ community news and announcements » Upp 2007.1beta2 released
Re: Upp 2007.1beta2 released [message #7889 is a reply to message #7853] Mon, 29 January 2007 11:15 Go to previous messageGo to previous message
piotr5 is currently offline  piotr5
Messages: 107
Registered: November 2005
Experienced Member
Thanks. another bug I found is that single-file packages don't
get linked into a lib, even though the final link-command does
expect *.a instead of *.o. but this bug is also present in
older versions and I simply ignored it...

but back to the hydra-problem: I tried to debug the "waiting",
and it turned out that waitpid did keep returning -1 to
indicate an error (errno 10, "child does not exist" or something)
while Web/sproc.cpp did interprete this as "child hasn't
exited yes".

the debug-session did look like this:

GNU gdb 2003-02-03-cvs
...
Console::Wait() (this=0xbffeebb8)
    at /home/p/upp/uvs/upp-uvs/ide/Console.cpp:252
252		for(;;) {
(gdb) 
253			ProcessEvents();
(gdb) 
254			switch(Flush()) {
(gdb) 
256				case  0: sleep = min(sleep + 5, 20); break;
(gdb) 
259			Ctrl::GuiSleep(sleep);
(gdb) 
252		for(;;) {
(gdb) 
253			ProcessEvents();
(gdb) 
254			switch(Flush()) {
(gdb) s
Console::Flush() (this=0xbffeebb8)
    at /home/p/upp/uvs/upp-uvs/ide/Console.cpp:67
67		bool done_output = false;
(gdb) n
...
85		for(int i = 0; i < processes.GetCount(); i++) {
(gdb) 
86			Slot& slot = processes[i];
(gdb) 
87			if(!slot.process)
(gdb) 
88				continue;
(gdb) 
85		for(int i = 0; i < processes.GetCount(); i++) {
(gdb) 
86			Slot& slot = processes[i];
(gdb) 
87			if(!slot.process)
(gdb) 
89			String s;
(gdb) 
90			slot.process->Read(s);
(gdb) 
91			if(!IsNull(s)) {
(gdb) 
104			if(!slot.process->IsRunning()) {
(gdb) s
Upp::One<Upp::SlaveProcess>::operator->() (this=0x886d490)
    at /home/p/upp/uvs/upp-uvs/Core/Other.h:30
30		T          *operator->()               { ChkP(); 
...
Upp::LocalSlaveProcess::IsRunning() (this=0x94c5e80)
    at /home/p/upp/uvs/upp-uvs/Web/sproc.cpp:358
358		if(!pid || !IsNull(exit_code)) {
(gdb) n
362		int status = 0, wp;
(gdb) 
363		if((wp = waitpid(pid, &status, WNOHANG | WUNTRACED)) != pid || !DecodeExitCode(status))
(gdb) s
364			return true;
(gdb) p wp
$1 = -1
(gdb) p status
$2 = 0
(gdb) p pid
$3 = 905
(gdb) n
368	}
(gdb) 
Console::Flush() (this=0xbffeebb8)
    at /home/p/upp/uvs/upp-uvs/ide/Console.cpp:114
114			running = true;
(gdb) n
85		for(int i = 0; i < processes.GetCount(); i++) {
(gdb) p processes
$4 = {<MoveableAndDeepCopyOption<Upp::Array<Console::Slot>,Upp::EmptyClass>> = {<Moveable<Upp::Array<Console::Slot>,Upp::DeepCopyOption<Upp::Array<Console::Slot>, Upp::EmptyClass> >> = {<DeepCopyOption<Upp::Array<Console::Slot>,Upp::EmptyClass>> = {<EmptyClass> = {<No data fields>}, <No data fields>}, <No data fields>}, <No data fields>}, 
  vector = {<MoveableAndDeepCopyOption<Upp::Vector<void*>,Upp::EmptyClass>> = {<Moveable<Upp::Vector<void*>,Upp::DeepCopyOption<Upp::Vector<void*>, Upp::EmptyClass> >> = {<DeepCopyOption<Upp::Vector<void*>,Upp::EmptyClass>> = {<EmptyClass> = {<No data fields>}, <No data fields>}, <No data fields>}, <No data fields>}, 
    vector = 0x886d480, items = 2, alloc = 2}}
(gdb) p processes[0]
$5 = (Slot &) @0x8815b80: {
  process = {<MoveableAndDeepCopyOption<Upp::One<Upp::SlaveProcess>,Upp::EmptyClass>> = {<Moveable<Upp::One<Upp::SlaveProcess>,Upp::DeepCopyOption<Upp::One<Upp::SlaveProcess>, Upp::EmptyClass> >> = {<DeepCopyOption<Upp::One<Upp::SlaveProcess>,Upp::EmptyClass>> = {<EmptyClass> = {<No data fields>}, <No data fields>}, <No data fields>}, <No data fields>}, ptr = 0x0}, 
  cmdline = {<AString<char,Upp::String>> = {<Moveable<Upp::String,Upp::EmptyClass>> = {<EmptyClass> = {<No data fields>}, <No data fields>}, 
      ptr = 0x889a33c "/usr/bin/c++ -c  -I\"/home/p/upp/uvs/upp-uvs\" -I\"/usr/X11R6/include\" -I\"/usr/include\" -I\"/usr/X11R6/include/freetype2\" -I\"/opt/upp/uppsrc\" -DflagGUI -DflagGCC -DflagSHARED -DflagDEBUG_FULL -DflagLINUX "...}, <No data fields>}, 
  output = {<AString<char,Upp::String>> = {<Moveable<Upp::String,Upp::EmptyClass>> = {<EmptyClass> = {<No data fields>}, <No data fields>}, 
      ptr = 0x853974c ""}, <No data fields>}, 
  key = {<AString<char,Upp::String>> = {<Moveable<Upp::String,Upp::EmptyClass>> = {<EmptyClass> = {<No data fields>}, <No data fields>}, 
      ptr = 0x94e3404 "/opt/upp/out/Core/GCC.Debug_full.Gui.Release.Shared/Win32Com.o"}, <No data fields>}, 
  group = {<AString<char,Upp::String>> = {<Moveable<Upp::String,Upp::EmptyClass>> = {<EmptyClass> = {<No data fields>}, <No data fields>}, 
      ptr = 0x94a7e44 "Core"}, <No data fields>}, outfile = 0x0, 
  quiet = false, exitcode = 0, last_msecs = 948604485}
(gdb) p processes[1]
$6 = (Slot &) @0x886d490: {
  process = {<MoveableAndDeepCopyOption<Upp::One<Upp::SlaveProcess>,Upp::EmptyClass>> = {<Moveable<Upp::One<Upp::SlaveProcess>,Upp::DeepCopyOption<Upp::One<Upp::SlaveProcess>, Upp::EmptyClass> >> = {<DeepCopyOption<Upp::One<Upp::SlaveProcess>,Upp::EmptyClass>> = {<EmptyClass> = {<No data fields>}, <No data fields>}, <No data fields>}, <No data fields>}, ptr = 0x94c5e80}, 
  cmdline = {<AString<char,Upp::String>> = {<Moveable<Upp::String,Upp::EmptyClass>> = {<EmptyClass> = {<No data fields>}, <No data fields>}, 
      ptr = 0x94e937c "/usr/bin/c++ -c  -I\"/home/p/upp/uvs/upp-uvs\" -I\"/usr/X11R6/include\" -I\"/usr/include\" -I\"/usr/X11R6/include/freetype2\" -I\"/opt/upp/uppsrc\" -DflagGUI -DflagGCC -DflagSHARED -DflagDEBUG_FULL -DflagLINUX "...}, <No data fields>}, 
  output = {<AString<char,Upp::String>> = {<Moveable<Upp::String,Upp::EmptyClass>> = {<EmptyClass> = {<No data fields>}, <No data fields>}, 
      ptr = 0x853974c ""}, <No data fields>}, 
  key = {<AString<char,Upp::String>> = {<Moveable<Upp::String,Upp::EmptyClass>> = {<EmptyClass> = {<No data fields>}, <No data fields>}, 
      ptr = 0x94d89cc "/opt/upp/out/Core/GCC.Debug_full.Gui.Release.Shared/OL_Set.o"}, <No data fields>}, 
  group = {<AString<char,Upp::String>> = {<Moveable<Upp::String,Upp::EmptyClass>> = {<EmptyClass> = {<No data fields>}, <No data fields>}, 
      ptr = 0x94a7e44 "Core"}, <No data fields>}, outfile = 0x0, 
  quiet = false, exitcode = 0, last_msecs = 955095921}
(gdb) q
The program is running.  Quit anyway (and detach it)? (y or n) Detaching from program: /home/p/upp/out/gcc.Debug_full.Gui.Shared/ide, process 362


I fixed this bad behaviour by forcing IsRunning() to return
true only when waitpid didn't return -1, and while I already
where altering the code I also inserted some logging of the
errno. then I tried again, and no locking. still, this is not
a bug-fix, since the process still didn't pass its return-
code. maybe someone might actually find the real bug. I
logged the ide's stdout, here's the output (as above, I
inserted "..." for brevity):

...
LocalSlaveProcess::Free, pid = 294
rpipe[-1, -1]
wpipe[-1, -1]
LocalSlaveProcess::Open(/usr/bin/c++ -c ... -o "/opt/upp/out/Core/GCC.Gui.Shared/Mt.o")
IsRunning() -> no

LocalSlaveProcess::Free, pid = 294
rpipe[-1, -1]
wpipe[-1, -1]

LocalSlaveProcess::Open
rpipe[7, 14]
wpipe[15, 16]
	fork, pid = 698, getpid = 294
parent process - continue
LocalSlaveProcess::Open(/usr/bin/c++ -c  ... -o "/opt/upp/out/Core/GCC.Gui.Shared/Thread.o")
IsRunning() -> no

LocalSlaveProcess::Free, pid = 294
rpipe[-1, -1]
wpipe[-1, -1]

LocalSlaveProcess::Open
rpipe[17, 18]
wpipe[19, 20]
	fork, pid = 700, getpid = 294
parent process - continue
IsRunning() -> no, just exited, exit code = 0
IsRunning() -> no
IsRunning() -> no
IsRunning() -> no

LocalSlaveProcess::Free, pid = 294
rpipe[7, 14]
wpipe[15, 16]
IsRunning() -> no
IsRunning() -> no

LocalSlaveProcess::Free, pid = 294
rpipe[-1, -1]
wpipe[-1, -1]
IsRunning() -> no, just exited, errno = 10
IsRunning() -> no
IsRunning() -> no

LocalSlaveProcess::Free, pid = 294
rpipe[17, 18]
wpipe[19, 20]
IsRunning() -> no
IsRunning() -> no

LocalSlaveProcess::Free, pid = 294
rpipe[-1, -1]
wpipe[-1, -1]
LocalSlaveProcess::Open(/usr/bin/c++ -c  ... -o "/opt/upp/out/Core/GCC.Gui.Shared/OL_Set.o")
IsRunning() -> no

LocalSlaveProcess::Free, pid = 294
rpipe[-1, -1]
wpipe[-1, -1]

LocalSlaveProcess::Open
rpipe[7, 14]
wpipe[15, 16]
	fork, pid = 704, getpid = 294
parent process - continue
IsRunning() -> no, just exited, exit code = 0
IsRunning() -> no
IsRunning() -> no
IsRunning() -> no

LocalSlaveProcess::Free, pid = 294
rpipe[7, 14]
wpipe[15, 16]
IsRunning() -> no
IsRunning() -> no

LocalSlaveProcess::Free, pid = 294
rpipe[-1, -1]
wpipe[-1, -1]
LocalSlaveProcess::Open(/usr/bin/c++ -c ... -o "/opt/upp/out/Core/GCC.Gui.Shared/heap.o")
IsRunning() -> no

LocalSlaveProcess::Free, pid = 294
rpipe[-1, -1]
wpipe[-1, -1]

LocalSlaveProcess::Open
rpipe[7, 14]
wpipe[15, 16]
	fork, pid = 707, getpid = 294
parent process - continue
LocalSlaveProcess::Open(/usr/bin/c++ -c ... -o "/opt/upp/out/Core/GCC.Gui.Shared/heapdbg.o")
IsRunning() -> no

LocalSlaveProcess::Free, pid = 294
rpipe[-1, -1]
wpipe[-1, -1]

LocalSlaveProcess::Open
rpipe[17, 18]
wpipe[19, 20]
	fork, pid = 709, getpid = 294
parent process - continue
Read() -> select
Read(), read -> 1024: rpipe[7, 14]
wpipe[15, 16]
IsRunning() -> no
IsRunning() -> no

LocalSlaveProcess::Free, pid = 294
rpipe[-1, -1]
wpipe[-1, -1]
LocalSlaveProcess::Open(/usr/bin/c++ -c ... -o "/opt/upp/out/Core/GCC.Gui.Shared/Mt.o")
IsRunning() -> no

LocalSlaveProcess::Free, pid = 294
rpipe[-1, -1]
wpipe[-1, -1]

LocalSlaveProcess::Open
rpipe[7, 14]
wpipe[15, 16]
	fork, pid = 698, getpid = 294
parent process - continue
LocalSlaveProcess::Open(/usr/bin/c++ -c ... -fexceptions 
Read() -> select
Read(), read -> 1024:  -Os -finline-limit=20 -x c++ "/home/p/upp/uvs/upp-uvs/Core/Thread.cpp" -o "/opt/upp/out/Core/GCC.Gui.Shared/Thread.o")
IsRunning() -> no

LocalSlaveProcess::Free, pid = 294
rpipe[-1, -1]
wpipe[-1, -1]

LocalSlaveProcess::Open
rpipe[17, 18]
wpipe[19, 20]
	fork, pid = 700, getpid = 294
parent process - continue
IsRunning() -> no, just exited, exit code = 0
IsRunning() -> no
IsRunning() -> no
IsRunning() -> no

LocalSlaveProcess::Free, pid = 294
rpipe[7, 14]
wpipe[15, 16]
IsRunning() -> no
IsRunning() -> no

LocalSlaveProcess::Free, pid = 294
rpipe[-1, -1]
wpipe[-1, -1]
IsRunning() -> no, just exited, errno = 10
IsRunning() -> no
IsRunning() -> no

LocalSlaveProcess::Free, pid = 294
rpipe[17, 18]
wpipe[19, 20]
IsRunning() -> no
IsRunning() -> no

LocalSlaveProcess::Free, pid = 294
rpipe[-1, -1]
wpipe[-1, -1]
LocalSlaveProcess::Open(/usr/bin/c++ -c  -I"/home/p/upp/uvs/upp-uvs" ...
...
LocalSlaveProcess::Open(/usr/bin/c++ -c ... -o "/opt/upp/out/Draw/GCC.Gui.Shared/DrawTextXft.o")
IsRunning() -> no

LocalSlaveProcess::Free, pid = 294
rpipe[-1, -1]
wpipe[-1, -1]

LocalSlaveProcess::Open
rpipe[17, 18]
wpipe[19, 20]
	fork, pid = 
Read() -> select
Read(), read -> 1024: 974, getpid = 294
parent process - continue
IsRunning() -> no, just exited, exit code = 0
IsRunning() -> no
IsRunning() -> no
IsRunning() -> no

LocalSlaveProcess::Free, pid = 294
rpipe[7, 14]
wpipe[15, 16]
IsRunning() -> no
IsRunning() -> no

LocalSlaveProcess::Free, pid = 294
rpipe[-1, -1]
wpipe[-1, -1]
LocalSlaveProcess::Open(/usr/bin/c++ -c ... -o "/opt/upp/out/Draw/GCC.Gui.Shared/Draw.o")
IsRunning() -> no

LocalSlaveProcess::Free, pid = 294
rpipe[-1, -1]
wpipe[-1, -1]

LocalSlaveProcess::Open
rpipe[7, 14]
wpipe[15, 16]
	fork, pid = 0, getpid = 977
child process - execute application
26arguments:
[0]: </usr/bin/c++>
[1]: <-c>
[2]: <-I/home/p/upp/uvs/upp-uvs>
[3]: <-I/usr/X11R6/include>
[
IsRunning() -> no, just exited, exit code = 0
IsRunning() -> no
IsRunning() -> no
IsRunning() -> no

LocalSlaveProcess::Free, pid = 294
rpipe[7, 14]
wpipe[15, 16]
IsRunning() -> no
IsRunning() -> no

LocalSlaveProcess::Free, pid = 294
rpipe[-1, -1]
wpipe[-1, -1]
IsRunning() -> no, just exited, errno = 10
IsRunning() -> no
IsRunning() -> no

LocalSlaveProcess::Free, pid = 294
rpipe[17, 18]
wpipe[19, 20]
IsRunning() -> no
IsRunning() -> no

LocalSlaveProcess::Free, pid = 294
rpipe[-1, -1]
wpipe[-1, -1]
LocalSlaveProcess::Open(/usr/bin/c++ -c ... -o "/opt/upp/out/Draw/GCC.Gui.Shared/DrawOpWin32.o")
IsRunning() -> no

LocalSlaveProcess::Free, pid = 294
rpipe[-1, -1]
wpipe[-1, -1]

LocalSlaveProcess::Open
rpipe[7, 14]
wpipe[15, 16]
	fork, pid = 981, getpid = 294
parent process - continue
LocalSlaveProcess::Open(/usr/bin/c++ -c ... -o "/opt/upp/out/Draw/GCC.Gui.Shared/DrawOpX11.o")
IsRunning() -> no

LocalSlaveProcess::Free, pid = 294
rpipe[-1, -1]
wpipe[-1, -1]

LocalSlaveProcess::Open
rpipe[17, 18]
wpipe[19, 20]
	fork, pid = 983, getpid = 294
parent process - continue
IsRunning() -> no, just exited, exit code = 0
IsRunning() -> no
IsRunning() -> no
IsRunning() -> no

LocalSlaveProcess::Free, pid = 294
rpipe[7, 14]
wpipe[15, 16]
IsRunning() -> no
IsRunning() -> no

LocalSlaveProcess::Free, pid = 294
rpipe[-1, -1]
wpipe[-1, -1]
LocalSlaveProcess::Open(/usr/bin/c++ -c ... -o "/opt/upp/out/Draw/GCC.Gui.Shared/DrawData.o")
IsRunning() -> no

LocalSlaveProcess::Free, pid = 294
rpipe[-1, -1]
wpipe[-1, -1]

LocalSlaveProcess::Open
rpipe[7, 14]
wpipe[15, 16]
	fork, pid = 986, getpid = 294
parent process - continue
IsRunning() -> no, just exited, exit code = 0
IsRunning() -> no
IsRunning() -> no
IsRunning() -> no

LocalSlaveProcess::Free, pid = 294
rpipe[17, 18]
wpipe[19, 20]
IsRunning() -> no
IsRunning() -> no

LocalSlaveProcess::Free, pid = 294
rpipe[-1, -1]
wpipe[-1, -1]
LocalSlaveProcess::Open(/usr/bin/c++ -c ... -o "/opt/upp/out/Draw/GCC.Gui.Shared/Drawing.o")
IsRunning() -> no

LocalSlaveProcess::Free, pid = 294
rpipe[-1, -1]
wpipe[-1, -1]

LocalSlaveProcess::Open
rpipe[17, 18]
wpipe[19, 20]
	fork, pid = 989, getpid = 294
parent process - continue
Read() -> select
Read(), read -> 1024: upp/uvs/upp-uvs>
[3]: <-I/usr/X11R6/include>
[
IsRunning() -> no, just exited, exit code = 0
IsRunning() -> no
IsRunning() -> no
IsRunning() -> no

LocalSlaveProcess::Free, pid = 294
rpipe[7, 14]
wpipe[15, 16]
IsRunning() -> no
IsRunning() -> no

LocalSlaveProcess::Free, pid = 294
rpipe[-1, -1]
wpipe[-1, -1]
IsRunning() -> no, just exited, errno = 10
IsRunning() -> no
IsRunning() -> no

LocalSlaveProcess::Free, pid = 294
rpipe[17, 18]
wpipe[19, 20]
IsRunning() -> no
IsRunning() -> no

LocalSlaveProcess::Free, pid = 294
rpipe[-1, -1]
wpipe[-1, -1]
LocalSlaveProcess::Open(/usr/bin/c++ -c  -I"/home/p/upp/uvs/upp-uvs" ...

[Updated on: Mon, 29 January 2007 11:22]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Forum email trouble....
Next Topic: Upp 2007.2rc1 released
Goto Forum:
  


Current Time: Sat May 04 00:11:10 CEST 2024

Total time taken to generate the page: 0.02997 seconds