-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting g_signal_emit_valist: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
when actively use draw_line
#140
Comments
I made a slight variation : require "vips"
a = b = Vips::Image.new_from_file "/home/john/pics/k2.jpg"
a = a.draw_line 0, 0, 1, 0, 2
b = b.draw_line 0, 0, 1, 0, 2
a, b = [a, b].map do |image|
30.times do |i|
puts "iteration #{i} .."
image = image.draw_line 0, 0, 1, 0, 2
end
image
end
puts "writing .."
a.join(b, :horizontal, expand: true).write_to_file "ab.jpg" Make messages fatal with:
And you can see it fails at different points each time, and with slightly different messages, which is interesting. gdb shows that it's perhaps something to do with progress feedback system. |
Commenting out this line: https://github.com/jcupitt/libvips/blob/master/libvips/foreign/foreign.c#L813 Seems to fix it. I'll investigate. Thanks for the report! |
we were leaving a few bits of the original image around after vips_image_copy_memory(), including the progress signal ... if earlier images were freed, perhaps by a GC in a language binding, we could get a dangling pointer thanks Nakilon, see libvips/ruby-vips#140
I've pushed a proper fix to 8.5, it seems to work now. I'll do an 8.5.9 in the next day or so. Thanks again for the report. |
Nice. I use brew to install and update vips on Mac OS -- who updates the formula there? |
I'm the main contact for the formula, but anyone can put in a PR, of course. |
when writing to a non-partial image, vips_image_write() now carefully severs all connections between the two images on completion this fixes a couple of cases where we had bad behaviour: writing to a temp file could leave dangling pointers, see https://github.com/jcupitt/libvips/issues/708 and writing to a memory buffer during copy_memory coud leave dangling pointers too, see: libvips/ruby-vips#140
OK, 8.5.9 is up with this fix. You should just be able to edit your |
Program seems to produce valid images, but there are warnings printed. So I minified my program as much possible to reproduce it:
Mac OS
Warnings will disappear if I decrease the number
45
or if I remove the first.draw_line
call. Also when I useVips::Image.blank 1000, 1000
instead of a real file, and some images cause this issue, some are not. Also they were disappearing even depending on the number of lines in this source file. Or when I usedArray.new(2)
instead ofARGV
passing two arguments, etc.Probably you will need try different images or increase the number of
image = image.draw_line
lines to execute.The text was updated successfully, but these errors were encountered: