Hi,

See attachment with the last entries.
Each StartupPreferences* is a new startup of the image.
With a quit or quit/nosave -> it works.
Else it doesn't.

Cheers,
Vincent



> -----Message d'origine-----
> De : Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] De la part de
> Thibault Raffaillac
> Envoyé : lundi 29 février 2016 11:23
> À : pharo-users@lists.pharo.org
> Objet : Re: [Pharo-users] CrashDetector made for sprint
>
> Hi Vincent,
>
> I cannot manage to reproduce your bug (on Mac). Can you post the last entry
> in your .changes file?
>
> Cheers,
> Thibault
>
> > Nice!
> >
> > I am eager to see it with a better change set manager, i.e. Epicea ;)
> >
> > Your tool works nicely when you save and close the image properly.
> > However, when you close directly the program by clicking on the cross
> > (which is easier than going into the world menu after a CTRL+SHIFT+S),
> > the image doesn't crashes, but you get a message to retrieve your changes.
> > I think that managing this case is harder because you have to interact
> > with the vm, haven't you?
> >
> > Cheers,
> > Vincent


!!!*************************************************************************************
"Ce message et les pièces jointes sont confidentiels et réservés à l'usage 
exclusif de ses destinataires. Il peut également être protégé par le secret 
professionnel. Si vous recevez ce message par erreur, merci d'en avertir 
immédiatement l'expéditeur et de le détruire. L'intégrité du message ne pouvant 
être assurée sur Internet, la responsabilité de Worldline ne pourra être 
recherchée quant au contenu de ce message. Bien que les meilleurs efforts 
soient faits pour maintenir cette transmission exempte de tout virus, 
l'expéditeur ne donne aucune garantie à cet égard et sa responsabilité ne 
saurait être recherchée pour tout dommage résultant d'un virus transmis.

This e-mail and the documents attached are confidential and intended solely for 
the addressee; it may also be privileged. If you receive this e-mail in error, 
please notify the sender immediately and destroy it. As its integrity cannot be 
secured on the Internet, the Worldline liability cannot be triggered for the 
message content. Although the sender endeavours to maintain a computer 
virus-free network, the sender does not warrant that this transmission is 
virus-free and will not be liable for any damages resulting from any virus 
transmitted.!!!"
'----QUIT----2016-02-26T15:50:01.311489+01:00 Pharo-50560.image priorSource: 
30377673' size
        => 84!
!CrashDetector class methodsFor: 'system startup' stamp: 'ThibaultRaffaillac 
2/26/2016 16:47'!
initialize
        SessionManager default registerToolClassNamed: self name.! !
!CrashDetector class methodsFor: 'system startup' stamp: 'ThibaultRaffaillac 
2/26/2016 16:47'!
startUp: resuming
        resuming ifTrue: [ self new activate ].! !
!CrashDetector methodsFor: 'activation' stamp: 'ThibaultRaffaillac 2/26/2016 
16:02'!
activate
        self crashed ifTrue:
                [ UIManager default defer: [ self queryUser ] ]! !
!CrashDetector methodsFor: 'detection' stamp: 'ThibaultRaffaillac 2/26/2016 
16:46'!
crashed
        "In order to avoid parsing the entire changes file, we go back 200 
characters back in time, and get the last chunk from CodeImporter. We measured 
the current QUIT line to be 84 characters, so we chose 200 to have a safe yet 
fast margin."
        | sample stream string |
        sample := 200.
        stream := SourceFiles changesFileStream readOnlyCopy.
        stream setToEnd.
        
        "This covers the special case where '!!' is escaped with '!!!!' in 
changes file."
        stream upTo: $!!.
        stream peek = $!! ifTrue: [ stream skip: 1 ].
        
        stream skip: sample negated.
        string := stream next: sample.

        ^(((CodeImporter new readStream: string readStream)
                parseChunks;
                codeDeclarations) last contents beginsWith: '----QUIT') not! !
!CrashDetector methodsFor: 'activation' stamp: 'ThibaultRaffaillac 2/26/2016 
13:59'!
queryUser
        (UIManager default confirm: 'It looks like your image crashed, recover 
last changes?')
                        ifTrue: [ ExternalChangesBrowser openOnFileName: 
SourceFiles changesFileStream localName ]! !

"CrashDetector"!

----SNAPSHOT----2016-02-26T17:49:00.769846+01:00 Moose 
Jenkins-moose-6.0-#1307-moose-6.0.zip-temp.image priorSource: 44039052!

StartupPreferencesLoader default executeAtomicItems: {
        StartupAction 
                name: 'Proxy'
                code: [
                        NetworkSystemSettings 
                                useHTTPProxy: true;
                                httpProxyPort: 3128;
                                httpProxyServer: #'proxy'.
                        ]
                runOnce: true.
}.
!

----End fileIn----!

----QUIT----2016-02-26T17:50:36.050131+01:00 Moose 
Jenkins-moose-6.0-#1307-moose-6.0.zip-temp.image priorSource: 44245117!

StartupPreferencesLoader default executeAtomicItems: {
        StartupAction 
                name: 'Proxy'
                code: [
                        NetworkSystemSettings 
                                useHTTPProxy: true;
                                httpProxyPort: 3128;
                                httpProxyServer: #'proxy'.
                        ]
                runOnce: true.
}.
!

----End fileIn----!

StartupPreferencesLoader default executeAtomicItems: {
        StartupAction 
                name: 'Proxy'
                code: [
                        NetworkSystemSettings 
                                useHTTPProxy: true;
                                httpProxyPort: 3128;
                                httpProxyServer: #'proxy'.
                        ]
                runOnce: true.
}.
!

----End fileIn----!

----QUIT/NOSAVE----2016-02-26T17:53:48.468244+01:00 Moose 
Jenkins-moose-6.0-#1307-moose-6.0.zip-temp.image priorSource: 44245508!

StartupPreferencesLoader default executeAtomicItems: {
        StartupAction 
                name: 'Proxy'
                code: [
                        NetworkSystemSettings 
                                useHTTPProxy: true;
                                httpProxyPort: 3128;
                                httpProxyServer: #'proxy'.
                        ]
                runOnce: true.
}.
!

----End fileIn----!

StartupPreferencesLoader default executeAtomicItems: {
        StartupAction 
                name: 'Proxy'
                code: [
                        NetworkSystemSettings 
                                useHTTPProxy: true;
                                httpProxyPort: 3128;
                                httpProxyServer: #'proxy'.
                        ]
                runOnce: true.
}.
!

----End fileIn----!

StartupPreferencesLoader default executeAtomicItems: {
        StartupAction 
                name: 'Proxy'
                code: [
                        NetworkSystemSettings 
                                useHTTPProxy: true;
                                httpProxyPort: 3128;
                                httpProxyServer: #'proxy'.
                        ]
                runOnce: true.
}.
!

----End fileIn----!

----SNAPSHOT----2016-02-29T11:32:25.797216+01:00 Moose 
Jenkins-moose-6.0-#1307-moose-6.0.zip-temp.image priorSource: 44245508!

StartupPreferencesLoader default executeAtomicItems: {
        StartupAction 
                name: 'Proxy'
                code: [
                        NetworkSystemSettings 
                                useHTTPProxy: true;
                                httpProxyPort: 3128;
                                httpProxyServer: #'proxy'.
                        ]
                runOnce: true.
}.
!

----End fileIn----!

Reply via email to