Bugfix SessionManager>>cmdLineFlags

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

Bugfix SessionManager>>cmdLineFlags

Carsten Haerle
Without this fix, dolphin crashes when an empty string is passed in the
command line.

!SessionManager methodsFor!

cmdLineFlags
 "Private - Answer the Set of flags specified on the command line.
 Currently this is rather simplistic, since it doesn't handle parameters
 with an argument, if the argument is separated from the parameter name
 by whitespace. The VM can't handle these anyway, as it knows nothing about
 the potential parameters, and so treats the first argument which does not
 beging with $/ or $- as the name of the image file. So, currently,
parameters
 with arguments must be specified without any whitespace between the
parameter
 name and the parameter value."
 "CHA FIX: Arguments may be the empty string (just pass two double quotes on
the command line)."

 cmdLineFlags isNil
  ifTrue:
   [cmdLineFlags := Set new.
   self argv
    do: [:a | (a notEmpty and: ['/-' includes: a first]) ifTrue:
[cmdLineFlags add: (a copyFrom: 2)]]].
 ^cmdLineFlags! !
!SessionManager categoriesFor: #cmdLineFlags!accessing!private! !


Reply | Threaded
Open this post in threaded view
|

Re: Bugfix SessionManager>>cmdLineFlags

Blair McGlashan-3
"Carsten Haerle" <[hidden email]> wrote in message
news:4113bc21$0$13023$[hidden email]...
> Without this fix, dolphin crashes when an empty string is passed in the
> command line.

Thanks Carsten.

I assume you mean you get a 'Index 1 is out of bounds' error rather than an
actual crash?

If so then I fixed it the same way you did; the patch will ship in 5.1.5.

Regards

Blair


Reply | Threaded
Open this post in threaded view
|

Re: Bugfix SessionManager>>cmdLineFlags

Chris Uppal-3
Blair,

> > Without this fix, dolphin crashes when an empty string is passed in the
> > command line.
> [...]
> I assume you mean you get a 'Index 1 is out of bounds' error rather than
> an actual crash?

I don't know if this is relevant to Carsen, but it reminds me of a problem I've
seen before that causes actual crashes.

If a deployed .exe tries and fails to create a .ERRORS file then the .exe
itself crashes.  I've seen this before years ago when running a .exe off a
read-only network drive, and have just managed to reproduce it by making the
xxx.ERRORS itself read-only, so the problem seems to be still around.

 From the look of the .dump file, Dolphin is blowing its stack trying to print
errors reporting the failure to print the error, but I could be wrong.

It may be something of an issue for anyone running (say) demo versions of a
deployed .exe off CD, since minor mistakes would get artificially escalated
into crashes (and just when you don't want them, too ;-)

I've been meaning to mention this for yonks, but kept forgetting.  Sorry....

    -- chris


Reply | Threaded
Open this post in threaded view
|

Re: Bugfix SessionManager>>cmdLineFlags

Blair McGlashan-3
"Chris Uppal" <[hidden email]> wrote in message
news:[hidden email]...
> Blair,
>
> > > Without this fix, dolphin crashes when an empty string is passed in
the
> > > command line.
> > [...]
> > I assume you mean you get a 'Index 1 is out of bounds' error rather than
> > an actual crash?
>
> I don't know if this is relevant to Carsen, but it reminds me of a problem
I've
> seen before that causes actual crashes.
>
> If a deployed .exe tries and fails to create a .ERRORS file then the .exe
> itself crashes.  I've seen this before years ago when running a .exe off a
> read-only network drive, and have just managed to reproduce it by making
the
> xxx.ERRORS itself read-only, so the problem seems to be still around.
>
> From the look of the .dump file, Dolphin is blowing its stack trying to
print
> errors reporting the failure to print the error, but I could be wrong.
>
> It may be something of an issue for anyone running (say) demo versions of
a
> deployed .exe off CD, since minor mistakes would get artificially
escalated
> into crashes (and just when you don't want them, too ;-)
>
> I've been meaning to mention this for yonks, but kept forgetting.
Sorry....

Thanks Chris, we'll fix this in 5.1.5 if we can.

Regards

Blair


Reply | Threaded
Open this post in threaded view
|

Re: Bugfix SessionManager>>cmdLineFlags

Carsten Haerle
In reply to this post by Blair McGlashan-3
Yes it is an "index of of bounds". My deployed application "crashes" with
this error.

Carsten

"Blair McGlashan" <[hidden email]> schrieb im Newsbeitrag
news:[hidden email]...
> "Carsten Haerle" <[hidden email]> wrote in message
> news:4113bc21$0$13023$[hidden email]...
> > Without this fix, dolphin crashes when an empty string is passed in the
> > command line.
>
> Thanks Carsten.
>
> I assume you mean you get a 'Index 1 is out of bounds' error rather than
an
> actual crash?
>
> If so then I fixed it the same way you did; the patch will ship in 5.1.5.
>
> Regards
>
> Blair
>
>