I had such an image last week and I managed to get the stacks with GDB (this
was on a Debian Linux. When trying the same on my Mac I had to force shutdown
the machine… doesn't seem to work the same everywhere…):
$ gdb attach <pid>
In case stdout/stderr are not redirected to a file, we redirect them to your
shell. Else, skip to (*).
(gdb) call (void) close(1)
(gdb) call (void) close(2)
Now, let's see which shell we are on:
(gdb) shell tty
/dev/ttyp1 <----- the result may be different (this is the whole point)
(gdb) call (int) open("/dev/ttyp1", 2, 0) <----- set the right shell here
$1 = 1
(gdb) call (int) open("/dev/ttyp1", 1, 0) <----- here too
$2 = 2
(*)
No, lets get some datapoints
(gdb) call printCallStack() // prints the current active Smalltalk stack
(gdb) call (int) printAllStacks() // prints all Smalltalk stacks
gdb) bt // prints the C backtrace, i.e., the stack of the VM interpreter
In case you use stdout/stderr redirected to files, you may need to flush to see
the output:
(gdb) call fflush(stderr)
(gdb) call fflush(stdout)
from: http://developer.apple.com/technotes/tn/tn2032.html
http://minnow.cc.gatech.edu/squeak/533
HTH, Max
On 23.03.2012, at 11:13, Denis Kudriashov wrote:
> Hello.
>
> I have standalone application with UI which hangs sometime (very rarely).
> This application has many threads which interacts with server.
> All interactions with server and UI activity logged.
>
> But at hang state there are no new log entries. There are no server
> interactions.
> It looks like all VM block image stuff. ("alt ." not work too).
> Logs always finished at same position. I know where I should add extra
> logging which give me information before hang.
>
> So I need help.
> What information about system can help me? What code I should use?
> Is somebody has same problems?
>
> Application uses old cog VM (maybe one of first distributions from Eliot) and
> Pharo1.1.
> Application uses continuations actively.
> I want try updated VM. What version I should use? I need most reliable cog
> (not latest I think).
>
> Best regards,
> Denis
>