! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Pango warning when removing directories
Status:
CLOSED: FIXED

Comments

Description Enrico Tröger editbugs 2006-08-08 20:02:23 CEST
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; de; rv:1.8.1b1) Gecko/20060710 Firefox/2.0b1
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.8.1b1) Gecko/20060710 Firefox/2.0b1

When removing directories from a composition, the size column of the parent directory in the file treeview of the composition notebook contains some weird characters which cause the following Pango warning on stderr: "Invalid UTF-8 string passed to pango_layout_set_text()".

Reproducible: Always

Steps to Reproduce:
1. Click on new composition
2. Click on the toolbar button "Create directory"
3. Enter a name for the directory and select it
4. Add a directory from the filebrowser
5. Select the just added directory and click on Remove to delete from the composition

Actual Results:  
The size column in the composition notebook contains invalid characters and produces many Pango warnings on stderr.


This happens on Debian Sarge with GTK 2.6.4, GLib 2.6.4 and Pango 1.8.1.
Comment 1 Jean-François Wauthy editbugs 2006-08-08 20:12:59 CEST
I haven't such problem here. Can you post a screenshot to see what kind of things can appear in the size column ?
Comment 2 Enrico Tröger editbugs 2006-08-09 13:47:38 CEST
Created attachment 720 
Demonstrating the bug

As you can see there is nothing after the value "16" in the size column but there should be a site like KB. Before removing the added file or directory the value is  "16 KB". I guess this is an printf issue, where something is shown which not exists(e.g. invalid pointer to a character array).
Comment 3 Jean-François Wauthy editbugs 2006-08-09 14:27:04 CEST
Created attachment 721 
force crash with g_warning
Comment 4 Jean-François Wauthy editbugs 2006-08-09 14:28:03 CEST
please apply the patch i just attached, recompile, run xfburn in gdb and paste the backtrace here please
Comment 5 Enrico Tröger editbugs 2006-08-09 15:20:15 CEST
The backtrace, but it is not very useful:
(gdb) bt
#0  0xb78ce83b in raise () from /lib/tls/libc.so.6
#1  0xb78cffa2 in abort () from /lib/tls/libc.so.6
#2  0xb7a16efd in IA__g_logv (log_domain=0xb7acc15c "Pango", log_level=-1214415040, format=0xb7ad0400 "Invalid UTF-8 string passed to pango_layout_set_text()",
    args1=0xbfa954ac "AÔ«·\200V \b") at gmessages.c:492
#3  0xb7a16f26 in IA__g_log (log_domain=0x0, log_level=0, format=0x0) at gmessages.c:512
#4  0xb7abe2dd in pango_layout_set_text () from /usr/lib/libpango-1.0.so.0
#5  0xb7dea40e in IA__gtk_widget_create_pango_layout (widget=0x8209a60, text=0x8219ec0 "16,00 šC©¿Æç\005\b\\éÿÿÿÿÿÿ\003") at gtkwidget.c:5116
#6  0xb7c40ead in get_layout (celltext=0x81edfc0, widget=0x0, will_render=0, flags=0) at gtkcellrenderertext.c:1281
#7  0xb7c41335 in get_size (cell=0x81edfc0, widget=0x81ed550, cell_area=0x0, layout=0x0, x_offset=0x0, y_offset=0x0, width=0xbfa9562c, height=0xbfa95630)
    at gtkcellrenderertext.c:1422
#8  0xb7c414c1 in gtk_cell_renderer_text_get_size (cell=0x0, widget=0x0, cell_area=0x0, x_offset=0x0, y_offset=0x0, width=0x0, height=0x0) at gtkcellrenderertext.c:1484
#9  0xb7c3bc63 in IA__gtk_cell_renderer_get_size (cell=0x81edfc0, widget=0x0, cell_area=0x0, x_offset=0x0, y_offset=0x0, width=0xbfa95630, height=0xbfa95630)
    at gtkcellrenderer.c:544
#10 0xb7dd6a24 in IA__gtk_tree_view_column_cell_get_size (tree_column=0x81ee088, cell_area=0x0, x_offset=0x0, y_offset=0x0, width=0xbfa9567c, height=0xbfa95680)
    at gtktreeviewcolumn.c:2609
#11 0xb7dc3ef5 in validate_row (tree_view=0x81ed550, tree=0x81dadb0, node=0x82083d0, iter=0xbfa95740, path=0x0) at gtktreeview.c:4572
#12 0xb7dc47c4 in validate_visible_area (tree_view=0x81ed550) at gtktreeview.c:4763
#13 0xb7dc525c in do_presize_handler (tree_view=0x81ed550) at gtktreeview.c:5183
#14 0xb7dc52ab in presize_handler_callback (data=0x0) at gtktreeview.c:5194
#15 0xb7a11583 in g_idle_dispatch (source=0x81f71a8, callback=0x6, user_data=0x0) at gmain.c:3812
#16 0xb7a0e582 in g_main_dispatch (context=0x809ddf0) at gmain.c:1933
#17 0xb7a0f5f8 in IA__g_main_context_dispatch (context=0x809ddf0) at gmain.c:2483
#18 0xb7a0f930 in g_main_context_iterate (context=0x809ddf0, block=1, dispatch=1, self=0x809eed8) at gmain.c:2564
#19 0xb7a0fed3 in IA__g_main_loop_run (loop=0x81da7d8) at gmain.c:2768
#20 0xb7cf5bb3 in IA__gtk_main () at gtkmain.c:963
#21 0x0805aa3c in main (argc=1, argv=0xbfa959a4) at xfburn-main.c:85

After reading a bit the code, I think the error is in xfburn_humanreadable_filesize(). The passed size value is 1139802111 and after converting it into a gdouble it is -3, and so the index for the unit_list array in line 392 is 6 which is out of border of the array. This explains the Pango warning because some random content of the memory is passed.
Comment 6 Enrico Tröger editbugs 2006-08-09 15:30:00 CEST
No, the error isn't in xfburn_humanreadable_filesize(), there it is only a consequence of the wrong computation of size in action_remove_selection() in xfburn-data-composition.c. Anyway, xfburn_humanreadable_filesize() should handle invalid size values correctly.
Comment 7 Jean-François Wauthy editbugs 2006-08-09 15:50:57 CEST
ok i see where it occurs, i'll fix it ASAP
Comment 8 Jean-François Wauthy editbugs 2006-08-09 19:30:45 CEST
should be fixed with revision 22698, if not reopen the bug
Comment 9 Enrico Tröger editbugs 2006-08-09 19:33:08 CEST
Fixed. Thanks.

Bug #2139

Reported by:
Enrico Tröger
Reported on: 2006-08-08
Last modified on: 2006-08-09

People

Assignee:
Jean-François Wauthy
CC List:
0 users

Version

Version:
unspecified

Attachments

Demonstrating the bug (118.03 KB, image/png)
2006-08-09 13:47 CEST , Enrico Tröger
no flags
force crash with g_warning (377 bytes, patch)
2006-08-09 14:27 CEST , Jean-François Wauthy
no flags

Additional information