DeltaEscher / editra

Automatically exported from code.google.com/p/editra
Other
0 stars 0 forks source link

Editra core-dumps when displaying characters with unusual encoding #490

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. load a file containing unusual encoding (example attached)
2. Editra prompts you to give the encoding (select cp1251 with the example)
3. Editra crashes immediately

What version of the product are you using? On what operating system?
This is on Editra svn, revision 63654 on linux debian 32 bits, python 2.5.5
with wx 2.8.10.1.

Please provide any additional information below.
This only happens when the characters need to be displayed. If the file is
long and only a few characters are unusually encoded, you need to scroll
down to display the page containing those characters to crash.

(gdb) bt
#0  0xb771fbc1 in ?? () from /lib/i686/cmov/libc.so.6
#1  0xb7721d86 in ?? () from /lib/i686/cmov/libc.so.6
#2  0xb77241ae in malloc () from /lib/i686/cmov/libc.so.6
#3  0xb62d1e0f in g_realloc () from /lib/libglib-2.0.so.0
#4  0xb644dd8f in pango_glyph_string_set_size ()
   from /usr/lib/libpango-1.0.so.0
#5  0xb3dd0e9e in ?? () from /usr/lib/pango/1.6.0/modules/pango-basic-fc.so
#6  0xb6454a1a in ?? () from /usr/lib/libpango-1.0.so.0
#7  0xb646746c in pango_shape () from /usr/lib/libpango-1.0.so.0
#8  0xb6459bbe in ?? () from /usr/lib/libpango-1.0.so.0
#9  0xb645a5e0 in ?? () from /usr/lib/libpango-1.0.so.0
#10 0xb645c286 in ?? () from /usr/lib/libpango-1.0.so.0
#11 0xb645d524 in ?? () from /usr/lib/libpango-1.0.so.0
#12 0xb645f16b in pango_layout_get_pixel_extents ()
   from /usr/lib/libpango-1.0.so.0
#13 0xb645f1ca in pango_layout_get_pixel_size ()
   from /usr/lib/libpango-1.0.so.0
#14 0xb6d970a4 in wxWindowDC::DoDrawText(wxString const&, int, int) ()
   from /usr/lib/libwx_gtk2u_core-2.8.so.0
#15 0xb50e4daf in SurfaceImpl::DrawTextTransparent(PRectangle, Font&, int,
char const*, int, ColourAllocated) () from /usr/lib/libwx_gtk2u_stc-2.8.so.0
#16 0xb510a2a7 in Editor::DrawLine(Surface*, ViewStyle&, int, int, int,
PRectangle, LineLayout*, int) () from /usr/lib/libwx_gtk2u_stc-2.8.so.0
#17 0xb5117dca in Editor::Paint(Surface*, PRectangle) ()
   from /usr/lib/libwx_gtk2u_stc-2.8.so.0
#18 0xb50e7ebe in ScintillaWX::DoPaint(wxDC*, wxRect) ()
   from /usr/lib/libwx_gtk2u_stc-2.8.so.0
#19 0xb50f25c0 in wxStyledTextCtrl::OnPaint(wxPaintEvent&) ()
   from /usr/lib/libwx_gtk2u_stc-2.8.so.0
#20 0xb6b1df2f in wxAppConsole::HandleEvent(wxEvtHandler*, void
(wxEvtHandler::*)(wxEvent&), wxEvent&) const () from
/usr/lib/libwx_baseu-2.8.so.0
#21 0xb6bbc099 in wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase
const&, wxEvtHandler*, wxEvent&) () from /usr/lib/libwx_baseu-2.8.so.0
#22 0xb6bbd164 in wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) ()
   from /usr/lib/libwx_baseu-2.8.so.0
#23 0xb6bbd263 in wxEvtHandler::ProcessEvent(wxEvent&) ()
   from /usr/lib/libwx_baseu-2.8.so.0
#24 0xb6db46f2 in wxWindow::GtkSendPaintEvents() ()
   from /usr/lib/libwx_gtk2u_core-2.8.so.0
#25 0xb6db4cb8 in ?? () from /usr/lib/libwx_gtk2u_core-2.8.so.0
#26 0xb673e1a4 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#27 0xb6362f62 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#28 0xb63773a8 in ?? () from /usr/lib/libgobject-2.0.so.0
#29 0xb63785b8 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#30 0xb6378ba6 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#31 0xb685a47e in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#32 0xb6737ec0 in gtk_main_do_event () from /usr/lib/libgtk-x11-2.0.so.0
#33 0xb65a717f in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#34 0xb65a712e in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#35 0xb65a712e in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#36 0xb65a712e in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#37 0xb65a712e in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#38 0xb65a712e in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#39 0xb65a712e in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#40 0xb65a712e in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#41 0xb65a712e in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#42 0xb65a712e in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#43 0xb65a712e in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#44 0xb65cf824 in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#45 0xb65a3985 in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#46 0xb65a593f in gdk_window_process_all_updates ()
   from /usr/lib/libgdk-x11-2.0.so.0
#47 0xb66aa19f in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#48 0xb6581fb8 in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#49 0xb62c7db1 in ?? () from /lib/libglib-2.0.so.0
#50 0xb62c9b38 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#51 0xb62cd3d0 in ?? () from /lib/libglib-2.0.so.0
#52 0xb62cd83f in g_main_loop_run () from /lib/libglib-2.0.so.0
#53 0xb6738149 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#54 0xb6d9e018 in wxEventLoop::Run() () from /usr/lib/libwx_gtk2u_core-2.8.so.0
#55 0xb6e3058e in wxAppBase::MainLoop() ()
   from /usr/lib/libwx_gtk2u_core-2.8.so.0
#56 0xb7360042 in wxPyApp::MainLoop() ()
   from /usr/lib/python2.5/site-packages/wx-2.8-gtk2-unicode/wx/_core_.so
#57 0xb73bde6a in ?? ()
   from /usr/lib/python2.5/site-packages/wx-2.8-gtk2-unicode/wx/_core_.so
#58 0x0805d017 in PyObject_Call ()
#59 0x080c96c0 in PyEval_EvalFrameEx ()
#60 0x080cbf2c in PyEval_EvalCodeEx ()
#61 0x0810f2fe in ?? ()
#62 0x0805d017 in PyObject_Call ()
#63 0x08063bf1 in ?? ()
#64 0x0805d017 in PyObject_Call ()
#65 0x080ca2eb in PyEval_EvalFrameEx ()
#66 0x080cb735 in PyEval_EvalFrameEx ()
#67 0x080cb735 in PyEval_EvalFrameEx ()
#68 0x080cb735 in PyEval_EvalFrameEx ()
#69 0x080cb735 in PyEval_EvalFrameEx ()
#70 0x080cbf2c in PyEval_EvalCodeEx ()
#71 0x080cc077 in PyEval_EvalCode ()
#72 0x080e8128 in PyRun_FileExFlags ()
#73 0x080e8312 in PyRun_SimpleFileExFlags ()
#74 0x08059415 in Py_Main ()
#75 0x0805878b in main ()

Original issue reported on code.google.com by gaudet.e...@gmail.com on 8 Mar 2010 at 9:58

Attachments:

GoogleCodeExporter commented 8 years ago
Hi,

cp1251 is far from an unusual encoding.

I can't reproduce this on Windows, but from your stack trace it is definitely
crashing when it is trying to draw the screen.

What font are you using and do you know what the default system encoding is on 
your
system (guessing utf-8)?

Thanks,

Cody

Original comment by CodyPrec...@gmail.com on 11 Mar 2010 at 3:34

GoogleCodeExporter commented 8 years ago
I said unusual because I'm not sure whether the characters in the file I 
attached are
actually cp1251: I could not identify the encoding. I picked cp1251 because 
it's a
file comming from Windows and it triggers the crash every time. If I pick utf_8,
editra prompts again. 

Editra uses utf-8 as a default encoding for all my files.

Original comment by gaudet.e...@gmail.com on 11 Mar 2010 at 7:13

GoogleCodeExporter commented 8 years ago
This should hopefully be fixed in the current svn head. I made a number of 
fixes to the encoding detection heuristic and error handling recently.

Feel free to reopen if the issue persists

Original comment by CodyPrec...@gmail.com on 17 Aug 2010 at 3:41