Jump to content

DPStano

Members
  • Content Count

    42
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by DPStano

  1. DPStano

    Floating point arithmetics

    it's not a minimal example ... it will take few days to add it to our build system (will try it for sure), I've just tried it in the new branch ... but I can guess that it will return 36678971.91 😄 there is something that has an influence on the result ... but I can't find what.
  2. DPStano

    Floating point arithmetics

    I can't create a minimal example ... just want to know if anybody knows what else can influence floating-point arithmetics in Delphi (some compiler directive, some other function something undocumented... some missing include... ) program Project14; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils, math; var E: Extended; begin FloatFormatSettings := TFormatSettings.Create(''); FloatFormatSettings.DecimalSeparator := '.'; FloatFormatSettings.ThousandSeparator := #0; E := 36678971.91; Writeln(FormatFloat('0.##########', E, FloatFormatSettings)); end. I can't share the CI build script but params are like (bellow) with a bunch of system and internal units and libraries $flags = @{ 'A'='AGenerics.Collections=System.Generics.Collections;Generics.Defaults=System.Generics.Defaults;WinTypes=Winapi.Windows;WinProcs=Winapi.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;'; 'NS'='Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;WinAPI.Foundation;System.Win;FMX;'; 'B' = ''; 'GD' = ''; 'DRELEASE' = ''; 'DCI' = ''; 'W' = '-SYMBOL_PLATFORM'; '$W+' = ''; '$C-' = '' }
  3. I'm trying to build the whole project from sources (only *.pas) with help of CI (gitlab-ci-runner) and dcc32.exe to have info about every System.* function in map file to properly reconstruct stack when Exception occurs. when I include \lib\win32\release that contains *.dcus project builds successfully but when I change it to \lib\source\rtl\sys that contains unit System.pas (checked) build will end with error Fatal: F1027 Unit not found: 'System' or binary equivalents (.dcu) Fatal: F1027 Unit not found: 'System' or binary equivalents (.dcu) anybody know what can be wrong? Edit: dcc32.exe cli compiler is from delphi 10.3
  4. DPStano

    CI build from sources (*.pas) not *.dcu

    my problem is that I'm getting weird reports from users, exceptions like EListError List index out of bounds (17) with a stack trace like System.Classes in TList.Get System.Classes in TList.Get Vcl.Forms in TApplication.HandleMessage it looks like that call stack trace is not complete, i think that jcldebug will use raw mode to resolve stack even if app is compiled with stack frames and will end up with some misleading info it seems I have broken stack trace only from units linked from dcus so the plan is to enable stack frames and recompile the whole app from sources
  5. DPStano

    CI build from sources (*.pas) not *.dcu

    hmm I can't see any `Line numbers for System(System.pas) segment .text` section in my map files for release build with detailed map turned on ... this line info is there just for debug builds
  6. DPStano

    CI build from sources (*.pas) not *.dcu

    I'll recheck it but jcldebug can't provide line info for units compiled from dcus
  7. that makes finding exception source a bit difficult procedure RaiseException(); begin raise Exception.Create('test') end procedure LoadCount(); begin Parallel.Join( procedure begin RaiseException(); end, procedure begin end).Execute; end; delphi and madexcept will show me stack trace like EJoinException should be raised at original address or contain original exception as innerexception
  8. DPStano

    original exception stacktrace/type is lost

    already found it 😄
  9. can we have generics collections and lock-free containers?
  10. DPStano

    generics collections and containers

    mostly all of them 🙂 ... eg TOmniBlockingCollection when using with IOmniParallelLoop<TLogItem>; to add the item you can't insert TLogItem directly but have to Add it with TOmniValue, s/t like TOmniBlockingCollection<TLogItem> would be much easier to use the name does not say anything that it's a lock-free collection, it could be lock-free just for primitive types
  11. I'm getting multiple reports of AccessViolations inside Task.Invoke function call, it seems that Task.Invoke can/will be called after thread termination unlike TThread.Queue that will not. is that correct behavior, how to wait for the end of Task.Invoke execution? @Primož Gabrijelčič
  12. same AV i see in logs from OnTerminated FTask := CreateTask( procedure(const Task: IOmniTask) begin end).Unobserved.OnTerminated(OnThreadTermination).Join(FTaskGroup) ... procedure TFoo.OnThreadTermination(const Task: IOmniTaskControl); begin FTaskGroup.Remove(FTask); //AV Here ... but TFoo holding FTask And FTaskGroup reference is waiting for WaitForAll in its destructor destructor TFoo.Destroy; begin // stop all threads FCancellationToken.Signal; FTaskGroup.WaitForAll; it looks like OnTerminated will be somehow called after WaitForAll
  13. I can't reproduce it myself, just see it in logs from testers my code looks like sample below https://gist.github.com/Sorien/d62c81f853f831f309c3d71bbc80209d (stripped sample) AV/Null pointer exception happens at the first line of invoke method https://gist.github.com/Sorien/d62c81f853f831f309c3d71bbc80209d#file-unit12-pas-L59
  14. I have multiple tasks like var Task := CreateTask( procedure(const Task: IOmniTask) begin end).Unobserved.Join(GlobalTaskGroup); Parallel.Start(Task , Parallel.TaskConfig.CancelWith(GlobalCancellationToken)); they can run for various times from seconds to minutes and some tasks can even run multiple times at once, and I need to terminate them and wait for termination all living task (some of them are already finished) at some point GlobalCancellationToken.Signal; GlobalTaskGroup.WaitForAll(); so the question is how to properly manage task group to keep just living tasks in it? ... i don't see any code how could TaskGroup remove task after its termination, it will keep reference until the task is explicitly removed by calling TaskGroup.remove.
  15. yes it works but without clearing taskgroup i can have taskgroup with like 100k finished tasks which won't be very effective at first i was searching for something like CreateTask( procedure(const Task: IOmniTask) begin try // do some work finally GlobalTaskGroup.Remove(Task) end end).Unobserved.Join(GlobalTaskGroup); but IOmniTaskGroup is not a group of IOmniTask but a group of IOmniTaskControl but i found solution OnTerminated can give me IOmniTaskControl so i'll unregister task from group there
×