Opened 10 years ago

Closed 10 years ago

#886 closed defect (fixed)

Broken exception in Symbian, potentially will cause undefined behavior when receiving bad SIP message

Reported by: bennylp Owned by: bennylp
Priority: critical Milestone: release-1.4
Component: common Version: trunk
Keywords: Cc:
Backport to 1.x milestone: Backported:

Description (last modified by bennylp)

The exception framework for Symbian target relies on sources being compiled as C++, since the exception uses C++ exception. With Carbide, turns out the GCCE option "-x c++" DOES NOT work, and this will break the exception framework.

The exception framework is used heavily by the parser, to report syntax errors. Without this, syntax errors will go undetected, and possibly causes undefined behavior or even crashes.

This bug can be reproduced by running the exception test in pjlib-test.

In the MMP files, the compile as C++ option has been re-added to relevant libraries by ticket #887

Change History (3)

comment:1 Changed 10 years ago by bennylp

  • Description modified (diff)

comment:2 Changed 10 years ago by nanang

In r2873:

  • Added C++ wrapper files for C source files using exception (PJ_TRY & PJ_THROW).
  • Updated Symbian MMPs.

Previously, some experiments have been done in order to force C sources being compiled as C++:

  • as mentioned in ticket description, put OPTION GCC/E -x c++ in MMP files.
  • putting #pragma cplusplus on on top of the source file.
  • forward except.h to except.hpp for Symbian platforms.

None of them work.

An alternative is modifying a build config (part of SDK) Epoc32\tools\compilation_config\gcce.mk, replacing C_LANG_OPTION=-x c with C_LANG_OPTION=-x c++, however touching the SDK is not really considered as good solution.

comment:3 Changed 10 years ago by bennylp

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.