View Issue Details

IDProjectCategoryView StatusLast Update
0024897CommunityOCCT:Foundation Classespublic2014-11-11 12:52
ReporterabvAssigned Toapn  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version6.7.1 
Target Version6.8.0Fixed in Version6.8.0 
Summary0024897: Possibility of uncontrolled exit if scanner fails in ExprIntrp
DescriptionAs discovered during analysis of issue reported in oce (https://github.com/tpaviot/oce/issues/490), ExprIntrp parser may call exit() in case of internal error, which will lead to uncontrolled exit of the application that uses this parser.

To avoid this, the lex error handler function should be redefined in ExprIntrp.lex to provide more safe behavior (raising exception, as yacc code does).
Steps To Reproducepload QAcommands
CR23403 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
TagsNo tags attached.
Test case numberbugs fclasses(002) bug24897

Activities

abv

2014-05-06 16:32

manager   ~0029216

I have pushed fixes to CR24897, please review

kgv

2014-05-06 17:04

developer   ~0029217

Please test the patch.

mkv

2014-05-08 17:50

tester   ~0029261

Dear BugMaster,

Branch CR24897 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
SHA-1: 8115e69e12cf8643554bc43e7bb5b56cca9b5820

Number of compiler warnings:

occt component :
Linux: 18 (18 on master)
Windows: 1 (0 on master)

There is new additional compilation warning on Windows platform:
http://jenkins-test-02.nnov.opencascade.com:8080/user/mnt/my-views/view/CR24897/job/mnt-CR24897-master_build_occt_windows/1/warnings30Result/new/file.-794558466/
lex.ExprIntrp.c:2166, MSBuild, Priority: Normal
'function' : different 'const' qualifiers

products component :
Linux: 11 (12 on master)
Windows: 2 (2 on master)

Regressions/Differences:
No regressions/differences

Testing cases:
http://occt-tests/CR24897-master-occt/Windows-32-VC9/bugs/fclasses/bug24897.html
bugs fclasses(002) bug24897: OK

Testing on Windows:
Total MEMORY difference: 379819140 / 380374356
Total CPU difference: 33281.625 / 37765.640625

There are no differences in images found by testdiff.

abv

2014-05-19 14:52

manager   ~0029391

I could not reproduce this warning using WOK 6.7.1, neither on Windows nor taking lex.ExprIntrp.c generated on Linux. Please provide problematic file (lex.ExprIntrp.c) for analysis, and indicate version on flex that generated it.

apn

2014-05-21 13:06

administrator   ~0029434

Extraction was done on virtual station vm-service-01 with flex 2.5.35.

abv

2014-05-21 18:58

manager   ~0029450

Correction pushed to CR24897, please test

apn

2014-05-23 14:24

administrator   ~0029493

CR24897_2 was created (contain fix 24941).

apn

2014-05-26 17:56

administrator   ~0029520

Dear BugMaster,

Branch CR24897_2 (and products from CR24941 master) was compiled on Linux, Windows and MacOS platforms and tested.
SHA-1: e86192978f832b63d22579b65bba7c74cc6db230

Number of compiler warnings:

occt component :
Linux: 17 (17 on master)
Windows: 0 (0 on master)
MacOS: 202 (205 on master)

products component :
Linux: 11 (11 on master)
Windows: 2 (2 on master)

Regressions/Differences:
No regressions

Testing cases:
bugs fclasses bug24897 - OK
http://occt-tests/CR24897-2-CR24941-occt/Windows-32-VC9/bugs/fclasses/bug24897.html

Testing on Linux:
Total MEMORY difference: 359298672 / 359742796
Total CPU difference: 53803.03999999991 / 51526.670000000115

Testing on Windows:
Total MEMORY difference: 381894512 / 382747756
Total CPU difference: 38022.234375 / 39034.203125

There are no differences in images found by testdiff.

Related Changesets

occt: master 2a54ebbf

2014-05-29 11:05:47

abv


Committer: apn Details Diff
0024897: Possibility of uncontrolled exit if scanner fails in ExprIntrp

Macro YY_FATAL_ERROR() is defined in ExprIntrp.lex in order to have exception instead of program exit in case of scanner error. Fixed-length string buffers are replaced by TCollection_AsciiString to avoid buffer overflow.
Some code refactoring: declarations of functions moved to header file, unused global declarations and variables removed, compiler warnings fixed or disabled, obsolete EDL file removed.
Test case for issue CR24897
Correction of MSVC compiler warning when scanner is generated using Flex 2.5.35 on Linux
Affected Issues
0024897
mod - src/ExprIntrp/ExprIntrp.cxx Diff File
mod - src/ExprIntrp/ExprIntrp.lex Diff File
mod - src/ExprIntrp/ExprIntrp.yacc Diff File
rm - src/ExprIntrp/ExprIntrp_CMPLRS.edl Diff File
mod - src/ExprIntrp/ExprIntrp_yaccintrf.cxx Diff File
mod - src/ExprIntrp/ExprIntrp_yaccintrf.hxx Diff File
mod - src/ExprIntrp/ExprIntrp_yacclex.cxx Diff File
mod - src/ExprIntrp/FILES Diff File
mod - src/StepFile/step.lex Diff File
add - tests/bugs/fclasses/bug24897 Diff File

Issue History

Date Modified Username Field Change
2014-05-05 13:08 abv New Issue
2014-05-05 13:08 abv Assigned To => abv
2014-05-06 14:49 abv Steps to Reproduce Updated
2014-05-06 16:32 abv Note Added: 0029216
2014-05-06 16:32 abv Assigned To abv => kgv
2014-05-06 16:32 abv Status new => resolved
2014-05-06 17:04 kgv Note Added: 0029217
2014-05-06 17:04 kgv Assigned To kgv => bugmaster
2014-05-06 17:04 kgv Status resolved => reviewed
2014-05-07 10:48 mkv Assigned To bugmaster => mkv
2014-05-08 17:50 mkv Note Added: 0029261
2014-05-08 17:51 mkv Test case number => bugs fclasses(002) bug24897
2014-05-08 17:51 mkv Assigned To mkv => abv
2014-05-08 17:51 mkv Status reviewed => assigned
2014-05-19 14:52 abv Note Added: 0029391
2014-05-19 14:52 abv Assigned To abv => apn
2014-05-19 14:52 abv Status assigned => feedback
2014-05-21 13:06 apn Note Added: 0029434
2014-05-21 13:06 apn Assigned To apn => abv
2014-05-21 18:58 abv Note Added: 0029450
2014-05-21 18:58 abv Assigned To abv => bugmaster
2014-05-21 18:58 abv Status feedback => reviewed
2014-05-22 10:57 bugmaster Assigned To bugmaster => apn
2014-05-23 14:24 apn Note Added: 0029493
2014-05-26 17:56 apn Note Added: 0029520
2014-05-26 17:57 apn Assigned To apn => bugmaster
2014-05-26 17:57 apn Status reviewed => tested
2014-05-30 12:59 apn Changeset attached => occt master 2a54ebbf
2014-05-30 12:59 apn Assigned To bugmaster => apn
2014-05-30 12:59 apn Status tested => verified
2014-05-30 12:59 apn Resolution open => fixed
2014-11-11 12:46 aiv Fixed in Version => 6.8.0
2014-11-11 12:52 aiv Status verified => closed