This is my weekend for perplexing 4D issues.
v13.6: crashes and freezes compiled but not a hint of a problem running
interpreted. The exact point of the crash is not even clear.
Here is the snippet of code where the crash is reported:
If (<>vt_CurrProc#ProcType )
<>vt_CurrProc:=ProcType
If (Not(<>bCanAcquireMedia))
DisableMenuAcquire
End if
End if
RW_Lock //semaphore
InitMenus //load menu bar & names
$j:=Size of array(as_localMen)
For ($i;1;$j)
-->
​ ​
If (Length(as_localMen{$i})>1)
...
The error in the 4D error dialog is an array range error of al_localMen.
Suspicious given the two lines above it but that's what it reports.
So enabling the debuglog and running compiled:
0 p=6 puid=25 Log level: 4
0 p=6 puid=25 meth: DO_MENUS
0 p=6 puid=25 (0) cmd: Current process (ProcType). < ms
1 p=6 puid=25 meth: DO_MENUS
1 p=6 puid=25 (0) cmd: Current process (ProcType). < ms
1 p=6 puid=25 meth: DO_MENUS
1 p=6 puid=25 (0) cmd: Semaphore("$ReadWriteLock") (RW_Lock). < ms
1 p=6 puid=25 meth: DO_MENUS
1 p=6 puid=25 (0) cmd: SET MENU BAR(1) (InitMenus). 4 ms
4D err dial
​og start...
​
62 p=6 puid=25 form: s_mess; event: OnLoad
63 p=6 puid=25 meth: S_MESS (coreDialog)
63 p=6 puid=25 (0) cmd: Form event (error_HANDLER (coreDialog)). < ms
We get into the InitMenus method, set a menu bar and then there's a pause
of about 60ms before the 4D error dialog begins to initialize itself. That
dialog goes on to report the error as the array range check in the parent
method.
The InitMenu code is:
If (Not(<>InCataloguerMode))
SET MENU BAR(1)
Else
SET MENU BAR(3)
End if
//custom menu names
For ($menuNum;1;Size of array(<>aiFullMenu))
For ($menuItem;1;<>aiFullMenu{$menuNum})
$menuCode:=String($menuNum)+String($menuItem;"00")
$index:=Find in array(<>as_MItemIDs;$menuCode)
If ($index>0)
SET MENU ITEM($menuNum;$menuItem;<>at_MItemNam{$index})
End if
End for
End for
So I'm really stumped by this one.
1) why does 4D freeze completely? I've never seen this before. The error
dialog is shown but 4D is completely unresponsive.
2) what is the the actual error? An issue with the Menu bar (because that's
where the debuglog recording stops) or with the array (because that's what
's reported as the error)?
I have run both the structure and the data through MSC a couple of times.
The only issues with the structure are warnings about missing style sheets
in various forms, none of which are even draw at this point and are petty
common in an old v13 structure anyway.
I'm looking for ideas here.
--
Kirk Brooks
San Francisco, CA
=======================
*The only thing necessary for the triumph of evil is for good men to do
nothing.*
*- Edmund Burke*
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:[email protected]
**********************************************************************