[v8i MDL] Exception while opening DGN file

Hi,

Sometimes we receive exceptions as attached (Open Exception.rar). It is rare but it mostly occurs while opening a new DGN file and displaying view 1 and view 2. Even starting MicroStation & Bentley Architecture for the first time, I may receive exception 0xc0000005. 

I see below lines inside exception.log.

Input queue history:
{ 0} 17:41:012.475 Activate: c:\ak\dgn\010614S01116\010614S01116@001.dgn[Default]
{ 0} 17:41:012.116 view 2 close
{ 0} 17:41:012.116 view 1 close

MDL call stack looks like this but it doesn't give any clue too.

MDL call stack:
<Unavailable source file and line number> : 0. 0x50110876 mdlColorDescr_getRgb+0x16
<Unavailable source file and line number> : 1. 0x5017b612 mdlWindow_rectFillByRGB+0x1b2
<Unavailable source file and line number> : 2. 0x5017c335 mdlWindow_extentSet+0x1e5

How can I find the exact reason of the exception?

Open Exception.rar

Parents
  • Hi,

    We are still having this problem on ABD v8i SS5 too. When you click "Click here to dismiss this dialog without sending the error log" option, ABD directly exists without any warning. It generates the attached exception.log and minidump file (type 7). I analyzed minidump file with Windbg but nothing found other than reported in exception.log file.

    I tried many things. At last tried to use mdlSystem_enterGraphics() or mdlSystem_enterGraphicsExtended() functions but never solved the problem.

    		//mdlSystem_enterGraphics();	
    		mdlSystem_enterGraphicsExtended(1);
    		status = mdlSystem_newDesignFile(dgnFile);
     

    Here is the MDL call stack below. None of these functions are related to my custom application. I also tried to debug the code, but ustation.dll is out of my source code.

    MDL call stack:
     0.  0x50110f16  mdlColorDescr_getRgb+0x16
     1.  0x5017bdc2  mdlWindow_rectFillByRGB+0x1b2
     2.  0x5017caf5  mdlWindow_extentSet+0x1e5
     3.  0x50669977  mdlDialog_listBoxInsertColumn+0x7d77
     4.  0x5066a6ac  mdlDialog_listBoxInsertColumn+0x8aac
     5.  0x5066c927  mdlDialog_listBoxInsertColumn+0xad27
     6.  0x5066d9d0  mdlDialog_listBoxInsertColumn+0xbdd0
     7.  0x5067809f  mdlDialog_listBoxInsertColumn+0x1649f
     8.  0x5067994d  mdlDialog_listBoxInsertColumn+0x17d4d
     9.  0x501c8336  ustnmdl_remove+0x176
    10.  0x501c8731  dlmSystem_callAnyFunction+0x51
    11.  0x506207fd  mdlDialog_itemMessageSend+0xed
    12.  0x5065ffc6  mdlDialog_listBoxNRowsChangedRedraw+0x66
    13.  0x527c3fd9  MdlMain+0x16d7
    14.  0x527c521f  MdlMain+0x291d
    15.  0x501c8336  ustnmdl_remove+0x176
    16.  0x501c8731  dlmSystem_callAnyFunction+0x51
    17.  0x5015b0b6  mdlDialog_hookItemCall+0xf6
    18.  0x50679502  mdlDialog_listBoxInsertColumn+0x17902
    19.  0x501c8336  ustnmdl_remove+0x176
    20.  0x501c8731  dlmSystem_callAnyFunction+0x51
    21.  0x506207fd  mdlDialog_itemMessageSend+0xed
    22.  0x50624223  mdlDialog_rItemSynch+0x63
    23.  0x50622b63  mdlDialog_rItemChildOrderSwap+0x253
    24.  0x50626053  mdlDialog_rItemSynchR+0x23
    25.  0x5061f687  mdlDialog_itemsSynch+0x27
    26.  0x5015b7ef  mdlDialog_synonymsDraw+0x6f
    27.  0x502134ba  mdlDgnFileObj_getMasterFile+0xb0a
    28.  0x50544a21  Bentley::Ustn::ISessionMgr::DropSessionMonitor+0x4d1
    29.  0x50544e2c  Bentley::Ustn::ISessionMgr::MakeActiveModel+0x5c
    30.  0x50545479  Bentley::Ustn::ISessionMgr::MakeRootModel+0xe9
    31.  0x502b5fe1  mdlViewGroup_getActive+0x8a1
    32.  0x502b9d42  mdlViewGroup_deleteCmd+0x1e2
    33.  0x50546e83  Bentley::Ustn::ISessionMgr::SwitchToNewFile+0x573
    34.  0x50231ba9  Bentley::Ustn::ThematicDisplayStyleHandlerKey::Create+0xb09
    35.  0x5023349d  mdlInput_queueButtonAction+0x12bd
    36.  0x50233c9e  mdlInput_queueButtonAction+0x1abe
    37.  0x50234598  mdlInput_queueButtonAction+0x23b8
    38.  0x5023460b  mdlInput_processQueuedInput+0x1b
    39.  0x50182986  mdlInput_standardKeyinActive+0xd6
    40.  0x501d1466  mdlSystem_enterGraphicsExtended+0x15c6
    41.  0x501d171b  mdlSystem_enterGraphicsExtended+0x187b
    42.  0x5020d8e1  win32Intface_winMainStartFromForeignExecutable+0x1a1
    43.  0x5020d95c  win32Intface_winMain+0x1c
    44.  0x00403c66  +0
    45.  0x00403d33  +0
    46.  0x0040143f  +0
    47.  0x7560fa29  BaseThreadInitThunk+0x19
    48.  0x775c75f4  RtlGetAppContainerNamedObjectPath+0xe4
    49.  0x775c75c4  RtlGetAppContainerNamedObjectPath+0xb4

    I will appreciate for any solution suggestion.

    exception.7z

    Kind regards,

    Sedat Alis
    AEC Technology Inc.

  • Hi ,

    Can you zip and post this file to review?

    Wrote a mini-dump type 0x7 to "C:\Users\Dilemma\AppData\Local\Temp\Bentley\AECOsimBuildingDesigner\8.11\fbTdNrfM_E-UCF4EGEaZbQ\MiniDump.dmp".

    Thank you,
    Bob



  • Can you zip and post this file to review?

    You can download minidump file here.

    Thanks.

    Kind regards,

    Sedat Alis
    AEC Technology Inc.

  • Hi ,

    I have reviewed the native call stack and it would appear that a PowerSelector synchronization event on ModelRefActiviated is upating its ModelSelections listbox and crashing on retrieving color descriptor information for synchronization.

    Unfortunately with this information and the fact that MicroStation V8i and vertical SS10 products are not likely to receive any further updates/releases before Desktop Support Policy expires; then we should look to finding work-arounds in the order listed:

    1. Are you evaluating migrating to Bentley CONNECT Edition products currently or in the near future? I ask since a lot of code has been changed and improved especially on the most recent releases and it is highly likely that the problem in V8 does not exist in MicroStation CONNECT Edition based products.  If your company is eligible to download and start testing you can likely validate if a fix is still necessary in MicroStation CONNECT or know that it has been resolved by incremental software updates since V8.
    2. Consider only loading the MDL PowerSelector application when needed and unload when not in need of using.  The stack dump indicates that this is a PowerSelector issue due to data conditions encountered and/or timing of it's reacting to the ModelRefActivated event.  If CONNECT is not an option, this would be your best option to possibly assign function keys to Load/Unload PowerSelector when needed.

    Here is the refined call stack for this issue:

    STACK_TEXT:  
    006dcaf4 50110f16 006dcb5c 00000003 2f18b608 ustation!mdlColorDescr_query+0x102
    006dcb10 5017bdc2 006dcb5c 2f18b608 3774fa78 ustation!mdlColorDescr_getRgb+0x16
    006dcb3c 5017caf5 006dcc8c 006dcc90 006dcc88 ustation!guiWindow_getRgbaFromMonoRasterData+0xd2
    006dcca0 50669977 3774fa78 00000007 006dce34 ustation!guiWindow_iconDraw+0x105
    006dccfc 5066a6ac 006dce34 3774fa78 2fd75428 ustation!listBox_drawPrefixIcon+0x1a7
    006dce58 5066c927 35e8fc28 00000001 00000001 ustation!listBox_drawRow+0xc4c
    006dcef0 5066d9d0 00000001 00000001 00000000 ustation!listBox_drawContents+0x2e7
    006dcfe4 5067809f 00000001 00000000 00000000 ustation!listBox_draw+0x2a0
    006dd0d0 5067994d 006dd5d4 006dd674 00000001 ustation!listBox_handleAuxMessage+0xcf
    006dd214 501c8336 006dd5d4 00000001 006dd5d4 ustation!listBox_handler+0x54d
    006dd558 501c8731 006dd220 0c093c88 50679400 ustation!callNativeFunction+0xd2
    006dd578 506207fd 5077bdc8 0c093c88 50679400 ustation!dlmSystem_callAnyFunction+0x51
    006dd5a0 5065ffc6 006dd5d4 006dd5d4 3774fa78 ustation!mdlDialog_itemMessageSend+0xed
    006dd6a8 527c3fd9 2fd75428 00000001 000008c8 ustation!mdlDialog_listBoxNRowsChangedRedraw+0x66
    006dd6e4 527c521f 00000001 3674eb80 5077bdc8 pselect!updateListModelSelections+0x38
    006dd70c 501c8336 006ddf8c 006ddf8c 00000001 pselect!listBoxHookCommon+0x25f
    006dda50 501c8731 006dd718 3674eb80 527c5243 ustation!callNativeFunction+0xd2
    006dda70 5015b0b6 5077bdc8 3674eb80 527c5243 ustation!dlmSystem_callAnyFunction+0x51
    006dda94 50679502 2fd75428 006ddf8c 00000001 ustation!mdlDialog_hookItemCall+0xf6
    006ddbd8 501c8336 006ddf8c 00000000 006ddf8c ustation!listBox_handler+0x102
    006ddf1c 501c8731 006ddbe4 0c093c88 50679400 ustation!callNativeFunction+0xd2
    006ddf3c 506207fd 5077bdc8 0c093c88 50679400 ustation!dlmSystem_callAnyFunction+0x51
    006ddf64 50624223 006ddf8c 006ddf8c 3774fa78 ustation!mdlDialog_itemMessageSend+0xed
    006de02c 50622b63 2fd75428 00000000 2fd75428 ustation!mdlDialog_rItemSynch+0x63
    006de060 50626053 3774fe48 506241c0 00000000 ustation!mdlDialog_rItemChildProcessR+0xd3
    006de07c 5061f687 3774fe48 3774fa78 006de0c0 ustation!mdlDialog_rItemSynchR+0x23
    006de0e0 5015b7ef 3774fa78 00000000 502133ef ustation!mdlDialog_itemsSynch+0x27
    006de0ec 502133ef 006de50c 502134ba 2f5e0e38 ustation!guiDialog_synchAllDialogs+0x2f
    006de0f4 502134ba 2f5e0e38 50a1b7cc 20c6d030 ustation!MstnSessionMonitor::DoNewFileActivated+0x7f
    006de50c 50544a21 2f5e0e38 00000000 0a915c08 ustation!MstnSessionMonitor::_OnModelRefActivated+0xba
    

    HTH,
    Bob



Reply
  • Hi ,

    I have reviewed the native call stack and it would appear that a PowerSelector synchronization event on ModelRefActiviated is upating its ModelSelections listbox and crashing on retrieving color descriptor information for synchronization.

    Unfortunately with this information and the fact that MicroStation V8i and vertical SS10 products are not likely to receive any further updates/releases before Desktop Support Policy expires; then we should look to finding work-arounds in the order listed:

    1. Are you evaluating migrating to Bentley CONNECT Edition products currently or in the near future? I ask since a lot of code has been changed and improved especially on the most recent releases and it is highly likely that the problem in V8 does not exist in MicroStation CONNECT Edition based products.  If your company is eligible to download and start testing you can likely validate if a fix is still necessary in MicroStation CONNECT or know that it has been resolved by incremental software updates since V8.
    2. Consider only loading the MDL PowerSelector application when needed and unload when not in need of using.  The stack dump indicates that this is a PowerSelector issue due to data conditions encountered and/or timing of it's reacting to the ModelRefActivated event.  If CONNECT is not an option, this would be your best option to possibly assign function keys to Load/Unload PowerSelector when needed.

    Here is the refined call stack for this issue:

    STACK_TEXT:  
    006dcaf4 50110f16 006dcb5c 00000003 2f18b608 ustation!mdlColorDescr_query+0x102
    006dcb10 5017bdc2 006dcb5c 2f18b608 3774fa78 ustation!mdlColorDescr_getRgb+0x16
    006dcb3c 5017caf5 006dcc8c 006dcc90 006dcc88 ustation!guiWindow_getRgbaFromMonoRasterData+0xd2
    006dcca0 50669977 3774fa78 00000007 006dce34 ustation!guiWindow_iconDraw+0x105
    006dccfc 5066a6ac 006dce34 3774fa78 2fd75428 ustation!listBox_drawPrefixIcon+0x1a7
    006dce58 5066c927 35e8fc28 00000001 00000001 ustation!listBox_drawRow+0xc4c
    006dcef0 5066d9d0 00000001 00000001 00000000 ustation!listBox_drawContents+0x2e7
    006dcfe4 5067809f 00000001 00000000 00000000 ustation!listBox_draw+0x2a0
    006dd0d0 5067994d 006dd5d4 006dd674 00000001 ustation!listBox_handleAuxMessage+0xcf
    006dd214 501c8336 006dd5d4 00000001 006dd5d4 ustation!listBox_handler+0x54d
    006dd558 501c8731 006dd220 0c093c88 50679400 ustation!callNativeFunction+0xd2
    006dd578 506207fd 5077bdc8 0c093c88 50679400 ustation!dlmSystem_callAnyFunction+0x51
    006dd5a0 5065ffc6 006dd5d4 006dd5d4 3774fa78 ustation!mdlDialog_itemMessageSend+0xed
    006dd6a8 527c3fd9 2fd75428 00000001 000008c8 ustation!mdlDialog_listBoxNRowsChangedRedraw+0x66
    006dd6e4 527c521f 00000001 3674eb80 5077bdc8 pselect!updateListModelSelections+0x38
    006dd70c 501c8336 006ddf8c 006ddf8c 00000001 pselect!listBoxHookCommon+0x25f
    006dda50 501c8731 006dd718 3674eb80 527c5243 ustation!callNativeFunction+0xd2
    006dda70 5015b0b6 5077bdc8 3674eb80 527c5243 ustation!dlmSystem_callAnyFunction+0x51
    006dda94 50679502 2fd75428 006ddf8c 00000001 ustation!mdlDialog_hookItemCall+0xf6
    006ddbd8 501c8336 006ddf8c 00000000 006ddf8c ustation!listBox_handler+0x102
    006ddf1c 501c8731 006ddbe4 0c093c88 50679400 ustation!callNativeFunction+0xd2
    006ddf3c 506207fd 5077bdc8 0c093c88 50679400 ustation!dlmSystem_callAnyFunction+0x51
    006ddf64 50624223 006ddf8c 006ddf8c 3774fa78 ustation!mdlDialog_itemMessageSend+0xed
    006de02c 50622b63 2fd75428 00000000 2fd75428 ustation!mdlDialog_rItemSynch+0x63
    006de060 50626053 3774fe48 506241c0 00000000 ustation!mdlDialog_rItemChildProcessR+0xd3
    006de07c 5061f687 3774fe48 3774fa78 006de0c0 ustation!mdlDialog_rItemSynchR+0x23
    006de0e0 5015b7ef 3774fa78 00000000 502133ef ustation!mdlDialog_itemsSynch+0x27
    006de0ec 502133ef 006de50c 502134ba 2f5e0e38 ustation!guiDialog_synchAllDialogs+0x2f
    006de0f4 502134ba 2f5e0e38 50a1b7cc 20c6d030 ustation!MstnSessionMonitor::DoNewFileActivated+0x7f
    006de50c 50544a21 2f5e0e38 00000000 0a915c08 ustation!MstnSessionMonitor::_OnModelRefActivated+0xba
    

    HTH,
    Bob



Children
  • Hi Robert,

    Thank you so much for your detailed explanations.

    Are you evaluating migrating to Bentley CONNECT Edition products currently or in the near future? I ask since a lot of code has been changed and improved especially on the most recent releases and it is highly likely that the problem in V8 does not exist in MicroStation CONNECT Edition based products.  If your company is eligible to download and start testing you can likely validate if a fix is still necessary in MicroStation CONNECT or know that it has been resolved by incremental software updates since V8.

    We need a transition period and budget to port our application to OpenBuildings Designer CONNECT Edition.

    Consider only loading the MDL PowerSelector application when needed and unload when not in need of using.  The stack dump indicates that this is a PowerSelector issue due to data conditions encountered and/or timing of it's reacting to the ModelRefActivated event.  If CONNECT is not an option, this would be your best option to possibly assign function keys to Load/Unload PowerSelector when needed.

    I can't find PowerSelector MDL application on the loaded MDL Applications list.

    As far as I know, PowerSelector is the tool palette of Choose Element command.

    If PowerSelector is the cause of the problem, I have to find a way in MDL to disable it before opening DGN file. Choose Element tool is the very basic command of MicroStation. By the way, PowerSelector doesn't make any problem when you open the first file when ABD v8i launches.

    Thanks.

    Kind regards,

    Sedat Alis
    AEC Technology Inc.

  • Hi ,

    Not all loaded MDL applications show up in the MDL Applications dialog box. In MicroStation V8 you can key-in: set rm 0.  This will display a full list of loaded MDL application resources and relative paths loaded from.  When doing so you should see an entry for PowerSelector (pselect.ma) like this:

    00290033 01 PSELECT                    2f0bbfc8   rb   01 00 ...\mdlsys\asneeded\pselect.ma

    Since the MDL app is "asneeded" (not "required") you can unload the MDL app simply by typing:

    mdl unload pselect.ma

    HTH,
    Bob



  • Hi Robert,

    Thank you so much for your help and valuable information. You really helped me to solve the problem even I can't explain the reason. :)

    How did you find that the problem's main reason is PowerSelector?

    "mdl unload pselect.ma" does not close color option or PowerSelector because it is the default tool selected on preferences.

    I tested that if I close extended options of Choose Element command, which closes color option also, it works fine.

    I tried followings and application is working fine now;

    // SetCExpressionValue "savePrefs.defCommand", 0, "USERPREF" // Recorded VBA line
    // Set default command to None (Workspace > Preferences > Look and Feel > Default Tool : None
    userPrefsP->defCommand = 0; // MDL

    Default tool is also set by Workspace > Preferences > Look and Feel > Default Tool : None

    Before opening new DGN file using mdlSystem_newDesignFile(), I used mdlState_startDefaultCommand() which sets Default Tool to None and automatically closing PowerSelector.

    Kind regards,

    Sedat Alis
    AEC Technology Inc.

    Answer Verified By: Sedat Alis 

  • it would appear that a PowerSelector synchronization event on ModelRefActiviated

    Good detective work, !

    Can we avoid that problem by writing a callback (hook) function that waits until the ModelRefActivated event before initialising our data?

    In this case, it looks like Sedat has implemented callback OnNewDesignFile, but it's unclear whether he also has implemented OnModelRefActivated.

     
    Regards, Jon Summers
    LA Solutions

  • Hi ,

    Our event notification system to the best of my knowledge loads and notifies MDL applications based on a sorted application name callback list of apps.  Therefore if your app was called ASpecialApp it would be notified prior to your other applications like: AnotherSpecialApp, or SomeSpecialApp.

    Sedat's custom application did not appear in the call stack (true evidence of "no guilt/fault") so changes to his app would have little impact on the crash itself.  If however you suggest Sedat consider adding to his App (name?) a ModelRefActivated, checking to see if pselect.ma is loaded, then initiate an unload (immediate/head of queue) prior to pselect being able to execute on it's ModelRefActivated (since theoretically unload occurs beforehand), that theoretically could work to prevent crashes and is worth a try. There is also an OnModelRefPreActivate event available that theoretically may occur/fire prior any apps (names) registered for ModelRefActivated.

    Bob



  • Hi Jon,

    Thank you for your help.

    Can we avoid that problem by writing a callback (hook) function that waits until the ModelRefActivated event before initialising our data?

    This bug is related to MicroStation's core (ustation.dll) so only Bentley can fix that. But they don't support ABD v8i SS5 at the moment. I learned to live with this bug. :)

    In this case, it looks like Sedat has implemented callback OnNewDesignFile, but it's unclear whether he also has implemented OnModelRefActivated.

    Actually what I did is closing PowerSelect tool settings before opening the new DGN file. I prevented to face with the bug. It was occuring when PowerSelector tool setting (especially color listbox) is open during opening a DGN file.

    I didn't check OnModelRefActivated event because this bug's source code is out of my control. :)

    Kind regards,

    Sedat Alis
    AEC Technology Inc.

  • Hi Robert,

    You really gave an excellent feedback to find a fix. As Jon said, like a dedective. :) Thank you so much.

    If however you suggest Sedat consider adding to his App (name?) a ModelRefActivated, checking to see if pselect.ma is loaded, then initiate an unload (immediate/head of queue) prior to pselect being able to execute on it's ModelRefActivated (since theoretically unload occurs beforehand), that theoretically could work to prevent crashes and is worth a try.

    I only deactivated PowerSelect tool settings before opening DGN file so it is not getting ModelRefActivated event anymore.

    Kind regards,

    Sedat Alis
    AEC Technology Inc.

  • Hi ,

    Glad to hear you have worked around the issue and that Jon and I were able to help in the process.

    Thank you both!
    Bob