View Issue Details

IDProjectCategoryView StatusLast Update
0000771OpenMPTGeneralpublic2016-08-07 18:11
Reportermanx Assigned Tomanx  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Target VersionOpenMPT 1.27.01.00 / libopenmpt 0.3.1 (upgrade first)Fixed in VersionOpenMPT 1.27.01.00 / libopenmpt 0.3.1 (upgrade first) 
Summary0000771: Use synchronous exception handling model in OpenMPT
Description

OpenMPT and PluginBridge are currently built with /EHa instead of default /EHsc exception handling model.
This implies that try/catch will handle SEH exceptions (i.e. Access Violations, Division By Zero, and others) in addition to standard C++ exceptions.
Handling both C++ and SEH exception with the same catch(...) block makes code rather confusing to read and non-standard.
Additionally, /EHa makes the code less flexible than /EHsc as there is no way to express a catch that will only catch all C++ exceptions and no SEH exception. catch(...) masks practically all crashes below it.
Converting this to the default exception handling model requires auditing all catch blocks that catch all exceptions (catch(...)) whether SEH catching is also desired and wrapping those in another __try/__except in addition to try/catch, or replacing the block with __try/__except alltogether.

Additional Information

https://stackoverflow.com/questions/4414027/visual-c-unmanaged-code-use-eha-or-ehsc-for-c-exceptions
https://stackoverflow.com/questions/4573536/ehsc-vc-eha-synchronous-vs-asynchronous-exception-handling

TagsNo tags attached.
Has the bug occurred in previous versions?
Tested code revision (in case you know it)

Relationships

related to 0000847 closedmanx MSVC Clang/C2 support for libopenmpt 
child of 0000783 new cross-platform OpenMPT 

Activities

Saga Musix

Saga Musix

2016-04-26 13:58

administrator   ~0002347

SEH exceptions will be required, at the very least, in every call to VST plugins, i.e. setParameter, getParameter, dispatch, process and VSTPluginMain.

manx

manx

2016-04-26 14:03

administrator   ~0002348

SEH exceptions will also be required for all ASIO calls.

manx

manx

2016-05-31 14:19

administrator   ~0002423

ASIO and all of sounddev/ is /EHsc clean since r6445.

Saga Musix

Saga Musix

2016-05-31 20:03

administrator   ~0002433

VST (Native + Bridge) now uses SEH everywhere as well.

manx

manx

2016-07-31 15:21

administrator   ~0002533

There are sill some catch(...) left in
soundlib/plugins/PluginManager.cpp and mptrack/Vstplug.cpp . Are they intentional?

In addition to that, as far as I know, the only case left to tackle is ACM MP3 codec enumeration.

Should this issue be 1.27.01 material?

Saga Musix

Saga Musix

2016-07-31 15:24

administrator   ~0002534

Last edited: 2016-07-31 15:30

The one in Vstplug.cpp is intentional, but could be replaced by catch(CMemoryException &) instead to make it more obvious. I will change this the next time I have to commit something in this file.
The one in PluginManager.cpp is indeed an oversight and still needs to be adjusted. Once that (and ACM) is fixed, I think we are ready to go for 1.27.

manx

manx

2016-07-31 16:11

administrator   ~0002535

ACM MP3 should be fixed in r6718.

manx

manx

2016-08-07 18:11

administrator   ~0002560

Change done as of r6779.

Issue History

Date Modified Username Field Change
2016-04-26 13:49 manx New Issue
2016-04-26 13:58 Saga Musix Note Added: 0002347
2016-04-26 13:58 Saga Musix Summary Use synchronous execptiopn handling model in OpenMPT => Use synchronous execption handling model in OpenMPT
2016-04-26 14:03 manx Note Added: 0002348
2016-05-04 08:08 manx Product Version OpenMPT 1.26.00.* (old testing) =>
2016-05-08 16:46 manx Summary Use synchronous execption handling model in OpenMPT => Use synchronous exception handling model in OpenMPT
2016-05-09 09:32 manx Relationship added child of 0000783
2016-05-31 14:19 manx Note Added: 0002423
2016-05-31 20:03 Saga Musix Note Added: 0002433
2016-06-01 07:34 manx Status new => confirmed
2016-07-31 15:21 manx Note Added: 0002533
2016-07-31 15:24 Saga Musix Note Added: 0002534
2016-07-31 15:30 Saga Musix Note Edited: 0002534
2016-07-31 16:11 manx Note Added: 0002535
2016-07-31 17:19 Saga Musix Assigned To => manx
2016-07-31 17:19 Saga Musix Status confirmed => assigned
2016-07-31 17:19 Saga Musix Target Version OpenMPT 1.?? (long term goals) => OpenMPT 1.27.01.00 / libopenmpt 0.3.1 (upgrade first)
2016-08-05 11:54 manx Relationship added related to 0000847
2016-08-07 18:11 manx Status assigned => resolved
2016-08-07 18:11 manx Resolution open => fixed
2016-08-07 18:11 manx Fixed in Version => OpenMPT 1.27.01.00 / libopenmpt 0.3.1 (upgrade first)
2016-08-07 18:11 manx Note Added: 0002560