Forum > TAChart
Chart left axis labelled differently with latest trunk
Wilko500:
Thank you for your suggestion. I’ll try that tonight. That was going to be my next question. Presumably I can add that line in my pre-leak ide to fix leaks.
Feedback tonight
Wilko500:
I have done additional testing.
Commenting out the fix line in my latest ide build did not change the faulty labels.
Including the fix line in my previous ide build fixed the memory leaks and did not change the correctly labelled axis.
From that I conclude that the faulty axis labels are unrelated to the memory leak fix. Great news :)
However I continued testing to try and find a reason for the faulty labels. This was done by a lot of fresh installs using FpcUpDeluxe trying a variety of combinations of FPC & Lazarus versions. The results are:
Unpredictable! Sometimes the build finishes successfully, sometimes not, usually with an error
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---rtl-objpas/units/x86_64-darwin/rtti.s:12:1: error: non-private labels cannot appear between .cfi_startproc / .cfi_endproc pairsI could not see any pattern for success or failure.
However any of the builds that did succeed showed the axis labels incorrectly. Further research highlighted "non-private" labels error as being an issue with early builds ofMacOs Sequoia and associated Xcode. Hummp! Ran out of ideas so I went out for coffee. Then the penny dropped.
The only difference I can think of is that my MacBook OS was upgraded between the ide builds. The builds that label correctly were done before the upgrade, the build that label incorrectly were done after the upgrade.
The upgrade was from MacOs Sequoia 15.6.x to 15.7 and more significantly Xcode 16.4 to 26
I feel quite certain that the cause is FcpUpDeluxe incompatibility with Xcode 26.0. I'm guessing that you were using Xcode 15/16?
It seems unlikely that Chart labels is the only thing affected so wonder if you have any other thought about what might be happening "under the hood". I am way out of my depth on the internals of Lazarus/FPC/FpcUpDeluxe. I am thinking that I should place an issue on the FpcUpDeluxe git page?
In the meantime I have a working development environment without the memory leaks and for that my thanks to you and the team.
wp:
--- Quote from: Wilko500 on September 23, 2025, 01:15:18 pm ---the faulty axis labels are unrelated to the memory leak fix. Great news :)
--- End quote ---
Thank you, good news. It allows me to close the bug report.
--- Quote from: Wilko500 on September 23, 2025, 01:15:18 pm ---The only difference I can think of is that my MacBook OS was upgraded between the ide builds. The builds that label correctly were done before the upgrade, the build that label incorrectly were done after the upgrade.
The upgrade was from MacOs Sequoia 15.6.x to 15.7 and more significantly Xcode 16.4 to 26
I feel quite certain that the cause is FcpUpDeluxe incompatibility with Xcode 26.0. I'm guessing that you were using Xcode 15/16?
--- End quote ---
Sorry, I don't feel myself as a mac user, I only have macOS 12 as a VM on a Windows host and am happy that I have sufficient knowledge to do some Lazarus tests there...
You should report the issue to the bugtracker. But providing a TAChart sample as a test bed is way too complex, such an issue should become apparent in some simpler tests, e.g. by drawing to a canvas, and this is where a developer could step in.
I do not believe that the issue has something to do with FPCUpDeluxe, but rather maybe with Laz/main or FPC/main. BTW, when you link your Laz/main with FPC 3.2.2 (this is the combination that I am using for cocoa), does the labeling issue disappear? In this case, the incompatibility could be an incompatibility of FPC/main with XCode 26. For this test, you probably should make a new separate Laz/main+FPC3.2.2 installation with FPCUpDeluxe to avoid damaging your work environment - you can simply delete it afterwards.
You could also try to debug TAChart to try to understand which step fails to cause the irregularly spaced axis labels, and then based on this result you could write a simpler test application for the bug report (or I can do this for you). You could just drop a client-aligned TChart on a form of well-defined size (e.g. 500x300 - because labels depend on the size of the chart), and hide the bottom axis (otherwise you will be confused by that axis appearing in the debugger). In the project options, go to "Additions and overrides" and define a custom option, either in the project or in the session, named "-gwdwarfsets" (without quotes) - this way you will be able to step into the TAChart units. Then load the TAChart unit TAIntervalSources and set a break-point at the first instruction of TIntervalChartSource.CalculateIntervals - this is where the labels are calculated, and then step through the code at runtime. When I do this on my system, the first instruction CalcMinMaxCount returns minCount = 8 and maxcount = 43. The branch "if aipInteger in Params.Options" is skipped. "if aipUseNiceSteps", however, is entered. The first value of s is 1 and does not change in the "while" loop; when this "if" is exited, bestcount has the value 11. The branch "if aipUseCount" should not be entered (your description sounds, though, as if it is). At the end, ABestStep hat the value 0.2000...01, and ABestStart is -1.2. When you compare these observations with what happens on your machine we maybe can find the place where the calculation goes wrong.
When you do these tests report the results, I'll be happy to give you further instructions. No problem if you don't want to or don't have the time for it: this seems to be a fundamental issue with XCode 26, and I am rather sure that it will reappear later at another place.
Wilko500:
@wp, update. Thank you for your response and offer of help. To progress this I tried a few things.
The Sequoia upgrade to 15.7 was accompanied with upgrade to Xcode 26. I wanted to rule this out so I regressed my Xcode back to 16.4 and then to 16.3. Made no difference but I note that I had significant difficulty getting FpcUpDeluxe to build any combinations of Fpc & Laz.
I'm not sure why but I suspect that my Xcode was not "completely" removed. Although I am a long time Mac user I am not a Mac guru!! I have never got to the point of being comfortable at the command line.
So I reinstalled Xcode 26.0.1, a minor update that should not affect command line tools, and tried again in a more structured way. What I found is that the Chart label issue only occurs when FPC 3.3.1 is used in the build. It appears that 3.3.1 has been adopted into the trunk so it seems like further investigation is appropriate. So 3.2.0, 3.2.2 & fixes work for Laz 4.99, fixes & trunk and Chart labels are ok. Use FPC 3.3.1 and they are not displayed correctly.
I agree that a Chart test bed is way too complicated and a simpler test example is needed. I feel that my additional testing has ruled out Xcode but pointed the finger at FPC 3.3.1 (and trunk by implication) so yes, I think this issue will arise again.
So far I have not done any serious debugging but I will see if I can begin to understand what is happening using the details and hints you posted. First step I'll try to get answers to the questions you posted. I'm quite sure that I will need further guidance.
If there are any Mac users with Sequoia 15.x /Xcode 26 perhaps they can try to duplicate the Chart label problem?
Navigation
[0] Message Index
[*] Previous page