We're having this strange error, it appears when we change the order of imports (it's a python application),
when CEF library is imported before the wxWidgets library the app works fine, no errors. But when the
wxWidgets library is imported before CEF then we get errors like this:
- Code: Select all
./third_party/tcmalloc/chromium/src/tcmalloc.cc:286] Attempt to free invalid pointer 0xf21c698
Segmentation fault
The stack trace in GDB:
- Code: Select all
Program received signal SIGSEGV, Segmentation fault.
0xb347988b in tcmalloc::Abort() () from /usr/lib/python2.7/dist-packages/cefpython1/libcef.so
(gdb) bt
#0 0xb347988b in tcmalloc::Abort() () from /usr/lib/python2.7/dist-packages/cefpython1/libcef.so
#1 0xb3487cf7 in tcmalloc::Log(tcmalloc::LogMode, char const*, int, tcmalloc::LogItem, tcmalloc::LogItem, tcmalloc::LogItem, tcmalloc::LogItem) () from /usr/lib/python2.7/dist-packages/cefpython1/libcef.so
#2 0x0add71a0 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
We have removed any calls to CEF in the application (no CefInitialize, no browser), we're only making a python
import that loads the library using: "ctypes.CDLL(libcef_so, ctypes.RTLD_GLOBAL)" - an equivalent of dlopen()
with the RTLD_GLOBAL mode. There is only one line of CEF C++ code running, a global variable holding a CefRefPtr
to the CefClient instantiated class. The error appears later when there is no CEF code being called, importing CEF
works fine, the error appears X seconds later for no sensible reason.
I have spent some time debugging our problem today with pdb. I have located a section of code dealing
with initialization of component displaying animated gif that was causing the seg fault. Commenting it allowed
the program to run further but it eventually seg faulting on initialization of wx glcanvas (which we use to display
our OpenGL based network view). The last failing statement is this one:
- Code: Select all
> /lib/python2.7/site-packages/wx-2.8-gtk2-unicode/wx/glcanvas.py(136)GLCanvasWithContext()
-> val = _glcanvas.new_GLCanvasWithContext(*args, **kwargs)
--Call--
> /lib/python2.7/encodings/utf_8.py(15)decode()
-> def decode(input, errors='strict'):
> /lib/python2.7/encodings/utf_8.py(16)decode()
-> return codecs.utf_8_decode(input, errors, True)
--Return--
> /lib/python2.7/encodings/utf_8.py(16)decode()->(u'MtnmViewer', 10)
-> return codecs.utf_8_decode(input, errors, True)
./third_party/tcmalloc/chromium/src/tcmalloc.cc:286] Attempt to free invalid pointer 0xf21c698
Segmentation fault
So it is somewhat bizarre. Why the chromium/src/tcmalloc.cc gets involved? Is it possible that somehow rather
than whatever standard tcmalloc is, we have replaced it with chromium's version by virtue of importing it in
the particular order ? Or perhaps there is some memory/stack corruption and this chromium related message is a
total fluke?
Using CEF 1 branch 1453 revision 1268, Chrome 27.0.1453.93 on Ubuntu 12.04 LTS 32-bit.
We will be updating to CEF 3 soon.
Best regards,
Czarek