SessionModel>>saveSessionAs:description: fails with primErrorCode=0 and buildExeErrorCode=nil

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

SessionModel>>saveSessionAs:description: fails with primErrorCode=0 and buildExeErrorCode=nil

Ivar Maeland
We have a nightly build which install all of our source code into a base
Smalltalk image and at the end save the image.



Most the time this works fine but some times it fails with error:

primErrorCode=0 and buildExeErrorCode=nil.



It looks like SessionModel>>privateBuildExe:fromExe: (temporary bound from
VCOFF31W.SLL) returns nil.



Have anyone had any experience with this?

Could it be that binding / unbinding of the SLL cause problems?



I was thinking of adding "try again" code like the following.

Any comments on whether that could solve the problem or advice against it?



buildExe: newImageName fromExe: oldImageName

                "Private - Assemble an exe from the pieces generated by the
virtual

                machine. Answer 0 if it worked, the error code if any
errors."

        | binder installer result maxTrials |

        ( Smalltalk includesKey: #Coff ) ifFalse: [

                installer := DefinitionInstaller current.

                DefinitionInstaller current: nil. "get a default (base)
installer."

                binder := SmalltalkLibraryBinder bindTo: 'vcoff',
SmalltalkLibrary versionAndPlatformExtension ].

        result := self privateBuildExe: newImageName fromExe: oldImageName.



"NEW CODE START"    

        maxTrials := 10.

        [result isNil and: [maxTrials > 0]] whileTrue: [

                Time sleepMilliseconds: 1000.

                maxTrials := maxTrials - 1.

                result := self privateBuildExe: newImageName fromExe:
oldImageName.

        ].

"NEW CODE END"



        binder notNil ifTrue: [ binder unBind ].

        installer notNil ifTrue: [ DefinitionInstaller current: installer ].

        ^result

***           this signature added by listserv             ***
*** Visit  http://www.listserv.dfn.de/archives/vswe-l.html ***
*** for archive browsing and VSWE-L membership management  ***
Reply | Threaded
Open this post in threaded view
|

Re: SessionModel>>saveSessionAs:description: fails with primErrorCode=0 and buildExeErrorCode=nil

Andreas Rosenberg
I vaguely remember problems with saveSession: quite some time ago.

To my opinion t is not related to the binding of the VCOFF-SLL.  You could
check this by testing the result of the bindTo:.

The VCOFF SLL reads the V.EXE and builds a new V.EXE by assembling the
various COFF sections and appending a new ".VIMAGE" section.

Because the privateBuildExe:fromExe: returns nil, a FileError exception must
have happened. But the handler should return the hostErrorCode of the api call.

So you should look for ways how a FileError exception could be created with
 hostErrorCode being nil.

It is not easy to get more information what's going on here. Maybe you can
try this:

temporarily add a "self halt" into
ExceptionHandler >>#evaluateResponseBlock: responseBlock for: anException

before the responseBlock is being evaluated. To prevent halts poping up
under other conditions you could write something like this:
..
((Smalltalk at: #Coff) notNil and: [anException isKindOf: FileError]) ifTrue: [ self halt.].
responseBlock value: anException.
...

Maybe this helps finding the root cause for the error.

Regards
  Andreas

-----Original Message-----
From: Using Visual Smalltalk for Windows/Enterprise [mailto:[hidden email]] On Behalf Of
=?iso-8859-1?Q?[hidden email]?=
Sent: Freitag, 22. November 2013 15:33
To: [hidden email]
Subject: SessionModel>>saveSessionAs:description: fails with primErrorCode=0 and buildExeErrorCode=nil

We have a nightly build which install all of our source code into a base
Smalltalk image and at the end save the image.



Most the time this works fine but some times it fails with error:

primErrorCode=0 and buildExeErrorCode=nil.



It looks like SessionModel>>privateBuildExe:fromExe: (temporary bound from
VCOFF31W.SLL) returns nil.



Have anyone had any experience with this?

Could it be that binding / unbinding of the SLL cause problems?



I was thinking of adding "try again" code like the following.

Any comments on whether that could solve the problem or advice against it?



buildExe: newImageName fromExe: oldImageName

                "Private - Assemble an exe from the pieces generated by the
virtual

                machine. Answer 0 if it worked, the error code if any
errors."

        | binder installer result maxTrials |

        ( Smalltalk includesKey: #Coff ) ifFalse: [

                installer := DefinitionInstaller current.

                DefinitionInstaller current: nil. "get a default (base)
installer."

                binder := SmalltalkLibraryBinder bindTo: 'vcoff',
SmalltalkLibrary versionAndPlatformExtension ].

        result := self privateBuildExe: newImageName fromExe: oldImageName.



"NEW CODE START"    

        maxTrials := 10.

        [result isNil and: [maxTrials > 0]] whileTrue: [

                Time sleepMilliseconds: 1000.

                maxTrials := maxTrials - 1.

                result := self privateBuildExe: newImageName fromExe:
oldImageName.

        ].

"NEW CODE END"



        binder notNil ifTrue: [ binder unBind ].

        installer notNil ifTrue: [ DefinitionInstaller current: installer ].

        ^result

***           this signature added by listserv             ***
*** Visit  http://www.listserv.dfn.de/archives/vswe-l.html ***
*** for archive browsing and VSWE-L membership management  ***

***           this signature added by listserv             ***
*** Visit  http://www.listserv.dfn.de/archives/vswe-l.html ***
*** for archive browsing and VSWE-L membership management  ***