p-e-w / finalterm

At last – a modern terminal emulator (NO LONGER MAINTAINED)
http://finalterm.org
GNU General Public License v3.0
3.84k stars 179 forks source link

finalterm is stuck with "ps e" #342

Closed lwandrebeck closed 9 years ago

lwandrebeck commented 9 years ago

Runs fine under gdb, but gets this attaching gdb on the fly:

0 0x00000036ec06606c in g_slice_free_chain_with_offset (tmem=, ix=2) at gslice.c:834

1 0x00000036ec06606c in g_slice_free_chain_with_offset (mem_size=40, mem_chain=, next_offset=8) at gslice.c:1169

2 0x00000036eec2b864 in _pango_fribidi_log2vis_get_embedding_levels_new_utf8 (type_rl_list=) at fribidi.c:366

3 0x00000036eec2b864 in _pango_fribidi_log2vis_get_embedding_levels_new_utf8 (pmax_level=, ptype_rl_list=, len=, pbase_dir=0x7fff0ae5cd04, bytelen=, str=0x28a1820 "") at fribidi.c:512

4 0x00000036eec2b864 in _pango_fribidi_log2vis_get_embedding_levels_new_utf8 (str=str@entry=0x28a1400 "+ modified_line=' zboub4007zboub pts/4 Ss 0:00 bash QT_GRAPHICSSYSTEM_CHECKED=1 LANG=fr_FR.UTF-8 DISPLAY=:0 SHLVL=1 LOGNAME=lwandrebeck XDG_VTNR=1 IMSETTINGS_MODULE=none XAUTHORITY=/run/gdm/aut"..., bytelen=, pbase_dir=pbase_dir@entry=0x7fff0ae5cd04) at fribidi.c:928

5 0x00000036eec170c3 in pango_log2vis_get_embedding_levels (text=text@entry=0x28a1400 "+ modified_line=' zboub4007zboub pts/4 Ss 0:00 bash QT_GRAPHICSSYSTEM_CHECKED=1 LANG=fr_FR.UTF-8 DISPLAY=:0 SHLVL=1 LOGNAME=lwandrebeck XDG_VTNR=1 IMSETTINGS_MODULE=none XAUTHORITY=/run/gdm/aut"..., length=, length@entry=1056, pbase_dir=pbase_dir@entry=0x7fff0ae5cd3c) at pango-bidi-type.c:152

6 0x00000036eec17a9e in itemize_state_init (state=state@entry=0x7fff0ae5cdb0, context=, text=, base_dir=base_dir@entry=PANGO_DIRECTION_LTR, start_index=0, length=length@entry=1056, attrs=attrs@entry=0x2403a20, cached_iter=cached_iter@entry=0x23e7a60, desc=desc@entry=0x0) at pango-context.c:911

7 0x00000036eec195af in pango_itemize_with_base_dir (context=, base_dir=base_dir@entry=PANGO_DIRECTION_LTR, text=, start_index=, length=length@entry=1056, attrs=attrs@entry=0x2403a20, cached_iter=cached_iter@entry=0x23e7a60) at pango-context.c:1586

8 0x00000036eec206fa in pango_layout_check_lines (layout=) at pango-layout.c:3998

9 0x00000036eec22f80 in pango_layout_get_iter (layout=layout@entry=0x2aea8c0 [PangoLayout]) at pango-layout.c:5681

10 0x0000003026005259 in cogl_pango_ensure_glyph_cache_for_layout (layout=layout@entry=0x2aea8c0 [PangoLayout]) at cogl-pango-render.c:712

11 0x0000003025cc2044 in clutter_text_create_layout (text=, allocation_width=allocation_width@entry=-1, allocation_height=allocation_height@entry=-1) at ./clutter-text.c:886

12 0x0000003025cc2559 in clutter_text_get_preferred_width (self=, for_height=, min_width_p=0x7fff0ae5d638, natural_width_p=0x7fff0ae5d63c) at ./clutter-text.c:2559

13 0x0000003025c59004 in clutter_actor_get_preferred_width (self=0x2b63b80 [ClutterText], for_height=-1, min_width_p=0x0, natural_width_p=0x7fff0ae5d680) at ./clutter-actor.c:9370

14 0x0000003025c59807 in clutter_actor_get_width (self=self@entry=0x2b63b80 [ClutterText]) at ./clutter-actor.c:10783

15 0x0000003025c599c5 in clutter_actor_get_size (self=0x2b63b80 [ClutterText], width=width@entry=0x7fff0ae5d6c0, height=height@entry=0x7fff0ae5d6c4)

at ./clutter-actor.c:10584

16 0x0000003025cc4372 in clutter_text_get_layout (self=self@entry=0x2b63b80 [ClutterText]) at ./clutter-text.c:5274

17 0x0000003025cc48ec in clutter_text_position_to_coords (self=0x2b63b80 [ClutterText], position=, x=0x7fff0ae5d7a0, y=0x7fff0ae5d79c, line_height=0x0) at ./clutter-text.c:1008

18 0x000000000043a10b in line_view_get_character_coordinates (self=0x2b2b880 [LineView], character_index=1056, x=0x7fff0ae5d82c, y=0x7fff0ae5d828)

at /home/lwandrebeck/projets/finalterm/src/LineView.vala:66

19 0x000000000043582c in terminal_output_view_get_position_coordinates (self=0x2905840 [TerminalOutputView], position=0x7fff0ae5d8c0, x=0x7fff0ae5d8bc, y=0x7fff0ae5d8b8) at /home/lwandrebeck/projets/finalterm/src/TerminalView.vala:457

20 0x0000000000435be1 in terminal_output_view_get_stage_position (self=0x2905840 [TerminalOutputView], position=0x7fff0ae5d9a0, x=0x7fff0ae5d998, y=0x7fff0ae5d990) at /home/lwandrebeck/projets/finalterm/src/TerminalView.vala:473

21 0x0000000000434ed0 in terminal_output_view_position_terminal_cursor (self=0x2905840 [TerminalOutputView], animate=1)

at /home/lwandrebeck/projets/finalterm/src/TerminalView.vala:402

22 0x0000000000434032 in terminal_output_view_render_terminal_cursor (self=0x2905840 [TerminalOutputView])

at /home/lwandrebeck/projets/finalterm/src/TerminalView.vala:345

23 0x0000000000433a42 in terminal_output_view_render_terminal_output (self=0x2905840 [TerminalOutputView])

at /home/lwandrebeck/projets/finalterm/src/TerminalView.vala:330

24 0x0000000000418fb3 in _terminal_output_view_render_terminal_output_utilities_schedule_function (self=0x2905840)

at /home/lwandrebeck/projets/finalterm/src/Terminal.vala:118

25 0x0000000000450065 in _lambda6 (data7=0x23e2b40) at /home/lwandrebeck/projets/finalterm/src/Utilities.vala:213

(here gdb segfaults)

Another run: g_slice_alloc0 (mem_size=mem_size@entry=48) at gslice.c:1032 1032 gpointer mem = g_slice_alloc (mem_size); (gdb) bt

0 0x00000036ec065c09 in g_slice_alloc0 (mem_size=mem_size@entry=48) at gslice.c:1032

1 0x00000036ec831cc7 in g_type_create_instance (type=42971152) at gtype.c:1847

2 0x00000036ec815a8d in g_object_new_internal (class=class@entry=0x2a329b0, params=params@entry=0x0, n_params=n_params@entry=0) at gobject.c:1774

3 0x00000036ec81765d in g_object_newv (object_type=object_type@entry=42971152, n_parameters=n_parameters@entry=0, parameters=parameters@entry=0x0)

at gobject.c:1922

4 0x00000036ec817e24 in g_object_new (object_type=42971152, first_property_name=0x0) at gobject.c:1614

5 0x0000000000428a95 in terminal_output_text_element_construct (object_type=42971152, text=0x2c939e0 "l", attributes=0x28f62e0 [CharacterAttributes]) at /home/lwandrebeck/projets/finalterm/src/TerminalOutput.vala:842

6 0x0000000000428afd in terminal_output_text_element_new (text=0x2c939e0 "l", attributes=0x28f62e0 [CharacterAttributes])

at /home/lwandrebeck/projets/finalterm/src/TerminalOutput.vala:842

7 0x000000000042a21f in terminal_output_text_element_explode (self=0x2b83eb0 [TerminalOutputTextElement])

at /home/lwandrebeck/projets/finalterm/src/TerminalOutput.vala:930

8 0x00000000004272c4 in terminal_output_output_line_explode (self=0x2b8c940 [TerminalOutputOutputLine])

at /home/lwandrebeck/projets/finalterm/src/TerminalOutput.vala:768

9 0x00000000004340f3 in terminal_output_view_render_terminal_cursor (self=0x2905840 [TerminalOutputView])

at /home/lwandrebeck/projets/finalterm/src/TerminalView.vala:349

10 0x0000000000433a42 in terminal_output_view_render_terminal_output (self=0x2905840 [TerminalOutputView])

at /home/lwandrebeck/projets/finalterm/src/TerminalView.vala:330

11 0x0000000000418fb3 in _terminal_output_view_render_terminal_output_utilities_schedule_function (self=0x2905840)

at /home/lwandrebeck/projets/finalterm/src/Terminal.vala:118

12 0x0000000000450065 in _lambda6 (data7=0x2402300) at /home/lwandrebeck/projets/finalterm/src/Utilities.vala:213

(another segfault from gdb)

Had another backtrace on a previous run:

0x00000036ec077c7c in g_utf8strlen ( p=0x2a470d0 "0;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:.tar=01;31:.tgz=01;31:.arc=01;31:.arj=01;31:.taz=01;31:.lha=01;31:.lzh=01;31:.lzma=01;31:.tlz=01;31:.txz=01;31:.tzo=01;31:_.t7z=0", max=-1) at gutf8.c:234 234 p = g_utf8_next_char (p); (gdb) bt

0 0x00000036ec077c7c in g_utf8strlen (p=0x2a470d0 "0;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:.tar=01;31:.tgz=01;31:.arc=01;31:.arj=01;31:.taz=01;31:.lha=01;31:.lzh=01;31:.lzma=01;31:.tlz=01;31:.txz=01;31:.tzo=01;31:_.t7z=0", max=-1) at gutf8.c:234

1 0x000000000042a164 in terminal_output_text_element_explode (self=0x295beb0 [TerminalOutputTextElement])

at /home/lwandrebeck/projets/finalterm/src/TerminalOutput.vala:927

2 0x00000000004272c4 in terminal_output_output_line_explode (self=0x29e71a0 [TerminalOutputOutputLine])

at /home/lwandrebeck/projets/finalterm/src/TerminalOutput.vala:768

3 0x00000000004340f3 in terminal_output_view_render_terminal_cursor (self=0x26f9bc0 [TerminalOutputView])

at /home/lwandrebeck/projets/finalterm/src/TerminalView.vala:349

4 0x0000000000433a42 in terminal_output_view_render_terminal_output (self=0x26f9bc0 [TerminalOutputView])

at /home/lwandrebeck/projets/finalterm/src/TerminalView.vala:330

5 0x0000000000418fb3 in _terminal_output_view_render_terminal_output_utilities_schedule_function (self=0x26f9bc0)

at /home/lwandrebeck/projets/finalterm/src/Terminal.vala:118

6 0x0000000000450065 in _lambda6 (data7=0x21eb2e0) at /home/lwandrebeck/projets/finalterm/src/Utilities.vala:213

It looks like we could have a good suspect in explode (TerminalOutput.vala, line 925), but I have no idea on how to fix it. ps termlet doesn’t look like the culprit here, as a (lightly) modify ps termlet runs fine under gnome-terminal. Hope this helps to track that one.

p-e-w commented 9 years ago

Confirmed.

nashley commented 9 years ago

While I can confirm this problem, it does not occur if it is run via gdb.

p-e-w commented 9 years ago

Fixed in https://github.com/p-e-w/finalterm/commit/a4227a42cb7bdf841b48357376af025b215843ab.

Quite amazingly, this turned out to be not an actual freeze but a performance issue (the output does show up – if you have about 30 minutes patience, that is...). Final Term had huge performance deficits when rendering really long lines such as the ones produced by ps e, which are now gone.