Pango/GLib debugging in VS2015

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Pango/GLib debugging in VS2015

Jeffrey Sheen
Dear list,

I've got an issue with Pango, and have tried asking around in the GTK channel on gnome.org, but no bites.

Memory Access Violations are occurring upon PangoLayout function calls. I'm developing in MS VS2015, with no error text sent to output terminal.


It's a post "pango_layout_set_text" call to "pango_layout_get_pixel_extents" that's bombing out in "gobject-2.0.dll".

Do you have any tips on how to debug GTK in  VS?

_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Pango/GLib debugging in VS2015

Jeffrey Sheen
N.B. I've found pdb files related to the GTK DLLs distributed as part of the hexchat gtk-win32 project (https://github.com/hexchat/gtk-win32).

Executing with these in place, the VS 2015 debugger is showing me that there is an intermittent issue when "pango_layout_clear_lines" is called.

Ultimately a NULL pointer is passed to glib's "magazine_chain_prepare_fields" function.

The issue can be recreated by creating and destroying a UI dialogue a specific number of times. Each text block in the UI dialogue is rendered by creating and destroying PangoLayout and PangoFontDescription objects.

As this is an intermittent issue, and at a glib memory management level, I am not sure how to proceed.

Any advice would be appreciated.

On 5 June 2017 at 20:08, Jeffrey Sheen <[hidden email]> wrote:
Dear list,

I've got an issue with Pango, and have tried asking around in the GTK channel on gnome.org, but no bites.

Memory Access Violations are occurring upon PangoLayout function calls. I'm developing in MS VS2015, with no error text sent to output terminal.


It's a post "pango_layout_set_text" call to "pango_layout_get_pixel_extents" that's bombing out in "gobject-2.0.dll".

Do you have any tips on how to debug GTK in  VS?


_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Pango/GLib debugging in VS2015

Gtk+ - General mailing list

Hi Jeffrey,

The issue seems like that we need to get PangoWin32 (and if you are doing this via Cairo, Cairo) thread-safe on Windows.  You might need to for the time being use a private thread (or so) to do this.

With blessings, and cheers!


Jeffrey Sheen 於 2017/6/6 上午 07:35 寫道:
N.B. I've found pdb files related to the GTK DLLs distributed as part of the hexchat gtk-win32 project (https://github.com/hexchat/gtk-win32).

Executing with these in place, the VS 2015 debugger is showing me that there is an intermittent issue when "pango_layout_clear_lines" is called.

Ultimately a NULL pointer is passed to glib's "magazine_chain_prepare_fields" function.

The issue can be recreated by creating and destroying a UI dialogue a specific number of times. Each text block in the UI dialogue is rendered by creating and destroying PangoLayout and PangoFontDescription objects.

As this is an intermittent issue, and at a glib memory management level, I am not sure how to proceed.

Any advice would be appreciated.

On 5 June 2017 at 20:08, Jeffrey Sheen <[hidden email]> wrote:
Dear list,

I've got an issue with Pango, and have tried asking around in the GTK channel on gnome.org, but no bites.

Memory Access Violations are occurring upon PangoLayout function calls. I'm developing in MS VS2015, with no error text sent to output terminal.


It's a post "pango_layout_set_text" call to "pango_layout_get_pixel_extents" that's bombing out in "gobject-2.0.dll".

Do you have any tips on how to debug GTK in  VS?



_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list


_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Pango/GLib debugging in VS2015

Ignacio Casal Quinteiro
Jeffrey,

I would also like to point you out https://github.com/wingtk/gvsbuild which is a fork of gtk-win32 having the packages more updated.

Cheers.

On Tue, Jun 6, 2017 at 2:45 AM, Chun-wei Fan (范君維) via gtk-list <[hidden email]> wrote:

Hi Jeffrey,

The issue seems like that we need to get PangoWin32 (and if you are doing this via Cairo, Cairo) thread-safe on Windows.  You might need to for the time being use a private thread (or so) to do this.

With blessings, and cheers!


Jeffrey Sheen 於 2017/6/6 上午 07:35 寫道:
N.B. I've found pdb files related to the GTK DLLs distributed as part of the hexchat gtk-win32 project (https://github.com/hexchat/gtk-win32).

Executing with these in place, the VS 2015 debugger is showing me that there is an intermittent issue when "pango_layout_clear_lines" is called.

Ultimately a NULL pointer is passed to glib's "magazine_chain_prepare_fields" function.

The issue can be recreated by creating and destroying a UI dialogue a specific number of times. Each text block in the UI dialogue is rendered by creating and destroying PangoLayout and PangoFontDescription objects.

As this is an intermittent issue, and at a glib memory management level, I am not sure how to proceed.

Any advice would be appreciated.

On 5 June 2017 at 20:08, Jeffrey Sheen <[hidden email]> wrote:
Dear list,

I've got an issue with Pango, and have tried asking around in the GTK channel on gnome.org, but no bites.

Memory Access Violations are occurring upon PangoLayout function calls. I'm developing in MS VS2015, with no error text sent to output terminal.


It's a post "pango_layout_set_text" call to "pango_layout_get_pixel_extents" that's bombing out in "gobject-2.0.dll".

Do you have any tips on how to debug GTK in  VS?



_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list


_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list




--
Ignacio Casal Quinteiro

_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Pango/GLib debugging in VS2015

Rafal Luzynski
In reply to this post by Jeffrey Sheen
6.06.2017 01:35 Jeffrey Sheen <[hidden email]> wrote:
>  [...]
>  The issue can be recreated by creating and destroying a UI dialogue a
> specific number of times. Each text block in the UI dialogue is rendered by
> creating and destroying PangoLayout and PangoFontDescription objects.
>
>  As this is an intermittent issue, and at a glib memory management level, I am
> not sure how to proceed.
>
>  Any advice would be appreciated.

I'm not sure but this sounds to me like an unbalanced g_object_ref().
It does not cause a crash immediately but repeated sufficient number
of times to make ref_count reach zero frees the object which should
still exist. Or if called once or few times does not cause an
immediate crash but causes another correct g_object_ref() to free the
object while it should still exist and eventually crash.

Really difficult to find but if you manage to fix it it will be
greatly appreciated.

Regards,

Rafal
_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Pango/GLib debugging in VS2015

Jeffrey Sheen
In reply to this post by Ignacio Casal Quinteiro
Thank you both for the advice.

I'll start the process of rebuilding GTK myself.

N.B. Win XP will ultimately be a build target (legacy requirement). How can I determine the latest compatible versions of the component libraries?

On 6 Jun 2017 07:43, "Ignacio Casal Quinteiro" <[hidden email]> wrote:
Jeffrey,

I would also like to point you out https://github.com/wingtk/gvsbuild which is a fork of gtk-win32 having the packages more updated.

Cheers.

On Tue, Jun 6, 2017 at 2:45 AM, Chun-wei Fan (范君維) via gtk-list <[hidden email]> wrote:

Hi Jeffrey,

The issue seems like that we need to get PangoWin32 (and if you are doing this via Cairo, Cairo) thread-safe on Windows.  You might need to for the time being use a private thread (or so) to do this.

With blessings, and cheers!


Jeffrey Sheen 於 2017/6/6 上午 07:35 寫道:
N.B. I've found pdb files related to the GTK DLLs distributed as part of the hexchat gtk-win32 project (https://github.com/hexchat/gtk-win32).

Executing with these in place, the VS 2015 debugger is showing me that there is an intermittent issue when "pango_layout_clear_lines" is called.

Ultimately a NULL pointer is passed to glib's "magazine_chain_prepare_fields" function.

The issue can be recreated by creating and destroying a UI dialogue a specific number of times. Each text block in the UI dialogue is rendered by creating and destroying PangoLayout and PangoFontDescription objects.

As this is an intermittent issue, and at a glib memory management level, I am not sure how to proceed.

Any advice would be appreciated.

On 5 June 2017 at 20:08, Jeffrey Sheen <[hidden email]> wrote:
Dear list,

I've got an issue with Pango, and have tried asking around in the GTK channel on gnome.org, but no bites.

Memory Access Violations are occurring upon PangoLayout function calls. I'm developing in MS VS2015, with no error text sent to output terminal.


It's a post "pango_layout_set_text" call to "pango_layout_get_pixel_extents" that's bombing out in "gobject-2.0.dll".

Do you have any tips on how to debug GTK in  VS?



_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list


_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list




--
Ignacio Casal Quinteiro

_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list



_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Pango/GLib debugging in VS2015

Jeffrey Sheen
Dear list,

I have started to build my own GTK Win32 DLLs using the gvsbuild project, as suggested by Nacho.

However, these DLLs exhibit the same behaviour of a `magazine_chain_pop_head' being called on a NULL, after an arbitrary number of `pango_layout_clear_lines' calls being made.

Chun-wei suggested building the GTK libraries to be thread safe. How can I achieve this? Are there preprocessor flags to be set by the compiler?

I would like to have the most conservatively stable, and verbose version of the libraries to test against.

P.S. is anyone out there using these libraries in the wild for Win32, and calling Pango and Cairo functions directly?


On 6 June 2017 at 21:13, Jeffrey Sheen <[hidden email]> wrote:
Thank you both for the advice.

I'll start the process of rebuilding GTK myself.

N.B. Win XP will ultimately be a build target (legacy requirement). How can I determine the latest compatible versions of the component libraries?

On 6 Jun 2017 07:43, "Ignacio Casal Quinteiro" <[hidden email]> wrote:
Jeffrey,

I would also like to point you out https://github.com/wingtk/gvsbuild which is a fork of gtk-win32 having the packages more updated.

Cheers.

On Tue, Jun 6, 2017 at 2:45 AM, Chun-wei Fan (范君維) via gtk-list <[hidden email]> wrote:

Hi Jeffrey,

The issue seems like that we need to get PangoWin32 (and if you are doing this via Cairo, Cairo) thread-safe on Windows.  You might need to for the time being use a private thread (or so) to do this.

With blessings, and cheers!


Jeffrey Sheen 於 2017/6/6 上午 07:35 寫道:
N.B. I've found pdb files related to the GTK DLLs distributed as part of the hexchat gtk-win32 project (https://github.com/hexchat/gtk-win32).

Executing with these in place, the VS 2015 debugger is showing me that there is an intermittent issue when "pango_layout_clear_lines" is called.

Ultimately a NULL pointer is passed to glib's "magazine_chain_prepare_fields" function.

The issue can be recreated by creating and destroying a UI dialogue a specific number of times. Each text block in the UI dialogue is rendered by creating and destroying PangoLayout and PangoFontDescription objects.

As this is an intermittent issue, and at a glib memory management level, I am not sure how to proceed.

Any advice would be appreciated.

On 5 June 2017 at 20:08, Jeffrey Sheen <[hidden email]> wrote:
Dear list,

I've got an issue with Pango, and have tried asking around in the GTK channel on gnome.org, but no bites.

Memory Access Violations are occurring upon PangoLayout function calls. I'm developing in MS VS2015, with no error text sent to output terminal.


It's a post "pango_layout_set_text" call to "pango_layout_get_pixel_extents" that's bombing out in "gobject-2.0.dll".

Do you have any tips on how to debug GTK in  VS?



_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list


_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list




--
Ignacio Casal Quinteiro

_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list




_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Pango/GLib debugging in VS2015

Jeffrey Sheen
I got it.

It was bad reference algebra, due to my inexperience with pango layout lines. I assumed `pango_layout_get_line_read_only' calls were incrementing the line's reference count, and calling `pango_layout_line_unref' in tandem.

Obvious in hindsight.

Rafal was onto it in his original response.

On 7 July 2017 at 17:22, Jeffrey Sheen <[hidden email]> wrote:
Dear list,

I have started to build my own GTK Win32 DLLs using the gvsbuild project, as suggested by Nacho.

However, these DLLs exhibit the same behaviour of a `magazine_chain_pop_head' being called on a NULL, after an arbitrary number of `pango_layout_clear_lines' calls being made.

Chun-wei suggested building the GTK libraries to be thread safe. How can I achieve this? Are there preprocessor flags to be set by the compiler?

I would like to have the most conservatively stable, and verbose version of the libraries to test against.

P.S. is anyone out there using these libraries in the wild for Win32, and calling Pango and Cairo functions directly?


On 6 June 2017 at 21:13, Jeffrey Sheen <[hidden email]> wrote:
Thank you both for the advice.

I'll start the process of rebuilding GTK myself.

N.B. Win XP will ultimately be a build target (legacy requirement). How can I determine the latest compatible versions of the component libraries?

On 6 Jun 2017 07:43, "Ignacio Casal Quinteiro" <[hidden email]> wrote:
Jeffrey,

I would also like to point you out https://github.com/wingtk/gvsbuild which is a fork of gtk-win32 having the packages more updated.

Cheers.

On Tue, Jun 6, 2017 at 2:45 AM, Chun-wei Fan (范君維) via gtk-list <[hidden email]> wrote:

Hi Jeffrey,

The issue seems like that we need to get PangoWin32 (and if you are doing this via Cairo, Cairo) thread-safe on Windows.  You might need to for the time being use a private thread (or so) to do this.

With blessings, and cheers!


Jeffrey Sheen 於 2017/6/6 上午 07:35 寫道:
N.B. I've found pdb files related to the GTK DLLs distributed as part of the hexchat gtk-win32 project (https://github.com/hexchat/gtk-win32).

Executing with these in place, the VS 2015 debugger is showing me that there is an intermittent issue when "pango_layout_clear_lines" is called.

Ultimately a NULL pointer is passed to glib's "magazine_chain_prepare_fields" function.

The issue can be recreated by creating and destroying a UI dialogue a specific number of times. Each text block in the UI dialogue is rendered by creating and destroying PangoLayout and PangoFontDescription objects.

As this is an intermittent issue, and at a glib memory management level, I am not sure how to proceed.

Any advice would be appreciated.

On 5 June 2017 at 20:08, Jeffrey Sheen <[hidden email]> wrote:
Dear list,

I've got an issue with Pango, and have tried asking around in the GTK channel on gnome.org, but no bites.

Memory Access Violations are occurring upon PangoLayout function calls. I'm developing in MS VS2015, with no error text sent to output terminal.


It's a post "pango_layout_set_text" call to "pango_layout_get_pixel_extents" that's bombing out in "gobject-2.0.dll".

Do you have any tips on how to debug GTK in  VS?



_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list


_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list




--
Ignacio Casal Quinteiro

_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list





_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list
Loading...