r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[RAMBO] The REBOL bug and enhancement database

sqlab
25-Apr-2005
[433x2]
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?
Anton
25-Apr-2005
[435x2]
I don't know, but if you have found instability there that would 
be a great bug report !!
By saying "by playing again the history of one to two weeks", do 
you mean that this removes all the network activity ? Is ODBC removed 
too ?
Is the crash always on the same message ?
sqlab
25-Apr-2005
[437]
playing again the history of one to two weeks

 means I process all messages of that period in the same order and 
 send them to a dummy receiver.

Of course, there is some non reproducibility regarding the time axis, 
as this takes around three to four hours compared with two weeks 
in reality and more processes running at the same time on the production 
server.

On the production server the crash happened in reality with less 
messages two times during a period of  around two hours.


The crash happens not always at the same message. This can depend 
of the time behaviour or that the data, that are retrieved from the 
ODBC source is from a live DB, with many inserts, updates and deletes.

Without ODBC the crash did not happen.
Anton
25-Apr-2005
[438x3]
Perhaps you can send the same message 2000 times to see if the content 
of the messages makes any difference.
And just do some minimal ODBC activity to see if that still triggers 
it.
Ok, submitted a ticket for the DLL callback crash "root block overflow", 
I mentioned a few days ago. (Gabriele, sorry, first I submitted an 
empty one).
Gabriele
25-Apr-2005
[441]
Carl will need to delete that.
Anton
28-Apr-2005
[442x2]
I've just noticed a new global word PATH existing since View 1.2.10, 
an undocumented function.
It doesn't seem to do much that is useful..
Gabriele
28-Apr-2005
[444]
i think it's an internal function that is being exposed by error. 
(i think the newer betas lack the code to unset internal words like 
native, path, or even set-browser-path)
Anton
28-Apr-2005
[445]
Is it worth a ticket ?
Gabriele
28-Apr-2005
[446x2]
my guess is that native is used to define the natives coming from 
components, and path is probably used somehow in path evaluation 
(though i have no idea why it should exist as an accessible function, 
maybe it is related to components initialization too)
not sure, a reminder is never bad, though i guess Carl is aware of 
this.
Anton
28-Apr-2005
[448]
Probably it's better to wait for betas closer to a full release.
Izkata
8-May-2005
[449]
I just uncovered this while working on that JumpField over in the 
View group...

>> print compress {A: #"^M"
{    switch A [
{    #"^M" [print {A}]
{    ]
{    }
#{
789C73B4525056E255E22A2ECF2C49CE50705488E602F115A20B8A32F34A14AA
1D6B63B962B900B34009D526000000
}
>> do decompress #{

{    789C73B4525056E255E22A2ECF2C49CE50705488E602F115A20B8A32F34A14AA
{    1D6B63B962B900B34009D526000000
{    }
** Syntax Error: Invalid char -- #"
** Near: (line 1) A: #"
>> print decompress #{

{    789C73B4525056E255E22A2ECF2C49CE50705488E602F115A20B8A32F34A14AA
{    1D6B63B962B900B34009D526000000
{    }
: #
switch A [
 [print {A}]
]

>>
Anton
9-May-2005
[450x5]
The error reduces to:
>> load {#"^M"}
** Syntax Error: Invalid char -- #"
** Near: (line 1) #"

Here's another one:

>> load {#"^J"}
** Syntax Error: Invalid char -- #"
** Near: (line 1) #"
(DO first tries to LOAD the decompressed string.)
The decompressed string was identical to the original string. The 
compression/decompression has nothing to do with it. The problem 
is in loading a string of code copied straight from an editor or 
somewhere. If that code had been MOLDed first it would have been 
OK.
>> mold #"^M"

== {#"^^M"}        ;<--------- note the double escape, this string 
loads properly.
I think rebol doesn't load #"^M" and #"^J" because they are CR (ascii 
13) and LF (ascii 10).  In rebol, these are molded to #"^M" and #"^/".....
.... mmm that may explain LF because it has an alternate representation 
#"^/", which is by default molded by rebol, but that doesn't explain 
#"^M"...  Anyway, it seems to be a bug. I vaguely remember it was 
found before.
BrianH
9-May-2005
[455x2]
^M and ^J are newline characters. The syntax of REBOL doesn't allow 
direct newline characters in strings surrounded by " characters. 
In the example you use, the string is read twice - first in the console, 
and then next in the load. Each time the string is read it is unescaped 
(the effects of the ^ char is applied). Since you are unescaping 
twice, you need two ^ characters, the first to escape the second.
Not an error, sorry.
Gabriele
9-May-2005
[457]
yesp, it's not a bug as Brian says.
Izkata
9-May-2005
[458]
Just an unusual handling because of the way I copy/pasted it..
BrianH
9-May-2005
[459]
If you are using /View, try reading from clipboard:// rather than 
pasting - no escaping will happen then.
Anton
10-May-2005
[460]
^M and ^J (in causing the load error) are exceptional in the alphabet 
of A  - Z.  For example:
	>> load {#"^A"}
	== #"^A"

None of the rest require double-escaping. I am trying to think of 
the reason why rebol treats the newline characters differently.
Gabriele
10-May-2005
[461x8]
anton: that's not a suprise
>> {#"^A"}
== {#"^A"}
>> {#"^/"}
== {#"
}
see the difference?
the closing " is on a different line. that causes an error.
see also:
>> load {#"^""}
** Syntax Error: Invalid string -- "
** Near: (line 1) #"""
anothe way to look at it is to look at the binary representation:
>> as-binary {#"^A"}
== #{23220122}
>> as-binary {#"^/"}
== #{23220A22}
Volker
10-May-2005
[469]
{#"^/"} - then char-molding is buggy?
Gabriele
10-May-2005
[470x7]
is it?
>> mold newline
== {#"^^/"}
i really don't think so :)
Peter: about your ticket -211 about GET... GET has nothing to do 
with that :)
>> print :source
?function?
that's the difference between FORM and MOLD:
>> form :source
== "?function?"
>> mold :source
== {func [
    "Prints the source code for a word."
    'word [word!]
][
    prin join word ": "
    if not value? word [print "u...
Volker
10-May-2005
[477]
oh, misreaded your {#"^/"}. thare are string-parens around.. you 
are right :)
Gabriele
11-May-2005
[478x2]
what do you think about http://www.rebol.net/cgi-bin/rambo.r?id=3363&
a number of bugs have been fixed. please check out the "Waiting for 
testing" tickets to see if you favorite bug has been fixed, so that 
you can test it and we can switch to tested. :)
Volker
11-May-2005
[480x3]
3130 Bug: On Linux, CALL interferes with TCP port wakeup, 3159 Bug: 
Linux: system port interferes with TCP ports

using it for some hours to do remote calls thru tcp, works. did not 
work with older rebol. IMO fixed.
3326 Bug: CALL should accept file! datatype
does it now (linux)
3576 Bug: browse doesnt open web browser (Linux)
and 3455 are the same.