mcafee started quarantining my simple pascal sound program this week! lazarus / 21-General ---------------------------------------------------------------------- Brian Berge · 2023-06-25 19:43 within the last week, mcafee began stopping one of my pascal/lazarus programs.  mcafee's real-time scanning stops the execution of, & quarantines the file for, a simple pascal program that i wrote & compiled in lazarus, for windows 11.  my program produces multiple freqencies at once, the simplest way i could find (that works)...but when mcafee stops & quarantines it, it reports "Threat name:  Trojan:Win/Generic.BNK".  if i add my program's filename to an "exceptions" list in mcafee, it runs ok...but i'd rather learn to do this simple sound program in a better/simpler way that doesn't require exceptions added into mcafee just to run!  anyone have any ideas?  (source attached.) ---------------------------------------------------------------------- jamie · 2023-06-25 19:47 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 program synth4easierprocedures;  {$mode objfpc}{$H+}  {$DEFINE UseCThreads} uses  {$IFDEF UNIX}  cthreads,  {$ENDIF} Classes, dos, SysUtils, CustApp, uos_flat;type TuosConsole = class (TCustomApplication)                      private   procedure   ConsoleInit;                      protected procedure   doRun;                        override;                      public    constructor Create (TheOwner : TComponent); override;                   end;const numvoices = 32;      minval    =  0.0001;var i, res                    : integer;    ordir, opath, PA_FileName : string;    PlayerIndex, inindex      : array [1..numvoices] of integer;    freq, vol               : array [1..numvoices] of real;    decayrate, sleeptime, j   : real;    {TuosConsole}procedure TuosConsole.ConsoleInit;begin   ordir := IncludeTrailingBackslash (ExtractFilePath (ParamStr (0)));   {$IFDEF Windows}      {$if defined(cpu64)}         PA_FileName := ordir + 'lib\Windows\64bit\LibPortaudio-64.dll';      {$else}         PA_FileName := ordir + 'lib\Windows\32bit\LibPortaudio-32.dll';      {$endif}   {$ENDIF}   {$if defined (CPUAMD64) and defined (linux     )}      PA_FileName := ordir + 'lib/Linux/64bit/LibPortaudio-64.so';   {$ENDIF}   {$if defined (cpu86   ) and defined (linux     )}      PA_FileName := ordir + 'lib/Linux/32bit/LibPortaudio-32.so';   {$ENDIF}   {$if defined (linux   ) and defined (cpuarm    )}      PA_FileName := ordir + 'lib/Linux/arm_raspberrypi/libportaudio- arm.so';   {$ENDIF}   {$if defined (linux   ) and defined (cpuaarch64)}      PA_FileName := ordir + 'lib/Linux/aarch64_raspberrypi/libportaudio_aarch64.so';   {$ENDIF}   {$IFDEF freebsd}      {$if defined(cpu64)}         PA_FileName := ordir + 'lib/FreeBSD/64bit/libportaudio-64.so';      {$else}         PA_FileName := ordir + 'lib/FreeBSD/32bit/libportaudio-32.so';      {$endif}   {$ENDIF}   {$IFDEF Darwin}      {$IFDEF CPU32}         opath       := ordir;         opath       := copy(opath, 1, Pos('/UOS', opath) - 1);         PA_FileName := opath + '/lib/Mac/32bit/LibPortaudio-32.dylib';      {$ENDIF}      {$IFDEF CPU64}         opath       := ordir;         opath       := copy(opath, 1, Pos('/UOS', opath) - 1);         PA_FileName := opath + '/lib/Mac/64bit/LibPortaudio-64.dylib';      {$ENDIF}   {$ENDIF}     // Load the libraries (here only portaudio is needed)      //    function uos_loadlib (PortAudioFileName, SndFileFileName, Mpg123FileName, Mp4ffFileName, FaadFileName, opusfilefilename: PChar): LongInt;   res := uos_LoadLib (PChar (PA_FileName), nil, nil, nil, nil, nil);   {writeln ('Result of loading (if 0 => ok ):  ' +} IntToStr (res) {)} ;   {writeln ((} uos_getinfolibraries () {))} ;   if res = 0 then begin         //// Create the player.         //// PlayerIndex:  from 0 to what your computer can do!         //// If PlayerIndex exists already, it will be overwriten...      for i := 1 to numvoices do begin         if uos_CreatePlayer (i) then            inindex := uos_AddFromSynth (i, -1,  -1, -1,  -1, -1,  -1, -1,  -1,  -1, -1,  0,  -1, -1, -1);               {function uos_AddFromSynth (PlayerIndex                                          : cint32;                                         Channels, WaveTypeL, WaveTypeR                     : integer;                                           FrequencyL, FrequencyR, VolumeL, VolumeR             : float;                                         duration, NbHarmonics, EvenHarmonics,                                              OutputIndex, SampleFormat, SampleRate, FramesCount: cint32): cint32;                // Add a input from Synthesizer with custom parameters                  // Channels     :  default:  -1  (2)  (1 = mono, 2 = stereo)                  // WaveTypeL    :  default:  -1  (0)  (0 = sine-wave, 1 = square-wave, used for mono & stereo)                  // WaveTypeR    :  default:  -1  (0)  (0 = sine-wave, 1 = square-wave, used for stereo, ignored for mono)                  // FrequencyL   :  default:  -1  (440 Hz)  (Left frequency, used for mono)                // FrequencyR   :  default:  -1  (440 Hz)  (Right frequency, used for stereo, ignored for mono)                  // VolumeL      :  default:  -1  (=    1)  (from 0 to 1) => volume left                // VolumeR      :  default:  -1  (=    1)  (from 0 to 1) => volume right (ignored for mono)                  // Duration     :  default:  -1  (= 1000)                => duration in msec  (0 = endless)                // NbHarmonics  :  default:  -1  (=    0)  Number of Harmonics                  // EvenHarmonics:  default:  -1  (=    0) (0 = all harmonics, 1 = Only even harmonics)                  // OutputIndex  :  Output index of used output                        // -1: all output, -2: no output, other cint32 refer to                      //    a existing OutputIndex                        //    (if multi-output then OutName = name of each output separated by ';')                // SampleFormat :  default:  -1  (0: Float32) (0: Float32, 1: Int32, 2: Int16)                  // SampleRate   :  delault:  -1  (44100)                  // FramesCount  :  -1  default: 1024                // result       :  Input Index in array  -1 = error}         {$if defined(cpuarm) or defined(cpuaarch64)}  // need a lower latency            uos_AddIntoDevOut (i, -1,  0.3, -1, -1, 0, -1, -1) ;         {$else}            uos_AddIntoDevOut (i, -1, 0.3  , -1, -1, 0, -1, -1) ;         {$endif}      end;   end   else writeln ('Error loading sound libraries');end; procedure setsynth (i : integer; f, v : real);begin   if f < minval then f := minval;   if v > 1      then v := 1;   if v < minval then v := minval;   freq := f;   vol  := v;   uos_InputSetSynth (i, 0, -1, -1,  f, f,  v, v,  0,  -1, -1, True);    {procedure InputSetSynth (InputIndex                              : cint32;                                WaveTypeL, WaveTypeR                  : integer;                                FrequencyL, FrequencyR, VolumeL, VolumeR: float;                                duration, NbHarmonic, EvenHarmonics     : cint32;                              Enable                                  : boolean);         // InputIndex   :  one existing input index         // WaveTypeL    :  do not change:  -1  (0 = sine-wave, 1 = square-wave, used for mono & stereo)         // WaveTypeR    :  do not change:  -1  (0 = sine-wave, 1 = square-wave, used for stereo, ignored for mono)         // FrequencyL   :  do not change:  -1  (Left frequency, used for mono)       // FrequencyR   :  do not change:  -1  (440 Hz) (Right frequency, used for stereo, ignored for mono)         // VolumeL      :  do not change:  -1  (= 1)  (from 0 to 1) => volume left         // VolumeR    :  do not change:  -1         (from 0 to 1) => volume rigth (ignored for mono)         // Duration     :  in msec (-1 = do not change)       // NbHarmonic   :  Number of Harmonics (-1 not change)         // EvenHarmonics:  default:  -1  (= 0)  (0 = all harmonics, 1 = only even harmonics)         // Enable       :  true or false}end; function gettimems () : longint;var hour, min, sec, hsec : word;begin   gettime (hour, min, sec, hsec);   gettimems := hsec * 10 + sec * 1000 + min * 60000 + hour * 3600000;end; procedure decay (sleeptime : integer);var i, j, k, starttime : longint;begin   starttime := gettimems;   repeat      j := 1 + random (numvoices);      vol [j] := vol [j] * decayrate;      if vol  [j] > 1      then vol  [j] := 1;      if vol  [j] < minval then vol  [j] := minval;      if freq [j] < minval then freq [j] := minval;      setsynth (j, freq [j], vol [j]);   until gettimems >= starttime + sleeptime;end; function maxvol : real;var i   : integer;  max : real;begin   max := 0;   for i := 1 to numvoices do if vol > max then max := vol ;   maxvol := max;end; procedure TuosConsole.doRun;begin   ConsoleInit;    for i := 1 to numvoices do begin      if i = 1 then freq := 164.81  {E3}      else          freq := freq [i - 1] + freq [1];      vol := 1;   end;   decayrate := 0.999995;   sleeptime := 500;   for i := 1 to numvoices do begin      writeln  (i:2);      setsynth (i, freq , 1);      uos_Play (i);      decay (125 + round (sleeptime));      sleeptime := sleeptime * 0.9;   end;   repeat      decay (1);   until maxvol <= minval * 2;   for i := 1 to numvoices do begin      uos_stop (i);      sleep (4);   end; //   writeln ('c.p.u. ct.:  ' + IntToStr (GetCPUCount ()));   uos_free;   sleep (4);   Terminate;end; constructor TuosConsole.Create (TheOwner: TComponent);begin   inherited Create (TheOwner);   StopOnException := True;end; var Application: TUOSConsole;begin   Application       := TUOSConsole.Create (nil);   Application.Title := 'Console Synthesizer';   Application.Run;   Application.Free;end.  Please put code that large in this thingy! ---------------------------------------------------------------------- jamie · 2023-06-25 19:59 I would say due to the hard coded paths you have that has the LibPortAudio in there is raising some concerns try to allow the libs to load without specifying the full paths. ---------------------------------------------------------------------- Fred vS · 2023-06-25 20:01 Hello Brian. Strange... Your program seems to be inspired by a uos console demo. Do you get more info from mcaffe appart: "Threat name:  Trojan:Win/Generic.BNK"? Did you try to run the program without the libraries (of course it will not run but to see if the problems comes from libraries)? Other thing in the uses section, I dont think that the "dos" unit is needed. ---------------------------------------------------------------------- jamie · 2023-06-25 20:06 I am always wise about using prebuilt libs from strange places, that is how the funny guys get into your system! ---------------------------------------------------------------------- Fred vS · 2023-06-25 21:03 If by bad chance it comes from the Portaudio library, you may try with other pre-compiled binaries, like: https://github.com/spatialaudio/portaudio-binaries Or even better, try to compile PortAudio on a safe system. (but needs some patience) http://www.portaudio.com/docs/v19-doxydocs/compile_windows.html ---------------------------------------------------------------------- marcov · 2023-06-25 21:26 If you scan with virustotal, do multiple antivirusses detect something? If not, it is a mcafee false positive, and the only good route is to report it to mcafee. ---------------------------------------------------------------------- Brian Berge · 2023-06-25 21:50 Quote from: Fred vS on June 25, 2023, 10:01:49 pmYour program seems to be inspired by a uos console demo. Do you get more info from mcaffe appart: "Threat name:  Trojan:Win/Generic.BNK"? Did you try to run the program without the libraries (of course it will not run but to see if the problems comes from libraries)? Other thing in the uses section, I dont think that the "dos" unit is needed. yes, i use the only working demo' i could find, because _every_other_ documentation or demo of any sound procedures did absolutely nothing on my windows system, or more often didn't even compile. no, they gave me no further information.  i talked to mcafee's tech support, & every time i described any details, they went SILENT-- PERMANENTLY SILENT...until i started over with less details.  true story. i tried it without reference to the units.  i attempted to minimize the program to the barebones possible, copying what i could from units or libraries; but (despite programming in pascal for 33 years) i don't see any way to trace file or library dependencies on here.  yes of course i tried i rem'ing out each unit reference, one-by-one.  of course it didn't run.  the lack of results taught me nothing except that every unit is apparently required (in the state it's in).  what are you imagining we can learn from those attempts? the dos unit is needed in order for me to read a time variable.  if you are saying it's not needed for me to read the time, then how else shall i read the time?  so, you are suggesting that pascal's dos unit is itself triggering mcafee?  i just added the dos unit to another program.  it ran fine--mcafee did not interfere.  i think that indeed this shows that calling the dos unit is not the source of the problem. ---------------------------------------------------------------------- jamie · 2023-06-25 22:02 My Wisdom tells me that you are lost and you think what I told you is malarky In windows, you normal do not specify the whole file path to a DLL, you either load the DLL in the windows system folder where all the other public DLLS for the platform target is loaded.  Or you load the DLL into the same application folder as your app.  You specify only the name of the library with its extension.   As for the other OSes, I can't say, do what you want.  Its your call, but this is the only way you are going to determine the problem but I know for a fact that virus scanners love the look for file path constants along with JS scrips etc. ---------------------------------------------------------------------- Brian Berge · 2023-06-25 22:42 Quote from: jamie on June 26, 2023, 12:02:13 amMy Wisdom tells me that you are lost and you think what I told you is malarky Quote from: Fred vS on June 25, 2023, 11:03:09 pmIf by bad chance it comes from the Portaudio library, you may try with other pre-compiled binaries, like: https://github.com/spatialaudio/portaudio-binaries forgive me, jamie.  i was failing to imagine which way to do it.  i downloaded newer builds of the windows dlls as linked by fred^, & i put them in the same folder as the app', also removing all path in the source (i believe).  mcafee still stopped it.  (after i unquarantined the new version & added it to mcafee's exception list, it ran normally.) thanks, you guys.  ...i wonder what else i can try.... ---------------------------------------------------------------------- wp · 2023-06-25 22:55 I downloaded the code from the first post and copied the uos files from some other project, along with the dlls, into the download folder. Then compiled with Lazarus - no problem, no virus warning, i could hear the sound. I uploaded the binary to VirusTotal: among 71 antivirus engines, only 4 gave a malware alarm - I would say, this is acceptable. Interestingly, the binary was ok for the McAfee engine, but gave an alarm for the Microsoft engine (which I am using, but did not give an alarm on my local system). So - all this antivirus thing is a big piece of crap! Send your binary to McAfee and ask them to analyze the file. In the meantime, put the Lazarus/FPC and all your project folders on a white list so that the virus scanner does not interfere with your work. I really have very bad experience with this kind of software. One day, after an update, BitDefender was deleting all the entire FPC-related tool-chain! P.S. Ah, and this is the code to avoid the DOS unit for time measurement (the function Time() is in the SysUtils unit): 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 function gettimems () : longint;const  MillisecondsPerDay = 24*60*60*1000;begin   gettimems := round(time() * MillisecondsPerDay);end; ---------------------------------------------------------------------- Fred vS · 2023-06-25 22:59 @wp: Many thanks to do this. Does the virus scan complained about the binary-executable or about the binary-library (or both)? ---------------------------------------------------------------------- wp · 2023-06-25 23:11 I only submitted my binary. But now I uploaded also the three DLLs, LibMpg123-32, LibPortAudio-32 and LibSndFile-32, and they all were green (no detection). ---------------------------------------------------------------------- Fred vS · 2023-06-25 23:26 Quote from: wp on June 26, 2023, 01:11:56 amI only submitted my binary. But now I uploaded also the three DLLs, LibMpg123-32, LibPortAudio-32 and LibSndFile-32, and they all were green (no detection). Hum, so I dont understand the result of Brian. I am not expert at all in virus things, what is strange is that Brian get suddenly a alert and before no problem (if I understood ok). Is it possible that a virus infects a already compiled binary (or library)? ---------------------------------------------------------------------- wp · 2023-06-25 23:36 Well, if he builds with infected tools, the compiled binary can be infected, too... He simply should upload his binary to VirusTotal (it's free, and the analysis takes only a minute or so), and when there are only a few alarms he should submit the result along with his binary to McAfee, ask them to analyze the file and to fix their virus detection. Otherwise he should scan his system, ideally after booting from a boot CD or USB-stick with AV software (the AV companies have them). ---------------------------------------------------------------------- Brian Berge · 2023-06-25 23:52 i updated the dlls, & referenced them with no paths.  mcafee still blocked it.  i submitted it to virustotal:  they say only 1 app's engine has any problem with it, & that mcafee says it's fine.  i'm waiting on mcafee right now to claim a false positive & ask to send it to them to analyze.... 👍 thank you very much for all the advise, everyone! ---------------------------------------------------------------------- jamie · 2023-06-26 00:15 Put a ReadLn at the start of the app before it loads any DLL's, detect at which point the trigger starts. ---------------------------------------------------------------------- robert rozee · 2023-06-26 00:16 Quote from: wp on June 26, 2023, 12:55:57 amAh, and this is the code to avoid the DOS unit for time measurement (the function Time() is in the SysUtils unit): 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 function gettimems () : longint;const  MillisecondsPerDay = 24*60*60*1000;begin   gettimems := round(time() * MillisecondsPerDay);end; GetTickCount64 is also an option if you are just wanting to measure the milliseconds between events: https://www.freepascal.org/docs-html/rtl/sysutils/gettickcount64.html cheers, rob   :-) ---------------------------------------------------------------------- Brian Berge · 2023-06-26 00:46 Quote from: robert rozee on June 26, 2023, 02:16:07 amQuote from: wp on June 26, 2023, 12:55:57 amGetTickCount64 is also an option if you are just wanting to measure the milliseconds between events: https://www.freepascal.org/docs-html/rtl/sysutils/gettickcount64.html thank you, r.r. & w.p..... i uninstalled mcafee per their instructions.  i did a windows anti- malware reboot-scan, & also a windows anti-virus full-scan.  my system is clean. with mcafee uninstalled, everything's fine with me! 😂  windows security isn't recommending anything else....  i'll share what i hear back from mcafee (& what happens if i re-install it).... ---------------------------------------------------------------------- jamie · 2023-06-26 00:50 I don't use Mcafee anymore because it turned into crap when they switch to .NET, Mcafee is Dead, long live the KING! ---------------------------------------------------------------------- Fred vS · 2023-06-26 00:58 Quote from: Brian Berge on June 25, 2023, 11:50:49 pmYes, i use the only working demo' i could find, because _every_other_ documentation or demo of any sound procedures did absolutely nothing on my windows system, or more often didn't even compile. Huh, from uos demos, "consolesynthe.pas" is the only working demo? All others demos from uos are not working? ---------------------------------------------------------------------- Brian Berge · 2023-06-26 02:14 Quote from: Fred vS on June 26, 2023, 02:58:22 amQuote from: Brian Berge on June 25, 2023, 11:50:49 pmYes, i use the only working demo' i could find, because _every_other_ documentation or demo of any sound procedures did absolutely nothing on my windows system, or more often didn't even compile. Huh, from uos demos, "consolesynthe.pas" is the only working demo? All others demos from uos are not working? the program does nothing but produce a little sound.  i was referring to all sound-producing procedures/units/libraries i could find.  all other demo's of _sound_procedures_.  does u.o.s. contain another sound library that i overlooked? ---------------------------------------------------------------------- Fred vS · 2023-06-26 02:24 Quote from: Brian Berge on June 26, 2023, 04:14:20 amQuote from: Fred vS on June 26, 2023, 02:58:22 amQuote from: Brian Berge on June 25, 2023, 11:50:49 pmYes, i use the only working demo' i could find, because _every_other_ documentation or demo of any sound procedures did absolutely nothing on my windows system, or more often didn't even compile. Huh, from uos demos, "consolesynthe.pas" is the only working demo? All others demos from uos are not working? the program does nothing but produce a little sound.  i was referring to all sound-producing procedures/units/libraries i could find.  all other demo's of _sound_procedures_.  does u.o.s. contain another sound library that i overlooked? Ha, ok, I am the maintainer of uos, I dont know about other sound libraries. You may try Bass audio library (but it is not open-source). There is also ACS that has lot of features. ---------------------------------------------------------------------- Brian Berge · 2023-06-26 02:29 Quote from: Fred vS on June 26, 2023, 02:58:22 amHa, ok, I am the maintainer of uos, I dont know about other sound libraries. thank you for u.o.s., fred! ☝️ ---------------------------------------------------------------------- Fred vS · 2023-06-26 02:33 Quote from: Brian Berge on June 26, 2023, 04:29:17 amQuote from: Fred vS on June 26, 2023, 02:58:22 amHa, ok, I am the maintainer of uos, I dont know about other sound libraries. thank you for u.o.s., fred! ☝️ You are welcome! (but you scared me a bit with this virus in PortAudio  ) ---------------------------------------------------------------------- Brian Berge · 2023-06-26 02:40 Quote from: Fred vS on June 26, 2023, 04:33:07 amYou are welcome! (but you scared me a bit with this virus in PortAudio  ) sorry about that.  what mcafee was doing had me scared about things on here too.  i guess i learned they're crap (due to good help here--thnx again folks) ---------------------------------------------------------------------- Fred vS · 2023-06-26 03:00 Quote from: Brian Berge on June 26, 2023, 04:40:06 amQuote from: Fred vS on June 26, 2023, 04:33:07 amYou are welcome! (but you scared me a bit with this virus in PortAudio  ) sorry about that.  what mcafee was doing had me scared about things on here too.  i guess i learned they're crap (due to good help here--thnx again folks) It's scary because Portaudio has access to the heart of the system and could be a perfect target for a virus. About MacAfee anti-virus, John MacAfee, the creator, left us two years ago, let's leave his product too. ---------------------------------------------------------------------- Brian Berge · 2023-06-26 14:49 i heard back from mcafee.  what they had me submit was the .EXE & the 2 main windows .DLLs in a .ZIP file.  the description i provided in the form was that a programming community was asking me to check whether this program was really triggering mcafee's detection or not.  i also explained that we intended to develop further programs using these DLLs, & not just do something with this particular little nothing-program. they did not answer or even acknowledge any of that.  instead they wrote: "We have reviewed your submission for whitelisting of your software & the submitted file named 'synth4.EXE-and-2-win-DLLS.zip' have been Whitelisted." as far as i'm concerned, they're telling me they just put the name of the _.ZIP_ file in a list.  they cannot actually operate as stupidly as that (can they?)...but why are they choosing to keep us in the dark? i'm tired of 100% wasting my time with these money-takers, just to be obstructed _&_ left in the dark.  therefore, i agree to blacklist mcafee 100%. ---------------------------------------------------------------------- Fred vS · 2023-06-26 15:23 Hum, sorry but I am not totally convinced. May I ask you what fpc parameter you used to compile your program? Did you compile it via Lazarus IDE or via terminal-command line? Did you use optimization (-O1, -O2, -O3) or/and  strip parameters (-Xs -CX -XX)? The uos Lazarus demo-project consolesynth.lpi uses those parameters: 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 -MObjFPC- Scghi-CX-Cg-Os1-Xs-XX-vewnhibq-Fiunits/x86_64-linux- Fu.-FUunits/x86_64-linux-FE.-oconsolesynth What does the anti-virus say if you compile the project without those parameters: ? 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 -CX-Cg- Os1-Xs-XX Thanks. ---------------------------------------------------------------------- Brian Berge · 2023-06-26 16:22 fred, i'll be happy to do my best to help, any way i can.  firstly: i re-installed mcafee.  i then ran the copy of the .EXE that i submitted to mcafee.  it didn't trigger mcafee at all, but the program froze at the end instead of closing.  so i recompiled it, ran it, & it still froze at the end instead of closing.  i wonder if the timer is somehow working differently since updating how it reads the system's time in milliseconds (as i was advised to update it). so, i rebooted, made sure my windows 11 was updated (it is), recompiled & ran again.  now the same source code compiles, runs, gets to the end &, instead of closing, gives this message: "Project synth4easierprocudures raised exception class 'External: ACCESS VIOLATION' with message: Access violation reading from address $FFFFFFFFFFFFFFFF.  At addres 7FF980E042A8" (Latest copy of source attached.) p.s. the only other thing i did was:  i unzipped the exact .EXE i submitted, over my latest compile, in order to try running the exact one they whitelisted.  when i did so, i also unzipped the 2 .DLLs over their existing copies.  i didn't anticipate that .ZIP would introduce any change to the file or its function, but maybe it did somehow?  i'll make sure to re-download the .DLLs from the safe source given here previously.... ---------------------------------------------------------------------- Brian Berge · 2023-06-26 16:39 i rebooted again & had mcafee scan everything.  it found zero threats.  this system has always had protection, & everything on it has worked perfectly.  (it's a lenovo laptop that i've had for about a year.) what should my next step be, in order to be thorough?  uninstall then reinstall f.p.c. & lazarus?  then get into these compiler options?  (i'm wondering if you have the same advice since mcafee is no longer being triggered at all.  they suggested last night that it was possible their install had become corrupt, & therefore to try uninstalling & re-installing it.  everything seemed 100% fine before i re-installed it.) ---------------------------------------------------------------------- Fred vS · 2023-06-26 16:54 Hello Brian. Sorry but I cannot analyse-test your program at the moment. After a fast check, some notes: - You used array with index begining with 1 (array [1..numvoices]), better to adapt your code using array begining with 0 ((array [0..numvoices]) - You are not obliged to put the library directly in the root- directory of the project.   PortAudio.dll is dynamically loaded by loadlibrary() so you have all freedom to place it where you want.   I think the remark of Jamie was because I did not see that is was loaded by loadlibrary() vs "external". But about your crash at end, sorry I dont know and I dont have a Windows machine to test it. About your nexst step, where are you? Is fpc-Lazarus working ok? What are you new problems? ---------------------------------------------------------------------- Brian Berge · 2023-06-26 17:02 i did my compiling via lazarus.  the project's compiler options say: build mode:  default other unit files:  [blank] include file:  $(ProjOutDir) libraries:  [blank] unit output dir.:  units\$(TargetCPU)-$(TargetOS) target file name:  synth4easierprocedures Apply conventions:  (checked) other sources:  [blank] debugger path addition (none):  [blank] optimization is set to "1 (quick, debugger friendly w. sm. limitations) (-O1)" -CX is checked -XX is checked -Xs is checked ---------------------------------------------------------------------- Brian Berge · 2023-06-26 17:12 the only problem i have now is:  i re-installed mcafee, despite my interests, in order to check if it would stop your program (for you, as you requested of me what it would now do).  mcafee no longer stops my program, HOWEVER: - now mcafee, the apparent problem-source, is BACK ON MY COMPUTER - the exact .EXE which ran fine yesterday now, closing itself at the end, now freezes at the end instead. - recompiling & running it anew from lazarus, it still freezes, AND it gives this error message: "Project synth4easierprocudures raised exception class 'External: ACCESS VIOLATION' with message: Access violation reading from address $FFFFFFFFFFFFFFFF.  At address 7FF980E042A8" you're mentioning my variable references:  an array starting its labeling from "0" can still be mis-referenced.  my variable structure & the references to it are all exactly the same as before.  how did working variable structure & references change to critical errors...without changing?  even the compile did not change!  what was wrong with running it without mcafee, where everything went perfectly, where compiles done last week & running fine became able to run fine again (as they should)? listen, i reinstalled mcafee just to check for you.  everything went from perfect to more-fvcked than ever since the re-install.  i answered you that mcafee is not triggered at all now (even without exceptions added).  is there more with mcafee that you need me to check before i go ahead & remove it forever?  that is my number-one priority:  answer you to your satifaction & then REMOVE THE PROBLEM AGAIN.  WHAT MORE DO YOU NEED ME TO DO WITH THIS FRAUD, MCAFEE? windows 11 real-time protection is representing that it's covering me fine.)  please sir, did i answer you satisfactorily regarding this problem-causing fraudulent waste-of-time-&-money called "mcafee"? or not?  what is your new?/continuing? problem that i am keeping this software on my system to test for you, fred? then i think i better re-install f.p.c. & lazarus...& then everything that works fine should still work fine...shouldn't it?  or did lazarus (or a library) stop working just in the last few days...but only for sounds stuff...& only in relation to mcafee on my system which copy its employees suggest went corrupt? ---------------------------------------------------------------------- Fred vS · 2023-06-26 17:26 Cool man. Quotethe only program i have now is:  i re-installed mcafee, despite my interests, in order to check if it would stop your program What "your program" ? Do you have problems with "my" consolesynth.pas uos demo program? About the parameters used, with Lazarus, click menu Project-Project Options and click on the button "Show Options" and copy the content. PS: I dont care about virus, I use Linux. ---------------------------------------------------------------------- Brian Berge · 2023-06-26 17:33 Quote from: Fred vS on June 26, 2023, 05:00:33 amQuote from: Brian Berge on June 26, 2023, 04:40:06 amQuote from: Fred vS on June 26, 2023, 04:33:07 amYou are welcome! (but you scared me a bit with this virus in PortAudio  ) About MacAfee anti-virus, John MacAfee, the creator, left us two years ago, let's leave his product too. fred:  it was the report--only the report--of a virus.  but the threat to ME is real, because you have asked me to re-introduce it to my system (in order to update its behavior to you). let's leave his product?  you asked me what it would do to your program now that everything is working perfectly.  as per your request, i re-installed it in order to answer you.  my answer is that it does not call it a threat, but the exact same compilation freezes-- the exact same .EXE.  ...& recompiles give worse problems than ever.  please forgive my stress being high, as this is an incredibly situation to have my life frozen in for 48 hours.  please let me know what else i can do to help you with your problem:  you have told me "let's leave his product", & you have got me running it again, & here i am now frozen in the midst of helping you investigate mcafee on my computer at my expense....  fred, what have i failed to answer you adequately, in order for me to do again as you suggested i.e. "let's leave his product"? ---------------------------------------------------------------------- Brian Berge · 2023-06-26 17:35 Quote from: Fred vS on June 26, 2023, 07:26:31 pmQuoteAbout the parameters used, with Lazarus, click menu Project-Project Options and click on the button "Show Options" and copy the content. forgive me.  i finally found the "show options" button.  here's what it reads: C:\lazarus\fpc\3.2.2\bin\x86_64-win64\fpc.exe -MObjFPC -Scghi -CX -Os1 -Xs -XX -vewnhibq -Fiunits\x86_64-win64 -Fu. -FUunits\x86_64-win64 -FE. -osynth4easierprocedures.exe ---------------------------------------------------------------------- wp · 2023-06-26 17:46 I downloaded the code presented in reply #9 into the same folder that I had used yesterday. It took me some time to get everything working because the code uses the portaudio dll with a different name now and expects it in the application root directory. After getting everything right, the code is compiling and running correctly, expect for what you mention yourself: It seems that the application hangs at the end. However, this is not reproducible because sometimes the application does terminate after the fadeout. So, I think this is not an issue of McAfee, but of the application. Unfortunately I am not an expert in uos, maybe Fred can provide better assistance. I am attaching my version (in which, for easier reading, I removed the many comments and I applied the coding style I am used to). The uploaded zip contains the portaudio dll for 32 bit only. ---------------------------------------------------------------------- Brian Berge · 2023-06-26 17:48 Quote from: Fred vS on June 26, 2023, 05:23:12 pmWhat does the anti- virus say if you compile the project without those parameters: ? please instruct me in correcting them as you wish, & i'll be happy to say if mcafee begins saying anything again. i have not yet re-uninstalled mcafee, nor re-installed f.p.c. & lazarus.  to answer your question, f.p.c. & lazarus have given me no problems whatsoever, except: - my little non-program using your program, started triggering mcafee only within the last week - after removing mcafee, everything went back to working perfectly - after re-installing mcafee to answer you if it would be triggered, it was not triggered but my little non-program using your program stopped closing. please instruct me in correcting the compiler options as you are requesting. also please advise if you'd like me to try it with the fresh install of mcafee still here, or not? & with fresh installs of F.P.C. & lazarus, or not? (does the order matter? i am doing nothing in my entire life but attempting to answer your concerns, fred.  thank you.) ---------------------------------------------------------------------- Fred vS · 2023-06-26 17:49 Hello Brian. Ok, ok, let blow down. I understand perfectly your frustration and I am sorry that I could be the cause of that. You came with a virus problem about some code that you used from uos. McAfee complained for something and it seems a false alert. I did not know that you de-installed MacAfee. So it could be interesting to find what makes MacAfee un-happy. Maybe we never will find it but before (sorry I am a total explorer) I want to be sure that optimization or stripping is not the reason why. For the new crash of "your" program, I am totally sorry but dont you have backup of your original code? I would help to test-analyse "your" program but I dont see how to find a Windows machine at the moment. Fre;D ---------------------------------------------------------------------- Brian Berge · 2023-06-26 17:59 Quote from: Fred vS on June 26, 2023, 07:49:17 pmI did not know that you de-installed MacAfee. So it could be interesting to find what makes MacAfee un-happy. For the new crash of "your" program, I am totally sorry but dont you have backup of your original code? i already made it clear to you multiple timees that i uninstalled it, & that i re-installed it for you, & i told you multiple times whether it was happy or not.  you cannot read my answers?  cannot see them?  don't have time?  are pretending?  i don't understand your inability to receive my many answers to your questions. i have also made it clear to you multiple times that it is not only the exact same source code, but also the exact same compile which went from working to not-working.  i don't understand how you are not reading my answers to you. you asked me the problem.  i reflected about it.  why are you now ignoring the problem? & also ignoring my questions to you? is it a very serious language problem between us? ---------------------------------------------------------------------- Fred vS · 2023-06-26 18:21 Ok, let it start with the new crash. What PortAudio.dll are you using, the one from uos package or the new one from the link I showed you? I did not test the last one from the link but I am sure that the one from uos/demo/lib is ok and wp tested it and there are no virus. @wp: many thank to test, ok,ok, I have to find a Windows machine... ---------------------------------------------------------------------- Brian Berge · 2023-06-26 18:41 Quote from: Fred vS on June 26, 2023, 08:21:45 pmWhat PortAudio.dll are you using, the one from uos package or the new one from the link I showed you? I did not test the last one from the link but I am sure that the one from uos/demo/lib is ok and wp tested it and there are no virus. i already reported very clearly, multiple times, exactly which copies of your .DLLs i have been using & submitting to mcafee, & i have referenced where i got them in order to leave no misunderstandings. why are you still ignoring everything i've told you here in the last day, fred? i have now made it clear to you that i recognize you are not reading any of the answers you have been told here.  you are also still ignoring our questions. again:  is our language barrier very serious?  if so, why don't you post in your primary language, & we can try google translator?  otherwise, please explain why you are ignoring most everything you're told (& asked) in this dialogue in the last 18 hours? ---------------------------------------------------------------------- Fred vS · 2023-06-26 19:08 You know what, I will stop to try to help you. [EDIT] Also your code is too complicated for me, I dont understand your goal. Good luck with a other sound library. Fre;D ---------------------------------------------------------------------- Brian Berge · 2023-06-26 19:35 i wrote a simple sound test using fred's t.u.o.s. console.  the program worked fine for months, but in the last week started triggering mcafee with a false positive. as we trouble-shot the problem, i followed fred's instructions to download the .DLLs he linked me to. i put them in the application's directory, & referred to them with no path names (as recommended by jamie). i updated the source code to refer to the newest .DLLs that fred linked me to (the names are a little different with his different versions). repeatedly, i have reminded everyone which .DLLs i have updated to (as per fred's request), & that i included these in the false-positive report to mcafee (which i reported as per your folks' suggestions here).  i also shared updated source code. mcafee told me that their install on my system might have gone corrupt, & advised me to uninstall & reinstall it. while it was uninstalled, my little sound non-program (fred says i have no program--there is only his program) ran fine.  but fred wanted to know if the re-install would get triggered like the corrupt install.  fred already said let's leave mcafee alone.  i already said i'm blacklisting mcafee.  however, in order to answer fred, i re- installed it.  i confirmed to him that indeed a clean install of mcafee is not triggered by my little sound non-program that uses his program (i.e. his library .DLLs). fred is ignoring my reports of all the above.  he is asking which .DLLs i downloaded from him & installed & reported to mcafee, but he already knows & i did all that with the .DLLs he linked me to & had me install & manually invoke, specifically.  i've reflected these details every time it has come up.  because i asked him why he's not answering my questions, he has responded that he will no longer help, & has invited me to use other sound routines. what are the other sound routines?  i tried everything else i could find that was supposed to work on windows, but none of it ever worked except fred's routines.  where are any working sound routines for lazarus in windows (except the one made by fred which he can't keep track of the .DLLs for even when he links them, & which he can't allow users to run unless they re-install mcafee for him, & who then ignores all answers & can't answer any questions, & who then refuses to help completely)? listen:  since i used the .DLLs fred requested me to, & since i re- installed mcafee as he requested me to, HIS PROGRAM now freezes with this error: "Project synth4easierprocudures raised exception class 'External: ACCESS VIOLATION' with message: Access violation reading from address $FFFFFFFFFFFFFFFF.  At addres 7FF980E042A8" this has been happening _only_ since i followed fred's instructions! & now he is pretending he can read none of my posts, & is refusing to help me at all.  how can t.u.o.s. be lazarus' only sound routines that work in windows (until fred's instructions are followed)? ---------------------------------------------------------------------- Fred vS · 2023-06-26 20:01 Ho My Dog.  Let s begin fom a white page, forget all what you said and what i said. 1) At the moment, on your system, you get  'External: ACCESS VIOLATION' error that you did not have before to met me. 2) What PortAudio.dll version are you using when you get that error, the one from uos or the new from the link I showed you? 3) Forget about trying to find why Mcafee is giving problems, asap I will try to find why. 4) Stop to bark. ---------------------------------------------------------------------- Brian Berge · 2023-06-26 20:21 the portaudio .DLLs i'm using have been the ones you recommended, ever since you recommended them.  you wrote: "If by bad chance it comes from the Portaudio library, you may try with other pre-compiled binaries, like: https://github.com/spatialaudio/portaudio-binaries " forgive me, i thought i was making this clear.  those are the only ones i have used, since following your rec's for this, & for using time without DOS; & jamie's rec's that it be in the same folder as the app' (so the source references don't have to include any path). i also detailed to you that i stored the 2 main win .DLLs in a .ZIP with the .EXE, which i submitted to mcafee.  mcafee advised i uninstall their app'.  after doing so, i tested the exact same files again.  everything went perfectly. i got back on & reported this resolution to you.  so you said, "um...", that's not good enough for you.  you wanted to know how mcafee would respond.  so i reinstalled it for you.  it was not triggered. but my program now freezes at the end, where it used to close itself based on my timer function.  it was changed according to your recommendation.  this is not barking, this is words that stands for facts.  it is what it is.  the exact same .EXE that ran perfectly & closed, began freezing at the end only after re-installing mcafee for you.  when i recompiled & re-ran it, it not only froze but gave the report of a memory error (already shared multiple times). <- this is information.  i didn't just quote the information again, because i already have.  i'm not leaving it unmentioned, because then you will reset & go silent again as if there is no problem with me following your instructions...& still following your instructions...while you go silent on me with my system not even working (& me unable to change it because you were asking the compiler options). listen, i am not on a white sheet.  i am on the system i have left after following your instructions.  i stopped keeping my install of lazarus when you said you weren't going to help me.  i didn't keep the install, so i cannot answer you a 3rd time what the settings might have been (nor update them from there).  i need a break from your game.  we started with a white page.  our communication is there.  this is communication.  i see how you do it.  i am able to say the truth again.  because i'm saying the truth, you will give up again? your english is very broken.  for the 3rd time, why don't we try communicating in your native language (using google translate).  i am not following you into further traps just because you keep quitting on communication.  when you give up communicating, i will communicate with everbody else.  i will continue to reflect the truth, fred. i must rest from the stress of fred refusing to answer all day, & then refusing to help altogether. i will re-install f.p.c. & lazarus...AFTER i recover from the stress of this very poor communication game with fred! this is not "barking"! this is the facts! it is what it is! this is all on record here:  https://forum.lazarus.freepascal.org/index.php/topic,63772.0.html --brian 949-300-2784 this is not a joke ---------------------------------------------------------------------- Fred vS · 2023-06-27 03:12 I did analyse your code. Of course it crash at end, I even dont understand how it can run and produce something else than noise. You create 32 (!) stereo players (each player is a independent thread) using float-32-samples, with 32 independent output, that you want to synchronize (without using synchronize) to produce a "simple" sound. And you dont give the time to stop the players and free the library before terminate the app. Please take a look at the consolesynth.pas demo, it uses only one player. If you want more waves to have polyphony effect, add new inputs with uos_AddFromSynth() in the same unique player and change live the parameters with uos_InputSetSynth(). There is a uos demo MultiInput, this is the same principle but there the input are files (uos_AddFromFile()), you should use uos_AddFromSynth() . And use the PortAudio library from uos/examples/lib, not the new one from the link that I have given (sorry for that, it seems not ok). ---------------------------------------------------------------------- Thaddy · 2023-06-27 10:38 Simply quaranteen McAFee, iow uninstall it. There is no point in using anything other than ms defender and the security features of windows 10/11. waste of money and a waste of time. I wonder why there are still people that trust it. ---------------------------------------------------------------------- dsiders · 2023-06-27 15:00 Quote from: Thaddy on June 27, 2023, 12:38:40 pmSimply quaranteen McAFee, iow uninstall it. There is no point in using anything other than ms defender and the security features of windows 10/11. waste of money and a waste of time. I wonder why there are still people that trust it. If you have a machine where the OEM included it in their bloatware... it's almost impossible to get it fully and safely removed. I'm looking at you, HP. ---------------------------------------------------------------------- Brian Berge · 2023-06-27 20:38 Quote from: Thaddy on June 27, 2023, 12:38:40 pmSimply quaranteen McAFee, iow uninstall it. There is no point in using anything other than ms defender and the security features of windows 10/11. waste of money and a waste of time. I wonder why there are still people that trust it. if it matters, why not read the thread & respond to what was written.  mcafee were the first to tell me to uninstall their program.  are people pretending i didn't uninstall it?  i uninstalled it, as per mcafee's suggestion, & i reported so here.  i was happy to resolve all problems 100% by uninstalling mcafee.  fred said let's not use mcafee.  i expressed my agreement to blacklist it.  as soon as i did, fred wrote "no no, i am not convinced", & wanted to know what mcafee's app' would react to the program.  i tested the exact same .EXE from the exact .DLLs he had me download from a specific link.  helping fred is the 1 & only reason i re-installed it.  that is the first time it froze, & the point where it began always freezing.  after rebooting & recompiling, the freeze turned into memory errors.  mcafee was not triggered to indicate a threat, re-installing it coincided with the creation of 100% of the actual errors.  actually, changing how i am counting milliseconds as per fred, & re-installing mcafee as per fred. i have already uninstalled mcafee again, of course!  fred is in no position to force me further.  since i have uninstalled it, how can i uninstall it again?  it has left no remains--it was not o.e.m.. on this laptop.  so, how can i follow your guys' advice & remove mcafee any further? thaddy:  are you suggesting i re-install mcafee?  why?  just so i can put it in quarantine & "low-uninstall" it?  what do those descriptions even mean?  how will that improve fred's .DLLs from being wrong (according to him) to being right?  or...how will that improve anything at all? ---------------------------------------------------------------------- Brian Berge · 2023-06-27 20:41 Quote from: Fred vS on June 27, 2023, 05:12:11 amI did analyse your code.  ..I even dont understand how it can run and produce something else than noise.  You create 32 (!) stereo players (each player is a independent thread) using float-32-samples, with 32 independent output, that you want to synchronize (without using synchronize) to produce a "simple" sound.  And you dont give the time to stop the players and free the library before terminate the app. i am doing it the way the developer recommended to me in a forum.  if it wasn't this forum, then it was another.  if you are the developer, then that was you.  if i've done it the wrong way according to you, then why did you tell me to do it this way, fred? ---------------------------------------------------------------------- Fred vS · 2023-06-27 21:08 Quote from: Brian Berge on June 27, 2023, 10:41:32 pmQuote from: Fred vS on June 27, 2023, 05:12:11 amI did analyse your code.  ..I even dont understand how it can run and produce something else than noise.  You create 32 (!) stereo players (each player is a independent thread) using float-32-samples, with 32 independent output, that you want to synchronize (without using synchronize) to produce a "simple" sound.  And you dont give the time to stop the players and free the library before terminate the app. i am doing it the way the developer recommended to me in a forum.  if it wasn't this forum, then it was another.  if you are the developer, then that was you.  if i've done it the wrong way according to you, then why did you tell me to do it this way, fred? Ha, I see now in uos forum. Indeed you asked how to do to play multiple players at same time. I show you with 3 then 15, insisting that it will depend of what your sound card can do... You seemed happy with the result, so I was happy too. But in the code you give here in the forum, you do not need to have 32 players, you could make better with only one player and multiple input. Sorry but I cannot guess all what people want and also there are lot of demos, with lot explanations in code. I apologize. ---------------------------------------------------------------------- Brian Berge · 2023-06-27 21:28 thank for understanding, explaining, & apologizing fred.  everything seemed perfect until my copy of mcafee apparently went corrupt.  i'm sorry to everyone about the confusion that created.  i appreciate learning more about how to check on (& correct) anti-virus issues, & how to use your routines better too!  thanks again, fred 👍 ---------------------------------------------------------------------- Curt Carpenter · 2023-06-27 21:35 A little off topic, but for the last month I've been getting daily emails that my McCaffee protection is about to expire -- although I've never used it. ---------------------------------------------------------------------- Fred vS · 2023-06-27 22:05 Quote from: Brian Berge on June 27, 2023, 11:28:17 pmthank for understanding, explaining, & apologizing fred.  everything seemed perfect until my copy of mcafee apparently went corrupt.  i'm sorry to everyone about the confusion that created.  i appreciate learning more about how to check on (& correct) anti-virus issues, & how to use your routines better too!  thanks again, fred 👍 Hum, maybe McAfee wasn't entirely wrong to quarantine your program. OK, ok, I leave, thanks for the good end.  Fre;D ---------------------------------------------------------------------- Brian Berge · 2023-06-28 04:07 Quote from: Fred vS on June 28, 2023, 12:05:37 amHum, maybe McAfee wasn't entirely wrong to quarantine your program. you mean if my program was exceeding its memory "territory"?  if i was doing it wrong for that quantity of voices, i can imagine that. fred, have you written any form of guide to your routines?  i forget if i saw one when i downloaded things a couple months ago. ---------------------------------------------------------------------- Brian Berge · 2023-06-28 04:08 Quote from: Curt Carpenter on June 27, 2023, 11:35:36 pmfor the last month I've been getting daily emails that my McCaffee protection is about to expire -- although I've never used it. for the last few months, mcafee has told me that my subscription has been expired...even though it was renewed!  they're fools! 😂