SIGSEGV on inline method from unit of package lazarus / 62-General ---------------------------------------------------------------------- Okoba · 2021-07-26 12:58 I was working on a code and found a sudden crash, in trying to find the problem, I made a project I hope someone can check and help me find the reason. Requirements for the crash: - A project calling an inline method from another unit that is in a package. - The project has a static array and the method too needs assigning an array. I copied the exact code for the unit in the project and everything is working fine. Removing inline works fine, removing one of the arrays works fine. I checked the assembly code and there is only one line difference if I use the unit from the project: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i movq    $1,-40(%rbp)Tested with Trunk FPC and Lazarus on Win X64. ---------------------------------------------------------------------- Okoba · 2021-07-27 06:17 I know a fix for it. I like to know the reason and find out if it is a bug so I can report it. Can you check and see if it happens for you or not? ---------------------------------------------------------------------- Okoba · 2021-07-27 10:48 FPC supports assigning an array, no need for SetLength. And the problem disappear when I use the project unit. Please recheck the first post. ---------------------------------------------------------------------- PascalDragon · 2021-07-27 11:33 Quote from: Okoba on July 26, 2021, 02:58:12 pmI was working on a code and found a sudden crash, in trying to find the problem, I made a project I hope someone can check and help me find the reason. Requirements for the crash: - A project calling an inline method from another unit that is in a package. - The project has a static array and the method too needs assigning an array. I copied the exact code for the unit in the project and everything is working fine. Removing inline works fine, removing one of the arrays works fine. I checked the assembly code and there is only one line difference if I use the unit from the project: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i movq    $1,-40(%rbp)Tested with Trunk FPC and Lazarus on Win X64. Please report a bug (once the Git conversion is done and the repository on GitLab becomes available). Though the important part is not whether the unit is from a package or not, but whether the used unit is compiled during the same compilation. If you'd do a recompile with the UnitFromProject then it would fail as well. ---------------------------------------------------------------------- Okoba · 2021-07-27 11:36 Thanks for the verification. I will. ---------------------------------------------------------------------- PascalDragon · 2021-07-28 07:19 Quote from: jamie on July 27, 2021, 10:39:25 pmQuote from: Okoba on July 27, 2021, 12:48:54 pmFPC supports assigning an array, no need for SetLength. And the problem disappear when I use the project unit. Please recheck the first post. Really? I can see where this is leading. This was added because Delphi supports it as well since XE4. ---------------------------------------------------------------------- Okoba · 2021-07-28 08:11 Quote from: PascalDragon on July 28, 2021, 09:19:28 amThis was added because Delphi supports it as well since XE4. And it is a nice feature.