| Anonymous | Login | Signup for a new account | 2013-05-23 15:08 CEST | ![]() |
| All Projects | FPC | Lazarus: Packages, Patches | Lazarus CCR | Mantis | fpGUI | fpcprojects: fpprofiler |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||
| 0006355 | FPC | RTL | public | 2005-10-16 12:00 | 2012-06-06 21:04 | ||||||||
| Reporter | FPC core team | ||||||||||||
| Assigned To | |||||||||||||
| Priority | normal | Severity | crash | Reproducibility | always | ||||||||
| Status | new | Resolution | open | ||||||||||
| Platform | OS | Win32 | OS Version | ||||||||||
| Product Version | Product Build | ||||||||||||
| Target Version | Fixed in Version | ||||||||||||
| Summary | 0006355: Thread create in dll causes delayed access violation. | ||||||||||||
| Description | I use: FPC version 2.0.0 [2005/05/08] and Delphi 6 with RTL Update 3 and General Update 2 When a thread is created in a dll, in suspended mode or otherwise, a delayed access violation occurs that only shows up upon program termination. (Access violation at address 1000AAC0. Read of address 1000AAC0.) The address does of course vary from program to program. This error has one more prerequisite: the calling program (exe) must have a delphi VCL TForm or descendant VISIBLE (note: inivisible forms dont cause the error). And this form must be visible during the FREELIBRARY call, if the form is FREED before the call no errors are caused. Also note: when the same DLL is compiled with Delphi everything works fine. I do not think this is a bug in Delphi as the TForm is too widely used and the bug would be present in almost every Delphi program. This is getting more confusing but, importantly: if FreeLibrary is called AFTER the form has been freed then there is no error, THEREFORE, the bug must be in the DLL's RTL (i think) finalization code. I could just wait until right at the end of my program to call all "FreeLibrary"s but that just wouldnt be cool ;) There are two source files included. | ||||||||||||
| Additional Information | Reporter: Misha Strong EMail: skiy at actionpos dot co dot za | ||||||||||||
| Tags | dynamic library | ||||||||||||
| FPCOldBugId | 4444 | ||||||||||||
| Fixed in Revision | |||||||||||||
| Attached Files | |||||||||||||
Relationships |
|||||||||||
|
|||||||||||
Notes |
|
|
(0024014) Marco van de Voort (manager) 2008-12-28 11:06 |
Problem is still there (D7, 2.3.1), but the problem seems to be Delphi internal. Some observations: - The crash in in the end. IOW in the finalization. Not in the indicated spot. - Pauzing (breakpoint) before the freelibrary doesn't matter. If you break/continue on either the free or freelibrary, the exception doesn't happen -> Seems to be a race condition. - To be exact in a windows message dispatch of the "hide" statement of the form's free method. Further debugging is hard, since breaking influences the program. I suspect it is something relating to Delphi trying to send a message to either a thread or the DLL handle, which is already destroyed, while with delphi-delphi behaviour this is deregistered properly or so. In short: I doubt this is a real FPC bug. It might be simply that there is some additional magic involved that doesn't work right if both sides are not delphi. |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2007-01-05 11:46 | Jonas Maebe | Relationship added | related to 0006401 |
| 2008-12-28 11:06 | Marco van de Voort | Note Added: 0024014 | |
| 2008-12-28 11:06 | Marco van de Voort | Tag Attached: dynamic library | |
| 2012-06-06 21:04 | Jonas Maebe | Relationship added | related to 0022115 |
| Main | My View | View Issues | Change Log | Roadmap |



