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

Joe
15-Jan-2007
[2465x2]
resize-image: func [
	dest [file!]
	size [pair!]
	file [file!]
	/local im
][	
	im:		load-image file
	save/png 	dest to-image layout [origin 0x0 image (im) (size)]
	im:		none
]
this leaks on 1.3.2.4.2  Is it a bug ?
Maxim
15-Jan-2007
[2467x2]
the GC does not imediately recycle memory.
does this grow to hundreds of MB of RAM if you do this in a loop?
Ladislav
15-Jan-2007
[2469]
right, Gabriele, the save attribute is mentioned in http://www.rebol.com/docs/library.html#Garbage
, but it doesn't look like related to this situation
Gabriele
15-Jan-2007
[2470]
we may need a new attribute... i wonder what happens if you set the 
pointer manually though. either way you might get bugs. (though, 
your example is more common than setting the pointer manually, so 
i'd prefer to have that fixed.) we can also just state, that this 
is a documentation problem, and that the programmer should take care 
of keeping the string valid (it's for C interfacing after all, although 
we use structs for other things too)
Volker
15-Jan-2007
[2471]
We need an explicit malloc/free IMHO. maybe with copying the string. 
How  about  a little dll for such stuff?
Ladislav
16-Jan-2007
[2472]
(I added the [save] attribute note to RAMBO too)
Joe
16-Jan-2007
[2473]
Maxim, yes !
Maxim
16-Jan-2007
[2474]
does replacing this:

dest to-image layout [origin 0x0 image (im) (size)]

by this:

dest to-image layout [origin 0x0 image im size]

do anything?
Anton
17-Jan-2007
[2475]
Yes, in the first case, the words IM and SIZE are sure to be evaluated 
outside the layout dialect, whereas in the second case, there is 
a fear that they might be interpreted as dialect words. They could 
be interpreted as dialect words if you added an IM style earlier 
and forgot about it, or the layout dialect was extended with an IM 
word and you didn't notice. In your little example, I see no difference, 
except that the first example could survive changes to the layout 
dialect better. I don't think the layout dialect will change much 
(in View 2.x  versions anyway).  I've been tending to write variables 
in parens, so I need to worry less about the possibility of misinterpretation.
Anton
18-Jan-2007
[2476x4]
Hmm. If I do this several times then memory is quickly exhausted:
view layout [area mold system]
I observe this slowing down and GROW-FACETS is slowly molding larger 
and larger.
repeat n 1000 [layout [area (s: mold get in svv 'grow-facets)] print 
[n length? s]]
Ladislav
18-Jan-2007
[2480]
Only now I noticed:
>> -2147483647  + -2147483648
** Math Error: Math or number overflow
** Near: -2147483647 + -2147483648
>> -2147483648  + -2147483648
== 0
Anton
18-Jan-2007
[2481]
I think the second one should also produce an overflow error, since 
a correct result is too large for an integer!
Ladislav
18-Jan-2007
[2482x2]
#3520 seems to work OK now (rebol/version == 1.3.2.3.1), so we should 
mark it as solved, shouldn't we?
aha, the add issue above is already in RAMBO as #3839 (by Jaime)
Volker
18-Jan-2007
[2484]
view layout [area mold system]

the text would include this  area the  next time, then include a 
text  which inlcudes the lastlast text and so on?
Ladislav
18-Jan-2007
[2485x2]
regarding #3520 once again:

to integer! -2147483647.9 ; == -2147483648
to integer! -2147483648 ; == -2147483648
to integer! -2147483648.1
** Math Error: Math or number overflow
** Near: to integer! -2147483648.1
sorry, to integer! -2147483647.9 ; == -2147483647
Gabriele
18-Jan-2007
[2487]
ladislav: yes, please mark it as built. (i think we could mark it 
as tested too, if everyone agrees)
Ladislav
18-Jan-2007
[2488x2]
and, Gabriele, what do you think about the to integer! -2147483648.1 
issue? (it may be related!)
...if I evaluate an expression supposed to yield -2147483648.0 but 
obtain a "slightly different" result, then the conversion may still 
not be possible due to the fact, that the overflow is a bit "premature" 
in this case, because -2147483648.1 actually *can* be converted to 
-2147483648 without any overflow
Maxim
18-Jan-2007
[2490]
but because it cannot stored in a loaded block, should we allow it 
anyways?
Ladislav
18-Jan-2007
[2491x2]
do not understand your question
can you be more verbose?
Maxim
18-Jan-2007
[2493x2]
hum... I didnt' think -2147483648  was a valid int value... sorry.
but it seems to be.
Ladislav
18-Jan-2007
[2495]
aha, now it makes sense to me
Maxim
18-Jan-2007
[2496x2]
>> -2147483648  + -2147483648
== 0

this is a bad bug!
I understand the complement and the reason why this is returned (cause 
I've done C before...) but ask any novice and he'll just say this 
is nonsense!
Ladislav
18-Jan-2007
[2498]
it was marked as "medium" importance, I rised it to "high". It does 
not make sense when all other cases are caught.
Gabriele
18-Jan-2007
[2499]
-2147483648.1: i guess this should be fixed too.
Ladislav
18-Jan-2007
[2500]
I created a new RAMBO ticket
Maxim
18-Jan-2007
[2501x2]
yes the internal type switch really is annoying, especially when 
you are parsing blocks and types are assigned specific values.
or rather specific meanings.
Pekr
23-Jan-2007
[2503]
today I found small bug - well, did not know it is a bug, Cyphre 
just confirmed it - pre 2.7 Rebol versions require callback!, whereas 
2.7 version accepts only callback, but not callback! - the bug was 
probably introduced with string change for 2.7 ....
Cyphre
23-Jan-2007
[2504]
I have already posted it to Rambo.
Ladislav
23-Jan-2007
[2505]
just looking at it - it looks, that you inadvertently used the same 
line twice, should I edit it for you?
Cyphre
23-Jan-2007
[2506]
ah, my fault..please remove the #"!" in the second case, thanks ;)
Ladislav
23-Jan-2007
[2507x2]
done
#4227
Graham
23-Jan-2007
[2509]
Is there a bug in the ftp protocol?  I tried opening a different 
port viz 4559, but it still opens up on port 21.
Bo
23-Jan-2007
[2510]
Well, there is _at least_ one bug in the FTP protocol.  I haven't 
run into the one you are talking about, but I think I did solve the 
one that I was having a problem with (425 response from the server 
causing Rebol to wait infinitely).
Graham
23-Jan-2007
[2511x3]
opening a ftp port using the scheme: 'ftp and port: 4559 still opens 
up port 21 according to trace/net
Going to rambo this ...
Bo, I didn't see a rambo ticket for your bug, or the fix posted.
Bo
23-Jan-2007
[2514]
I'm still testing my fix.