Skip to content
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

PangoAttrList crash #1

Open
hugopl opened this issue May 12, 2023 · 0 comments
Open

PangoAttrList crash #1

hugopl opened this issue May 12, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@hugopl
Copy link
Owner

hugopl commented May 12, 2023

Generator generated memory management for PangoAttr doesn't work and crash.

require "./spec_helper"

Spec.after_each do
  GC.collect
end

@[NoInline]
def crate_attrlist
  Pango::AttrList.new
end

describe Pango::AttrList do
  it "works" do
    attr_list = crate_attrlist
    attr = Pango.attr_foreground_new(1, 2, 3)
    attr.start_index = 1
    attr.end_index = 7
    attr_list << attr
  end
end
Invalid memory access (signal 11) at address 0x55ad0a16c
[0x55ad08b41d36] *Exception::CallStack::print_backtrace:Nil +118 in /home/hugo/.cache/crystal/crystal-run-spec.tmp
[0x55ad08b2d9c6] ~procProc(Int32, Pointer(LibC::SiginfoT), Pointer(Void), Nil) +310 in /home/hugo/.cache/crystal/crystal-run-spec.tmp
[0x7f8d1fd93ab0] ?? +140244101446320 in /usr/lib/libc.so.6
[0x7f8d20377c46] ?? +140244107623494 in /usr/lib/libpango-1.0.so.0
[0x7f8d20377cb5] pango_attr_list_unref +69 in /usr/lib/libpango-1.0.so.0
[0x55ad08c59cd0] *Pango::AttrList#finalize:Nil +48 in /home/hugo/.cache/crystal/crystal-run-spec.tmp
[0x55ad08b30516] ~proc7Proc(Pointer(Void), Pointer(Void), Nil) +6 in /home/hugo/.cache/crystal/crystal-run-spec.tmp
[0x7f8d1ffc623f] GC_invoke_finalizers +79 in /usr/lib/libgc.so.1

pango_attr_list_unref is causing the fuzz.

@hugopl hugopl added the bug Something isn't working label May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant