Recent

Author Topic: Compiler renamed my classes and all procedures  (Read 9807 times)

Handoko

  • Hero Member
  • *****
  • Posts: 5154
  • My goal: build my own game engine using Lazarus
Re: Compiler renamed my classes and all procedures
« Reply #30 on: April 03, 2018, 05:52:55 pm »
No seriously guys what virus, trojan, compiler etc.. would rename variables in a source file? More over the rename is done in a particular way. Most likely the IDE has some hidden bug, which is triggered by some particular configuration/action. Maybe two instances of Lazarus are running at the same time, or perhaps the OP is a funny man and he has a good laugh watching us jumping through his hoops(not likely though).

No matter what the culprit is, we all want to know the answer. We should try every thing we can do and we can think about. I rather choose 'real' actions instead of talking or guessing is the OP funny, cute, troll or whatever. :D

JLWest

  • Hero Member
  • *****
  • Posts: 1293
Re: Compiler renamed my classes and all procedures
« Reply #31 on: April 03, 2018, 06:11:57 pm »
Hi

I too have corrected this version of the code, it seems to be much older than other versions you have posted?

Look it has happened to me about four times I think. Each time I copy out the source to Notepad++ and start over.

My last posting was early in the start over process.


Do you have any of the files open with a a different editor, ie notepad ++?
Do you have another instance of Lazarus running that has the Files Open? Check TaskManager
Do you have AUtoHotKey or similar app running, maybe this could be interferring.


No to all all of the above. I usuall have Notepad++ open with a file called Code Bits and Bytes. The file is a text file with bits of code like the following:

=====================================================================================================================
                             Dir Stuff
==========================================================
   procedure mkdir(  const s: shortstring); overload;

   
MSTPLNDIR = 'MstPlnDir\';  Windows Only
MSTPLNDIR = 'MstPlnDir' + DirectorySeparator;
MSTPLNDIR = 'MstPlnDir\'; Windows Only
MSTPLNDIR = 'MstPlnDir' + DirectorySeparator; Unix/Linus

Just to eliminate an anti virus application causing issues, canyou exclude your lazarus folder and your application folder from the Anti Virus Scanner.

My anti virus is Windows Defender. I work behind a Local area network with a firewall of some kind.

If I were to rename the form2 to the lblHdrInfotype, it will appear like your code.
If you have entered text into an object inspector field by error and you realize before you press return or click away; the escape key will put it back; as long as it has not acted upon your changes.

Can you please let us know the OS, lazarus version, FPC version and anything else you think ,might be relevent.
[/color]

FPC 3.0.4         Fresh reload 3 days ago.
Lazarus 1.8.2   Fresh reload 3 days ago.
Intel 7i   Windows 10 Pro w/16 Gig Ram
GForce 1080i w/8 Gig of memory.
1.5 terabyte of disk.



FPC 3.2.0, Lazarus IDE v2.0.4
 Windows 10 Pro 32-GB
 Intel i7 770K CPU 4.2GHz 32702MB Ram
GeForce GTX 1080 Graphics - 8 Gig
4.1 TB

wp

  • Hero Member
  • *****
  • Posts: 11916
Re: Compiler renamed my classes and all procedures
« Reply #32 on: April 03, 2018, 06:25:45 pm »
I am referring to the code posted in reply #20.

Get rid of the "semi-circular" unit reference situation: unit uMain has uParser in its "implementation uses", and uParser has uMain in its "interface uses" at all. Normally this should still compile, but I don't know what cody etc is doing if there's an error. Better to avoid this situation in the first place: You have a general declaration unit, uParser. Move the declaration of TDataRecord from uMain to uUtils uParser, remove uMail from uParser. Checked if the renaming actions still occur.

[EDIT]
Sorry, I meant uUtils instead of uParser for declaration of TDataRecord....
« Last Edit: April 03, 2018, 07:56:40 pm by wp »

JLWest

  • Hero Member
  • *****
  • Posts: 1293
Re: Compiler renamed my classes and all procedures
« Reply #33 on: April 03, 2018, 06:48:36 pm »
@JLWest

Please do these 2 things below and provide us the screenshots of the results of:

1. The programs that run on your Windows startup
Start the Command Prompt > type: msconfig [enter] > click the Startup tab

2. The programs that running on the background
Do Ctrl+Alt+Del > choose: Start Task Manager > click the Processes tab

Note:
Those 2 above are for Win7, things may be a bit different if you're not using Win7.

By providing these info, we can understand that if your computer has some malware, virus, disk tool, or whatever that can cause the problem.

Sent by regular mail. To large to attach.
FPC 3.2.0, Lazarus IDE v2.0.4
 Windows 10 Pro 32-GB
 Intel i7 770K CPU 4.2GHz 32702MB Ram
GeForce GTX 1080 Graphics - 8 Gig
4.1 TB

JLWest

  • Hero Member
  • *****
  • Posts: 1293
Re: Compiler renamed my classes and all procedures
« Reply #34 on: April 03, 2018, 07:04:50 pm »
I am referring to the code posted in reply #20.

Get rid of the "semi-circular" unit reference situation: unit uMain has uParser in its "implementation uses",

Yes I call uParser from uMain in a Modal call passing a record with a filename and path. 

implementation
  uses      uParser; 

As far as I know I have to have this in order to call it Modal and pass the record.

and uParser has uMain in its "interface uses" at all.

Normally this should still compile, but I don't know what cody etc is doing if there's an error. Better to avoid this situation in the first place: You have a general declaration unit, uParser. Move the declaration of TDataRecord from uMain to uParser, remove uMail from uParser. Checked if the renaming actions still occur.

The way it is it compiles and dosn't complain.

I'll make the changes in a test and see if I can still pass the information from uMain to uParser and still pass the required information. ie the file for uParser to open.

What I'm trying to accomplish is the following.

A main form which can call two forms Modal and use a utils unit
 1 form will parse data and use a utils unit
 1 form will setup inifile info.
 
Main form needs to pass a record to uParser and uConfig.
What you suggesting I don't think will accomplish the requirements.
FPC 3.2.0, Lazarus IDE v2.0.4
 Windows 10 Pro 32-GB
 Intel i7 770K CPU 4.2GHz 32702MB Ram
GeForce GTX 1080 Graphics - 8 Gig
4.1 TB

JLWest

  • Hero Member
  • *****
  • Posts: 1293
Re: Compiler renamed my classes and all procedures
« Reply #35 on: April 03, 2018, 07:28:12 pm »
Why should the compiler rewrite the source files? It makes no sense at all. If it's the compiler I pay you a beer.  :)
Now the solution is quite simple, use Process Monitor(Windows Sysinternals) to see what process modifies your file. You will see the killer in action. It will be the IDE not the compiler.

Ok I downloaded it and installed "Process Monitor".

It shows over a million process running and shows them all in a listbox. It has a user manual bigger than Free Pascal.

In 6 months I might be able to use it to monitor the Free pascal or the next space shot by NASA.
FPC 3.2.0, Lazarus IDE v2.0.4
 Windows 10 Pro 32-GB
 Intel i7 770K CPU 4.2GHz 32702MB Ram
GeForce GTX 1080 Graphics - 8 Gig
4.1 TB

balazsszekely

  • Guest
Re: Compiler renamed my classes and all procedures
« Reply #36 on: April 03, 2018, 07:46:33 pm »
@JLWest
Quote
In 6 months I might be able to use it to monitor the Free pascal or the next space shot by NASA.
Really it's not that hard, you have to set some filters, please read this: http://answers.perforce.com/articles/KB/3035

@Handoko
Quote
I rather choose 'real' actions instead
Agree, but I already gave method to find out the exact process which modifying the source files.
« Last Edit: April 03, 2018, 08:51:38 pm by GetMem »

Cyrax

  • Hero Member
  • *****
  • Posts: 836
Re: Compiler renamed my classes and all procedures
« Reply #37 on: April 03, 2018, 08:44:13 pm »
@JLWest

Please do these 2 things below and provide us the screenshots of the results of:

1. The programs that run on your Windows startup
Start the Command Prompt > type: msconfig [enter] > click the Startup tab

2. The programs that running on the background
Do Ctrl+Alt+Del > choose: Start Task Manager > click the Processes tab

Note:
Those 2 above are for Win7, things may be a bit different if you're not using Win7.

By providing these info, we can understand that if your computer has some malware, virus, disk tool, or whatever that can cause the problem.

Sent by regular mail. To large to attach.

You can upload those screenshots to image hosting service like this : https://imgur.com/

JLWest

  • Hero Member
  • *****
  • Posts: 1293
Re: Compiler renamed my classes and all procedures
« Reply #38 on: April 03, 2018, 09:22:23 pm »
@JLWest

Please do these 2 things below and provide us the screenshots of the results of:

1. The programs that run on your Windows startup
Start the Command Prompt > type: msconfig [enter] > click the Startup tab

2. The programs that running on the background
Do Ctrl+Alt+Del > choose: Start Task Manager > click the Processes tab

Note:
Those 2 above are for Win7, things may be a bit different if you're not using Win7.

By providing these info, we can understand that if your computer has some malware, virus, disk tool, or whatever that can cause the problem.

Sent by regular mail. To large to attach.

You can upload those screenshots to image hosting service like this : https://imgur.com/

Do you want me to be running Lazarus at the time I do this and have a program loaded?

  Start Task Manager  > click the  Processes Tab

There are about 8 to ten pages or screens of processes running under Process Tab

Do you want all 8 or 10 screen shots.


 
FPC 3.2.0, Lazarus IDE v2.0.4
 Windows 10 Pro 32-GB
 Intel i7 770K CPU 4.2GHz 32702MB Ram
GeForce GTX 1080 Graphics - 8 Gig
4.1 TB

JLWest

  • Hero Member
  • *****
  • Posts: 1293
Re: Compiler renamed my classes and all procedures
« Reply #39 on: April 03, 2018, 10:40:58 pm »
@JLWest

Please do these 2 things below and provide us the screenshots of the results of:

1. The programs that run on your Windows startup
Start the Command Prompt > type: msconfig [enter] > click the Startup tab

2. The programs that running on the background
Do Ctrl+Alt+Del > choose: Start Task Manager > click the Processes tab

Note:
Those 2 above are for Win7, things may be a bit different if you're not using Win7.

By providing these info, we can understand that if your computer has some malware, virus, disk tool, or whatever that can cause the problem.

Sent by regular mail. To large to attach.

You can upload those screenshots to image hosting service like this : https://imgur.com/

Uploaded the images to iimgur created an album named screenshots under the user name JLWest.
What else do you need?
@JLWest
Quote
In 6 months I might be able to use it to monitor the Free pascal or the next space shot by NASA.
Really it's not that hard, you have to set some filters, please read this: http://answers.perforce.com/articles/KB/3035

@Handoko
Quote
I rather choose 'real' actions instead
Agree, but I already gave method to find out the exact process which modifying the source files.

I got it working and set some filters.
1. Not sure what filters to set:
2. I have it set on the path where my project is F:\AptDotDat

Is there some other filter I need to set?
Maybe on the source code. Is that possible?

It logs a ton of stuff.


FPC 3.2.0, Lazarus IDE v2.0.4
 Windows 10 Pro 32-GB
 Intel i7 770K CPU 4.2GHz 32702MB Ram
GeForce GTX 1080 Graphics - 8 Gig
4.1 TB

 

TinyPortal © 2005-2018