View Issue Details

IDProjectCategoryView StatusLast Update
0028379LazarusLCLpublic2017-04-09 10:03
ReporterC WesternAssigned ToJuha Manninen 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformi386OSMacOSXOS Version
Product Version1.5 (SVN)Product Build 
Target VersionFixed in Version 
Summary0028379: exception raised when handling popup menu not handled properly on MacOSX Carbon
DescriptionIn the attached sample application, pressing the button invokes the default exception handler as expected, and selecting OK allows the program to continue normally. Right clicking on the form and selecting the menu item gives the same dialog (as expected) but the program then crashes. In addition the following is displayed:

2015-07-04 20:33:48.009 project1[32952:95961] *** Exception handlers were not properly removed. Some code has jumped or returned out of an NS_DURING...NS_HANDLER region without using the NS_VOIDRETURN or NS_VALUERETURN macros.
TApplication.HandleException Access violation
  Stack trace:
  $E2000000
  $9B598695
  $9B59765C
  $9B5ABF25
  $9B61DB40
...
TagsNo tags attached.
Fixed in Revisionr54575
LazTarget-
WidgetsetCarbon
Attached Files
  • p.zip (2,016 bytes)
  • menu.diff (868 bytes)
    diff -uwNr --exclude=.svn --exclude=Makefile --exclude=Makefile.fpc --exclude=Makefile.compiled --exclude='*.rsj' --exclude='*.bak' --exclude='*.po' lazarus/lcl/interfaces/carbon/carbonobject.inc lazarus.w/lcl/interfaces/carbon/carbonobject.inc
    --- lazarus/lcl/interfaces/carbon/carbonobject.inc	2014-06-08 22:02:43.000000000 +0100
    +++ lazarus.w/lcl/interfaces/carbon/carbonobject.inc	2015-07-05 12:31:10.000000000 +0100
    @@ -271,7 +271,7 @@
               if CarbonMenu.Parent.Dismissed=kHIMenuDismissedBySelection then begin
                 FillChar(Msg{%H-}, SizeOf(Msg), 0);
                 Msg.msg := LM_ACTIVATE;
    -            CarbonMenu.LCLMenuItem.Dispatch(Msg);
    +            DeliverMessage(CarbonMenu.LCLMenuItem, Msg);
                 if assigned(CarbonMenu.Parent) then  // if parent not closed
                   CarbonMenu.Parent.Dismissed:=0;
                 Result := noErr;
    
    menu.diff (868 bytes)

Activities

C Western

2015-07-04 21:46

reporter  

p.zip (2,016 bytes)

C Western

2015-07-05 13:59

reporter  

menu.diff (868 bytes)
diff -uwNr --exclude=.svn --exclude=Makefile --exclude=Makefile.fpc --exclude=Makefile.compiled --exclude='*.rsj' --exclude='*.bak' --exclude='*.po' lazarus/lcl/interfaces/carbon/carbonobject.inc lazarus.w/lcl/interfaces/carbon/carbonobject.inc
--- lazarus/lcl/interfaces/carbon/carbonobject.inc	2014-06-08 22:02:43.000000000 +0100
+++ lazarus.w/lcl/interfaces/carbon/carbonobject.inc	2015-07-05 12:31:10.000000000 +0100
@@ -271,7 +271,7 @@
           if CarbonMenu.Parent.Dismissed=kHIMenuDismissedBySelection then begin
             FillChar(Msg{%H-}, SizeOf(Msg), 0);
             Msg.msg := LM_ACTIVATE;
-            CarbonMenu.LCLMenuItem.Dispatch(Msg);
+            DeliverMessage(CarbonMenu.LCLMenuItem, Msg);
             if assigned(CarbonMenu.Parent) then  // if parent not closed
               CarbonMenu.Parent.Dismissed:=0;
             Result := noErr;
menu.diff (868 bytes)

C Western

2015-07-05 14:00

reporter   ~0084869

Update: The patch in menu.diff seems to fix the problem for me

Alexey Tor.

2017-04-08 16:03

reporter   ~0099504

Is the diff still OK/ needed?

Juha Manninen

2017-04-08 17:11

developer   ~0099510

Applied, thanks.

Issue History

Date Modified Username Field Change
2015-07-04 21:46 C Western New Issue
2015-07-04 21:46 C Western File Added: p.zip
2015-07-05 13:59 C Western File Added: menu.diff
2015-07-05 14:00 C Western Note Added: 0084869
2015-07-06 14:26 Dmitry Boyarintsev Assigned To => Dmitry Boyarintsev
2015-07-06 14:26 Dmitry Boyarintsev Status new => assigned
2017-04-08 16:03 Alexey Tor. Note Added: 0099504
2017-04-08 17:11 Juha Manninen Assigned To Dmitry Boyarintsev => Juha Manninen
2017-04-08 17:11 Juha Manninen Fixed in Revision => r54575
2017-04-08 17:11 Juha Manninen LazTarget => -
2017-04-08 17:11 Juha Manninen Note Added: 0099510
2017-04-08 17:11 Juha Manninen Status assigned => resolved
2017-04-08 17:11 Juha Manninen Resolution open => fixed