[Gambas-devel] someimage.Clear then someimage.Draw raises signal 11

Kevin Fishburne kevinfishburne at ...590...
Sun Jan 9 04:12:55 CET 2011

On 01/08/2011 06:38 AM, Benoît Minisini wrote:
>> The lines:
>>     bwater.Clear
>>     bwater.Draw(dwater, 0, 0, 12288, 12288, 0, 0, 96, 96)
>> nuke the app. This may be related to the repeated sig 11's I've been
>> getting which I was unable to reproduce under valgrind:
>> http://old.nabble.com/signal-11-when-rendering-graphics-using-gb.image-td30
>> 486119.html
>> I'm still getting those, even without the recent someimage.Clear. This
>> time I was able to guess the cause and add a breakpoint to identify the
>> offending line. Seems the image routines are a bit susceptible to
>> crashes, probably trying to write to memory outside the variable
>> declaration. I'm currently using gt.gui (gtk) and gb.image.
>> FYI, the .Clear was an attempt to erase the image, rather than
>> reinitialize it to an undimensioned state. The alpha kept compounding
>> itself and needed to be cleared. Maybe there's a better way, such as
>> DrawRect...
> If you can make a little project that crashes for me. If you need a big image,
> use a blank one, it will be a small file, and it should crash too.
> Clear() makes the image void (0x0 in size). Use the Fill(color) method to
> blank it.
I've attached a small project that generates the crash.

I noticed that someimage.Fill(somecolor) doesn't allow the specification 
of an alpha value. I needed to set everything to fully transparent when 
"erasing" the buffer. No emergency, but an idea for future implementation.

Slightly off topic, but I see you've been killing more bugs lately than 
an exterminator. Good job! gb3 is moving forward at the speed of light 
recently. ;)

Kevin Fishburne
Eight Virtues
www: http://sales.eightvirtues.com
e-mail: sales at ...590...
phone: (770) 853-6271

-------------- next part --------------
A non-text attachment was scrubbed...
Name: gb3_test.tar.bz2
Type: application/x-bzip
Size: 5585 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/devel/attachments/20110108/34c73f79/attachment.bin>

More information about the Devel mailing list