Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2016-10

what is the possible cause of EPrivilege Privileged instruction ?

5 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Dennis

I have a multi threaded program which executes a list of tasks in real time. It is difficult to debug with a debugger on this program (since debugging will pause the execution which will be messy for this application).

So, I log the exceptions to a log file and I found this exception: EPrivilege Privileged instruction

What could possibly raise this exception?

My program is win 32 from Lazarus 1.7 FPC 3.1.1
and running on Win 7 64 bit.

thanks in advance.

Dennis

Reply by email

Tony Whyman
to Dennis

A couple of ideas (no more than this)

1. A corrupt stack has resulted in a function return address being corrupted and the program jumps to an illegal instruction.

2. Executing data (shouldn't really happen).

3. Corrupt VMT sgain resulting in the program jumping to an illegal instruction.

The problem with these type of bugs is that cause and effect can be some way apart. I tend to debug multi-threaded programs that are mis-behaving by having lots of writeln statements and then looking at the output log to see which patterns of behaviour lead to the problem. Can be an art rather than a science.

Dennis wrote 20 lines
I have a multi threaded program which executes a list of tasks in real time. It is difficult to debug with a debugger on this program (since debugging will pause the execution which will be messy for this application). So, I log the exceptions to a log file and I found this exception: EPrivilege Privileged instruction What could possibly raise this exception? My program is win 32 from Lazarus 1.7 FPC 3.1.1 and running on Win 7 64 bit. thanks in advance. Dennis _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply by email

Snorkl e
to Dennis: I have a multi threaded program which executes a list of tasks in real time. It is…

Your not using teventobject in your threads are you? There is a bug in the RTL which could cause weird issues with threads if you are using teventobject.create.

"Dennis" wrote 20 lines
I have a multi threaded program which executes a list of tasks in real time. It is difficult to debug with a debugger on this program (since debugging will pause the execution which will be messy for this application). So, I log the exceptions to a log file and I found this exception: EPrivilege Privileged instruction What could possibly raise this exception? My program is win 32 from Lazarus 1.7 FPC 3.1.1 and running on Win 7 64 bit. thanks in advance. Dennis _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply by email

Dennis Poon
to Snorkl e
Snorkl e wrote 6 lines
Your not using teventobject in your threads are you? There is a bug in the RTL which could cause weird issues with threads if you are using teventobject.create.

I don't use TEventObject (because I don't know how to use it). I have my internal task queue that my worker thread loop through the task queue.
The exception was raised within one of the many tasks in the task queue.

Dennis

Show quoted text 31 lines
On Oct 26, 2016 10:58 AM, "Dennis" < > wrote: I have a multi threaded program which executes a list of tasks in real time. It is difficult to debug with a debugger on this program (since debugging will pause the execution which will be messy for this application). So, I log the exceptions to a log file and I found this exception: EPrivilege Privileged instruction What could possibly raise this exception? My program is win 32 from Lazarus 1.7 FPC 3.1.1 and running on Win 7 64 bit. thanks in advance. Dennis _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal <http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal> _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply by email

Stephen Chrzanowski
to Dennis: I have a multi threaded program which executes a list of tasks in real time. It is…

If you can, change the app so that it'll also output what parameters and calls are being passed in as well. Drop in a debug statement or two on entrance and exit to any and all functions within the thread. Then keep an eye on the logs.

Check this thread on Stack Overflow;

http://stackoverflow.com/questions/89607/what-is-a-privileged-instruction

Dennis wrote 20 lines
I have a multi threaded program which executes a list of tasks in real time. It is difficult to debug with a debugger on this program (since debugging will pause the execution which will be messy for this application). So, I log the exceptions to a log file and I found this exception: EPrivilege Privileged instruction What could possibly raise this exception? My program is win 32 from Lazarus 1.7 FPC 3.1.1 and running on Win 7 64 bit. thanks in advance. Dennis _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply by email