Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

How safe is catch []

 [1/12] from: sqlab:gmx at: 25-Apr-2005 10:36


How safe is catch? I have some rebol applications serving message communication (around 1000 to 2000 messages per day mostly) running for more than half a year on Windows2000 Server without interruption since the last update of the OS for security reasons. Recently I had to add some message splitting: one-message --> [message-part-1 message-part-2 message-part-3] I used a construct similar to this forever [ until [new-messages-available] foreach message new-messages [ catch [ if not important [throw] do-some-heavy-message-processing-and data-completion-using-odbc if some-tests [throw] message-parts: split-messages message until [ catch [ message: first message-parts do-more-conversions if other-tests [throw] deliver message emtpy? message-parts: next message-parts ] ] ] ] ] Now I saw two crashes in one day. I was somehow able to reproduce the crash Invalid data type during recycle by playing again the history of one to two weeks. But the crash happened always processing another message. As I had seen in the past instable behaviour with constructs like this foreach ... [ catch [ .. data: any [ a b throw ] .. .. ] ] I replaced the inner catch with statements like this if not other-tests [ deliver message ] and the crash went away. Now I am curious if someone else encountered the same behaviour too? -- +++ GMX - Die erste Adresse für Mail, Message, More +++ 1 GB Mailbox bereits in GMX FreeMail http://www.gmx.net/de/go/mail

 [2/12] from: lmecir:mbox:vol:cz at: 25-Apr-2005 11:20


Anton Reisacher napsal(a):
>How safe is catch? >I have some rebol applications serving message communication (around 1000 to
<<quoted lines omitted: 48>>
>and the crash went away. >Now I am curious if someone else encountered the same behaviour too?
hi Anton, I needed a slightly different Catch version than the official one. Try this to see if things go better: Rebol [ Title: "Catch" File: %catch.r Date: 4/Mar/2005/17:12 Author: "Ladislav Mecir" Purpose: { Catches local throw' Ignores non-local throws Works with Parse } ] ; Evaluation of the following global functions is an error return': func [[catch]] [throw make error! [throw not-local]] exit': func [[catch]] [throw make error! [throw not-local]] throw': func [[catch]] [throw make error! [throw not-local]] ; Error definition system/error/throw: make system/error/throw [ not-local: "Global return', exit' or throw' evaluated" ] catch': func [ {Catches a throw' from a block and returns the value.} block [block!] "Block to evaluate" /local throw' result1 result2 result1? ] [ ; "localize" 'throw' in the block set [throw' block] use [throw'] reduce [ reduce ['throw' copy/deep block] ] set throw' func [value [any-type!]] [ error? set/any 'result1 get/any 'value result1?: true make error! "" ] either error? set/any 'result2 try block [ either result1? [return get/any 'result1] [result2] ] [return get/any 'result2] ] comment [ ; Usage: catch' [parse "ssss" [(throw' "OK")]] ] -L

 [3/12] from: SQLAB::gmx::net at: 25-Apr-2005 11:56


Hi Ladislav Thanks I will try to set up a test with your version of throw. AR Ladislav Mecir wrote:

 [4/12] from: volker:nitsch:gmai:l at: 25-Apr-2005 12:33


Just curious: can you throw something? not if .. [thow] but if .. [throw 'dummy] maybe there is the bug in 'throw. On 4/25/05, Anton Reisacher <[sqlab--gmx--net]> wrote:
> How safe is catch? > I have some rebol applications serving message communication (around 1000 to
<<quoted lines omitted: 54>>
> To unsubscribe from the list, just send an email to > lists at rebol.com with unsubscribe as the subject.
-- -Volker Any problem in computer science can be solved with another layer of indirection. But that usually will create another problem. David Wheeler

 [5/12] from: SQLAB:gmx at: 25-Apr-2005 13:33


Hi Volker Volker Nitsch wrote:
>Just curious: can you throw something? not > if .. [thow] >
I am not sure, if I understand you. Do you mean "What will happen, if there is no throw, but something else?" ? The second throw in my application was never processed, it is there mostly for debug reasons as in: if all [ debug? if "y" <> ask "really delivering?" ] [throw] So I am pretty sure, it has to do with catch and maybe ODBC. I do not see this error, if my application is not doing some ODBC statements as well. The more ODBC opens and close I am doing, I can reproduce the error in around one week data, with just one open ODBC:// I have to process more than two weeks data. AR

 [6/12] from: lmecir:mbox:vol:cz at: 25-Apr-2005 13:54


Anton Reisacher napsal(a): ....
> emtpy? message-parts: next message-parts >
btw, don't you have a bug in there? -L

 [7/12] from: SQLAB:gmx at: 25-Apr-2005 13:54


You are right, but this was just a typo in my mail.( So please read empty? message-parts: next message-parts AR Ladislav Mecir wrote:

 [8/12] from: lmecir:mbox:vol:cz at: 25-Apr-2005 14:04


SQLAB napsal(a):
>Hi Volker >Volker Nitsch wrote:
<<quoted lines omitted: 6>>
>I am not sure, if I understand you. >Do you mean "What will happen, if there is no throw, but something else?" ?
no, I think, that Volker suggested to test [throw 'something] instead of just [throw] which is throwing a value of unset! datatype -L

 [9/12] from: volker::nitsch::gmail::com at: 25-Apr-2005 14:06


On 4/25/05, SQLAB <[SQLAB--gmx--net]> wrote:
> Hi Volker > > Volker Nitsch wrote: > > >Just curious: can you throw something? not > > if .. [thow]
throw can take an argument. it can also take no arguments (its any-type). but i thought maybe that has an error. if it is 'catch, try 'try instead and throw an error. if error? try[ .. if not important[throw make error! "forget it"] .. ] 'try is more often used, maybe better debugged. thats also the way Ladislavs 'throw' works, as far as i see. Oh, and of course there is forever .. [ .. if not important[break] .. ] if you are not in an inner loop.
> > > >
<<quoted lines omitted: 37>>
> To unsubscribe from the list, just send an email to > lists at rebol.com with unsubscribe as the subject.
-- -Volker Any problem in computer science can be solved with another layer of indirection. But that usually will create another problem. David Wheeler

 [10/12] from: SQLAB:gmx at: 25-Apr-2005 14:20


Hi Volker Try seems to be safe in that case, as I use it in the same application many times. Throw some-data has probably the same effect, as my second example was just a shortening. If I remember right, it was more like throw something to a function call a few levels higher AR Volker Nitsch wrote:
>On 4/25/05, SQLAB <[SQLAB--gmx--net]> wrote: >>
<<quoted lines omitted: 25>>
> ] >if you are not in an inner loop.
I am always in an inner loop and I just want to use throw as Carl recommended instead of the classic C continue.

 [11/12] from: SQLAB:gmx at: 25-Apr-2005 15:47


Hi Ladislav Your version of catch' leads to the same crash Invalid data type during recycle too after processing the messages of less than six days. AR Ladislav Mecir wrote:

 [12/12] from: lmecir::mbox::vol::cz at: 25-Apr-2005 16:44


Hi Anton,
>Your version of catch' leads to the same crash >"Invalid data type during recycle" >too after processing the messages of less than six days. > >AR >
these are *very* valuable findings and I wonder whether the code might be simplified a bit while retaining the above property to be able to hunt the remaining GC bugs. BTW, did you try the latest alpha/beta versions? -L

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted