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

Henrik
17-May-2007
[2907x2]
the thing is that its db synchronization code (I'll think out loud 
here) and it's used in 5-6 different places. only in one place does 
it crash.
it seems to be accumulative, since it does not happen in exactly 
the same spot every tine and is possibly related to Rugby's do-every 
function, because it seems to happen whenever the do-every is executed.
Sunanda
17-May-2007
[2909]
To tell the truth, I don't know what I did with previous versions 
that actually worked. But doing *something* that affected garbage 
colection seemd to move the bug around. eg
-- global words not local words
-- xx: make block! 1000 not  xx: copy []
Henrik
17-May-2007
[2910x3]
http://rebol.hmkdesign.dk/db-sync.r<-- the db sync code is here.
sunanda, repeated clears of a block perhaps?
I had adopted the techinque of clearing a block before reusage instead 
of using a new make block! [] Maybe that's a bad idea.
Sunanda
17-May-2007
[2913]
Clear -- It's probably a good idea for this reason: the block will 
grow to its maximum size after repeated uses, and so saves time in 
memory allocation / block extension.
May be a bad idea if that max size is causing problems :-)
Henrik
17-May-2007
[2914]
allocated 100000 to the first block in the code and it's still running...
Sunanda
17-May-2007
[2915]
Let's hope that gets you through the demo....Good luck!
Henrik
17-May-2007
[2916x2]
it crashed again :-(
I think I'll panic and allocate 100000 elements to every single block 
in the database
Volker
17-May-2007
[2918]
i had such a problem with massive gui and async. Workarounded the 
following way: recycle is off permanently. there is a thread (do-every 
or such) which checks how much memory was allocated and when it is 
to much it recycled. crashing stopped.
Oldes
17-May-2007
[2919x2]
you may try  recycle/off   and do it yourself
:)
Volker
17-May-2007
[2921]
;like

if 20 * 1000 * 1000 + stats > last-mem [  recycle .  last-mem: stats 
]
;and that every 0.01 second or so.
Oldes
17-May-2007
[2922x2]
anyway.... using   make block! []  is quite useless
allocating 100000 elements for each block will slow down performance 
too much I guess
Volker
17-May-2007
[2924]
Its only for demo, and 3:30 left. better waste memory than a contract..
Henrik
17-May-2007
[2925]
with recycle forced off, it seems to be running OK for now
Oldes
17-May-2007
[2926]
just make sure you recycle sometimes... if it's long running process
Henrik
17-May-2007
[2927x2]
it will not run more than 2-3 hours today :-)
ok, it ran perfectly. the demo was approved and the product goes 
live on Wednesday.
Sunanda
17-May-2007
[2929]
Good news!
So you have a few days to fix the recycle problem for real :-)
Henrik
17-May-2007
[2930x2]
actually I'm going to look at a printerserver, which deadlocks, if 
two people are trying to print too close to eachother.
it's quite simple, I think it was based on some cookbook code. moving 
to ports for that...
Graham
18-May-2007
[2932]
this is an annoyance ... but 'to-local-file drops the trailing slash 
for directories
Henrik
18-May-2007
[2933]
confirmed under OSX
Graham
18-May-2007
[2934]
Rambo it ??
Henrik
18-May-2007
[2935]
yep
Graham
18-May-2007
[2936]
Ok
Henrik
18-May-2007
[2937]
it's not a problem the other way around, so yes, it's inconsistent.
Graham
18-May-2007
[2938]
Done.
Sunanda
19-May-2007
[2939]
Henrik, I see regular "Crash Should not happen" on one of my scripts, 
so you are not alone.
Gabriele
19-May-2007
[2940]
anyone willing to find a way to reproduce it?
Sunanda
19-May-2007
[2941]
I don't have anything trivial that will trigger the bug. It's a big 
application that can run for a while before crashing....And the code 
has been tweaked to minimise the occurrence of the problem.
Gabriele
19-May-2007
[2942x2]
i feel the pain - same problem i had with chord.
but at this point (focused on R3) RT does not have enough resources 
to debug a big app.
Henrik
19-May-2007
[2944]
well, if it's about memory allocation and clean up, would there not 
be a way to torture it? What's the worst possible way to stress the 
garbage collector?
Gabriele
19-May-2007
[2945x2]
recycle/torture
but i guess it won't show in that case...
Henrik
19-May-2007
[2947]
something that randomly creates a large amount of blocks, inserts, 
deletes, manipulates, copies and does various other things.
Oldes
19-May-2007
[2948x5]
just found, that youtube do not respect HTTP1.0 protocol => sends 
HTTP1.1 303 response even if client require HTTP1.0 (which is Rebol 
case). As there is no response specified for 303 in Rebol's http 
handler, it can be fixed using:

use [tmp][

 tmp: select second get in system/schemes/http/handler 'open to-set-word 
 'response-actions
	if none? find tmp 303
	insert tmp reduce [303 select tmp 302]
]
whith the patch above you should be able to do for example:

trace/net on

p: open/direct http://www.youtube.com/get_video?video_id=FVbf9tOGwno&t=OEgsToPDskKR0Ng6kANs3Z4VNG81T2tZ
error? try [close p]
(Reichard: will be fixed the Altme bug which cripples text with long 
links?)
it should be easy imho
there is a silly bug in my patch, it should be:
use [tmp][

 tmp: select second get in system/schemes/http/handler 'open to-set-word 
 'response-actions
	if none? find tmp 303 [ insert tmp reduce [303 select tmp 302] ]
]
Anton
21-May-2007
[2953x3]
Oldes, note that you can do this, which looks clearer to me:

select second get in system/schemes/http/handler 'open [response-actions:]
Oldes, how do you classify this patch ? Is it simply improving Rebol's 
HTTP 1.0 scheme, or is it half-way sliding towards HTTP 1.1 ?
(ie. does the official HTTP 1.0 spec contain a 303 response ?)
(if not, then this should be called a "workaround patch" or "temporary 
migration patch")
Oldes
21-May-2007
[2956]
it's patch for buggy foreign servers... as server should not return 
HTTP1.1 response if client requires HTTP1.0