System Exit Problems

VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.

Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig

System Exit Problems

Postby Brad Selfridge » Thu Jan 11, 2007 1:47 pm

I have the same packaged headless image running in two different directories on an AIX 5.2 box, and one image will successfully shutdown when the "System exit" is invoked and the other image does not. The second image appears to have shut itself down, (according to the log files), but the pid never goes away. The image no longer consumes any cpu, but it does hang onto it memory.

My SA's cannot see anything on he OS side and I don't understand why the VM cannot succesfully initiate a SYSEXIT.

Any and all help is appreciated.

We are running VAST 6.0.1.
Brad Selfridge
(ECOM Elite)

Embarq Corp.
Brad Selfridge
 
Posts: 2
Joined: Thu Jan 11, 2007 1:10 pm

Postby nmongeau » Fri Jan 12, 2007 10:18 am

Hi Brad,

this may (or not) be of some help, but I ran into somewhat similar problems a long time ago, in fact too long to remember exactly the circumstances. I do recall that such behavior would occur after a walkback, and I solved it by calling this method (a homemade extension) to exit, instead of the standard "System exit" :

exitForced

"Exit the image. Do not poll interested parties."

OSCall new exitProcess: nil.
self entryCount = 1
ifTrue:
[self
shutDown;
exiting;
shutdownVM].

Normand
nmongeau
[|]
 
Posts: 29
Joined: Fri Jan 12, 2007 9:37 am

Postby Brad Selfridge » Fri Jan 12, 2007 1:00 pm

I looked into the "System exit" method and found that the method has the potential to NOT execute the "System primitiveExit" method. So, I executed the "System primitiveExit" method instead of "System exit" and it didn't seem to make any difference. I think I'll have to open a problem ticket with Instantiations.
Brad Selfridge
(ECOM Elite)

Embarq Corp.
Brad Selfridge
 
Posts: 2
Joined: Thu Jan 11, 2007 1:10 pm

Postby Ralf » Fri Jan 26, 2007 1:18 am

we have hat many problems with exit on unix platforms. So we have written ower own methods to solve the problems. But I can't not remember me exactly on the problems.:-) Once was the unload problem on DB2 databases. Look the post and try it.:-)

please, excuse me, the comment are in german. Remember, all methodes are for unix systems. I hope this can help you.

our exit: methode

AnyClassName class>>exit: anExitCode

System isRuntime
ifTrue:
[self platformExit: anExitCode withObject: nil]
ifFalse:
[GvTranscript
nextPutAll: 'IfbAdapterSystem class>>exit: '"@CMNO";
nextPutAll: anExitCode asString;
cr]


the platformExit methode for unix systems

AnyClassName class >>platformExit: anExitCode withObject: anObject

^System ifbPlatformExit: anExitCode withObject: anObject

EmSystemConfiguration>>ifbPlatformExit: errorCode withObject: anObject
"Exit the image."

self entryCount = 1 ifTrue:
["Poll all interested parties to see if this is okay."
self close ifFalse: [^self].
self
shutDown;
exiting;
ifbShutdownVM ].
^self primitiveExit: errorCode withObject: anObject

the shutDown methode for unix

EmSystemConfiguration>>ifbShutdownVM

"Shutdown the low level virtual machine and image objects.
This must be performed on every image exit."

Processor enableAsyncMessages: false.
PlatformLibrary ifbShutDown


PlatformLibrary class>>ifbShutDown
"Close all PlatformLibraries in the OS but do not
update the state of any PlatformFunctions in the image.
The PlatformFunctions update is not required because the
image is exiting.
After this method is executed, PlatformFunctions cannot
be called."

| collOfSharedLibsToUnload |

"Sonderregelung fuer AIX:
Es gab Probleme mit DB2 V8. Wenn das Programm sich beendete waren offensichtlich irgendwelche DB2-Vorgaenge noch nicht abgeschlossen (evtl.
irgendwelche Callbacks von DB2-Seite). Jedenfalls fuehrte es dazu, dass der Programm-ExitCode nicht 0 (oder was auch immer wir zurueckgeben wollten) war,
sondern 139 (oder in der Art).
Wenn wir die DB2-Bibliotheken nicht an dieser Stelle schlossen, sondern es nachher dem Betriebssystem ueberliessen, funktionierte es auch unter AIX, und
der Return-Code war 0.
Da wir nicht genau wissen, welche DB2-Bibliothek Probleme macht (db2.o oder libdb2.so oder was auch immer) nehmen wir jede Bibliothek in deren Name db2
vorkommt, vom Schliessen aus.
17.02.2006
Probleme traten jetzt auch unter Linux auf, daher obiges Verhalten auch auf Linux erweitert."

collOfSharedLibsToUnload := SharedLibraries select: [:eLib | eLib notNil].
(IfbAdapterSystem isAix or: [IfbAdapterSystem isLinux]) ifTrue:
[collOfSharedLibsToUnload := collOfSharedLibsToUnload reject: [:eLib | eLib name includesString: 'db2'].].
collOfSharedLibsToUnload do:
[:pl |
[pl primClose]
when: ExError
do: [:ex |
pl forceClose.
ex exitWith: nil].].
"evtl. muss man ja etwas warten, bevor sich die Applikation schliesst"
(Delay forSeconds: 5) wait.
Ralf
 
Posts: 41
Joined: Thu Nov 16, 2006 4:18 am


Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: No registered users and 1 guest