View Issue Details

IDProjectCategoryView StatusLast Update
0036360LazarusWidgetsetpublic2019-12-11 14:25
ReporterTKAssigned ToDmitry Boyarintsev 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version2.1 (SVN)Product Build62230M 
Target VersionFixed in Version 
Summary0036360: Cocoa interface added to dylib causes runtime error on app exit
DescriptionWhen Interfaces unit is added to any dylib and Cocoa widgetset is selected (any bitness) the app loads, unloads and uses the dylib correctly.
But then on app exit there is always 216 runtime error.

Steps To ReproduceCompile the attached demo (main app + dylib) and test.
Additional InformationFPC version I use is 3.2.
I have no idea what is the cause.
The error comes after final 'end.' and even after all unit finalizations.
When looking deeper into Assembler window it occurs in fpc_do_exit on this line:
00000001000162F2 e889a90000 callq 0x100020c80 <SYSTEM_$$_SYSTEM_EXIT>

Error output from debugger shell:
objc[8701]: autorelease pool page 0x7fddf4088000 corrupted
  magic 0x00000000 0x30000000 0x00000000 0x30000000
  should be 0xa1a1a1a1 0x4f545541 0x454c4552 0x21455341
  pthread 0x7fff7a2bc000
  should be 0x7fff7a2bc000

An unhandled exception occurred at $00007FFF91C6702F:
EAccessViolation:
  $00007FFF91C6702F
  $00007FFF91C6717F
  $00007FFF91C722D7
  $00007FFF91C5A9A4
  $00007FFF9C289BC2
  $00007FFF8E92A8D5
  $000000010B9F9D2F
  $000000010B9FA474
  $000000010B883E03
  $000000010B896DC9
  $000000010B888183
  $00007FFF61F3018B
  $00007FFF86431463
  $00007FFF86431767
TagsNo tags attached.
Fixed in Revision62352
LazTarget-
WidgetsetCocoa
Attached Files

Activities

TK

2019-11-25 23:06

reporter  

DylibTest.zip (138,255 bytes)

TK

2019-11-28 22:28

reporter   ~0119541

This bug is similar to this issue with Carbon interface:
https://bugs.freepascal.org/view.php?id=30231
But here I could not locate the source of the problem...

The only solution is to remove any LCL dependency from all libraries.
We have configuration dialogs in the libs, the libs are plugins.
And due to this bug they must be configured in the main app, a lot more work, sigh...

Dmitry Boyarintsev

2019-12-08 06:03

developer   ~0119689

please test and close if ok

Issue History

Date Modified Username Field Change
2019-11-25 23:06 TK New Issue
2019-11-25 23:06 TK File Added: DylibTest.zip
2019-11-28 22:28 TK Note Added: 0119541
2019-12-08 06:03 Dmitry Boyarintsev Assigned To => Dmitry Boyarintsev
2019-12-08 06:03 Dmitry Boyarintsev Status new => resolved
2019-12-08 06:03 Dmitry Boyarintsev Resolution open => fixed
2019-12-08 06:03 Dmitry Boyarintsev Fixed in Revision => 62352
2019-12-08 06:03 Dmitry Boyarintsev LazTarget => -
2019-12-08 06:03 Dmitry Boyarintsev Widgetset Cocoa => Cocoa
2019-12-08 06:03 Dmitry Boyarintsev Note Added: 0119689