There is another "bug" in the wrapping of wx.FSFile.__init__.
The first parameter (after self) is supposed to be an InputStream.
However I passed in a file like object (cStringIO.StringIO) which
it gladly accepted until several stack frames later when NULL
was dereferenced as an InputStream class and the whole process
coredumped.
Please send a small sample.
Will you accept gdb output? To provoke this you have to have a
FileSystemHandler that returns an image which is quite a bit
of code to hack out of my project. I was getting crashed
interpretters on Windows but couldn't figure out what was
going on since the debugger with mingw displays a work of
fiction as the stack trace.
I installed the source rpm of the current wxPython (NOT the
Gtk2 version) and editted the spec file to add --enable-debug
to configure and a line to prevent the stripping of symbols.
This is the session (with some noise lines omitted) (there
were 97 stack frames for example):
Segmentation fault (core dumped)
rb.com rogerb /space/bitpim > gdb /usr/bin/python core.31971
GNU gdb Red Hat Linux (5.2.1-4)
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux"...(no debugging symbols found)...
Core was generated by `python bp.py'.
Program terminated with signal 11, Segmentation fault.
#0 0x406421bb in wxImageHandler::CallDoCanRead(wxInputStream&) (this=0x8236d98, stream=@0x8bed100)
at /space/rpm/BUILD/wxPythonSrc-2.4.2.4/src/common/image.cpp:1432
1432 off_t posOld = stream.TellI();
(gdb) bt
#0 0x406421bb in wxImageHandler::CallDoCanRead(wxInputStream&) (this=0x8236d98, stream=@0x8bed100)
at /space/rpm/BUILD/wxPythonSrc-2.4.2.4/src/common/image.cpp:1432
#1 0x4064417f in wxImageHandler::CanRead(wxInputStream&) (this=0x8236d98, stream=@0x8bed100)
at /space/rpm/BUILD/wxPythonSrc-2.4.2.4/include/wx/image.h:56
#2 0x4064169e in wxImage::LoadFile(wxInputStream&, long, int) (this=0xbfffb780, stream=@0x8bed100, type=50, index=-1)
at /space/rpm/BUILD/wxPythonSrc-2.4.2.4/src/common/image.cpp:1193
#3 0x4063d487 in wxImage (this=0xbfffb780, stream=@0x8bed100, type=50, index=-1)
at /space/rpm/BUILD/wxPythonSrc-2.4.2.4/src/common/image.cpp:124
#4 0x407151e9 in wxHtmlImageCell (this=0x8bd6e78, window=0x8b25390, input=0x8bd70a8, w=-1, h=-1, scale=1, align=8,
mapname=@0xbfffb9f0) at /space/rpm/BUILD/wxPythonSrc-2.4.2.4/src/html/m_image.cpp:431
#5 0x40716cfc in HTML_Handler_IMG::HandleTag(wxHtmlTag const&) (this=0x8b16148, tag=@0x8bc54e0)
at /space/rpm/BUILD/wxPythonSrc-2.4.2.4/src/html/m_image.cpp:652
#6 0x4070142c in wxHtmlParser::AddTag(wxHtmlTag const&) (this=0x8b25580, tag=@0x8bc54e0)
at /space/rpm/BUILD/wxPythonSrc-2.4.2.4/src/html/htmlpars.cpp:321
#7 0x40701376 in wxHtmlParser::DoParsing(int, int) (this=0x8b25580, begin_pos=370, end_pos=450)
at /space/rpm/BUILD/wxPythonSrc-2.4.2.4/src/html/htmlpars.cpp:305
#8 0x4070147e in wxHtmlParser::AddTag(wxHtmlTag const&) (this=0x8b25580, tag=@0x8c7b418)
at /space/rpm/BUILD/wxPythonSrc-2.4.2.4/src/html/htmlpars.cpp:328
#9 0x40701376 in wxHtmlParser::DoParsing(int, int) (this=0x8b25580, begin_pos=455, end_pos=681)
at /space/rpm/BUILD/wxPythonSrc-2.4.2.4/src/html/htmlpars.cpp:305
#10 0x4070147e in wxHtmlParser::AddTag(wxHtmlTag const&) (this=0x8b25580, tag=@0x8bcb6d8)
at /space/rpm/BUILD/wxPythonSrc-2.4.2.4/src/html/htmlpars.cpp:328
#11 0x40701376 in wxHtmlParser::DoParsing(int, int) (this=0x8b25580, begin_pos=686, end_pos=687)
at /space/rpm/BUILD/wxPythonSrc-2.4.2.4/src/html/htmlpars.cpp:305
#12 0x40702da3 in wxHtmlTagHandler::ParseInner(wxHtmlTag const&) (this=0x8b278a8, tag=@0x8ba85e8)
at /space/rpm/BUILD/wxPythonSrc-2.4.2.4/include/wx/html/htmlpars.h:228
#13 0x4071fb5b in HTML_Handler_TABLE::HandleTag(wxHtmlTag const&) (this=0x8b278a8, tag=@0x8ba85e8)
at /space/rpm/BUILD/wxPythonSrc-2.4.2.4/src/html/m_tables.cpp:564
#14 0x4070142c in wxHtmlParser::AddTag(wxHtmlTag const&) (this=0x8b25580, tag=@0x8ba85e8)
at /space/rpm/BUILD/wxPythonSrc-2.4.2.4/src/html/htmlpars.cpp:321
#15 0x40701376 in wxHtmlParser::DoParsing(int, int) (this=0x8b25580, begin_pos=695, end_pos=1827)
---Type <return> to continue, or q <return> to quit---q
(gdb) l
1427 return FALSE;
1428 }
1429
1430 bool wxImageHandler::CallDoCanRead(wxInputStream& stream)
1431 {
1432 off_t posOld = stream.TellI();
1433 if ( posOld == wxInvalidOffset )
1434 {
1435 // can't test unseekable stream
1436 return FALSE;
Current language: auto; currently c++
(gdb) p stream
$1 = (wxInputStream &) @0x8bed100: {<wxStreamBase> = {_vptr.wxStreamBase = 0x0, m_lastcount = 0,
m_lasterror = wxSTREAM_NO_ERROR}, m_wback = 0x0, m_wbacksize = 0, m_wbackcur = 0}
(gdb) q
Roger