Sign in Join

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

Mailing lists / fpc-pascal / 2003-08

EACCESSVIOLATION

4 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Rudolf Harney

Hi!
Is there anybody? (The archive stops on May, 7th ...) I am new to the list - so tell me, if this is the wrong place for my questions. I wrote a freePascal program under Linux (Free Pascal Compiler version 1.0.10 [2003/06/26] for i386), which reads information from serial ports and sends information to serial ports and does some calculations. There are no pointers, involved. After the program had run successfully for 15 hours, it terminated with the following error message.
An unhandled exception occurred at 0x08051DC3 :
EACCESSVIOLATION : Access violation
0x08051DC3
0x0806ABC0
0x080522D8
0x080524B8
0x08052DE0
0x0806F98B
0x08130A84
0xF2B3E800

Any idea, what that means?
Thanks!
RUDOLF

Rudolf Harney __________________________________________________________________________ Die sicherste Form der Kommunikation: E-Mails verschluesseln, Spam-Filter, Adressverifizierung, digitale Unterschrift: http://freemail.web.de

Reply by email

Marco van de Voort
to Rudolf Harney
Show quoted text 20 lines
Is there anybody? (The archive stops on May, 7th ...) I am new to the list - so tell me, if this is the wrong place for my questions. I wrote a freePascal program under Linux (Free Pascal Compiler version 1.0.10 [2003/06/26] for i386), which reads information from serial ports and sends information to serial ports and does some calculations. There are no pointers, involved. After the program had run successfully for 15 hours, it terminated with the following error message. An unhandled exception occurred at 0x08051DC3 : EACCESSVIOLATION : Access violation 0x08051DC3 0x0806ABC0 0x080522D8 0x080524B8 0x08052DE0 0x0806F98B 0x08130A84 0xF2B3E800 Any idea, what that means?

Access violation. Do you use IOPERM to get access to the ports?

If not, look up ioperm in the manual (under the "linux" unit)

Reply by email

Rudolf Harney

Thank You, Marco, for Your immidiate response!

Show quoted text 20 lines
>I wrote a freePascal program under Linux (Free Pascal Compiler > version 1.0.10 [2003/06/26] for i386), which reads information from serial > ports and sends information to serial ports and does some calculations. > There are no pointers, involved. After the program had run successfully > for 15 hours, it terminated with the following error message. An > unhandled exception occurred at 0x08051DC3 : EACCESSVIOLATION : Access > violation > 0x08051DC3 > 0x0806ABC0 > 0x080522D8 > 0x080524B8 > 0x08052DE0 > 0x0806F98B > 0x08130A84 > 0xF2B3E800 > Any idea, what that means? Access violation. Do you use IOPERM to get access to the ports? If not, look up ioperm in the manual (under the "linux" unit)

No, I don't use ioperm - and I fear, I don't really understand the description in the manual. But it says there, the program has to be run by root - and I am not happy with that: I don't want to give root privileges to my measurement programs ... .
For port access, I use a routine, that was originally written by Brad Campbell (I got it with one of the older freepascal versions), see below. Is there a reason, better to use IOPerm, ReadPort and WritePort procedures, as stated in the manual? Or is thre just a bug in my port-reading-routine? The error occured (very probably), wile the following routine was in action:

function SerialPort_obj.GetLine(Port : String; BaudRate : LongInt; DataBits : Byte; Parity : Char; StopBits: Byte; FlowControl : String; var TheLine : String) : ShortInt; {Given : - sensorPort, a string with the portname, e.g. '/dev/ttyS1'
- BaudRate, e.g. 9600, compare list of possible values in function SetParameters
- DataBits : 5, 6, 7 or 8
- Parity : 'e', 'o' or 'n' (even, odd or none)
- StopBits : 1 or 2
- FlowControl : 'none' or 'RTSCTS' (Hardware)
- Outstring : String to write to serial port
Task : read line of input from port, referenced by Fd and return it Return : The line of input from Fd.
0 if o.k.
-1 if error occured
}

var
InStr : String[80];
ResStr : String[80];
Quit : Boolean;
InLen, Loop : Integer;
FDs : FDSet;
Is_Error : ShortInt;
Fd : F_Handle;
begin
Is_Error := 0;
ResStr := '';
Quit := False;
Fd := RS232Open(Port); {open port}
if Fd > 0 then Begin
{set the port parameters:}
SetParameters(Fd,BaudRate,DataBits,StopBits,Parity,FlowControl);

FD_Zero (FDs); {Clear File Descriptors Array}
FD_SET (Fd,FDs); {Input from Serial Port}

Repeat { line of input }
Select(Fd+1,@FDS,nil,nil, nil);
If FD_ISSET(Fd,FDS) then {Have we data waiting in UART ? }
Begin
InLen := fdRead(Fd,InStr[1],80);
If InLen > 0 then
For Loop := 1 to Inlen do begin
if ord(InStr[Loop])=13 then quit:=true; {line ended with LF}
if not quit then ResStr := ResStr + InStr[Loop];
end;
end
else begin
writeLn('fatal error in getLine: no line of input from port!');
quit := true;
Is_Error := -1;
end;
Until quit; {Were Outa Here}
FLock(Fd,LOCK_UN); {Unlock Port}
fdClose(Fd); {Close Port}
end { if Fd > 0 }
else begin
writeLn('error, opening port ', port);
quit := true;
Is_error := -1;
end;
TheLine := ResStr;
GetLine := Is_Error;
end;{function GetLine}

(I'm not a very experienced programmer, so forgive me bad style, if there is ...). Thanks for hints ... RUDOLF

Rudolf Harney __________________________________________________________________________ Die sicherste Form der Kommunikation: E-Mails verschluesseln, Spam-Filter, Adressverifizierung, digitale Unterschrift: http://freemail.web.de

Reply by email

Peter Vreman
to Rudolf Harney
Show quoted text 26 lines
Thank You, Marco, for Your immidiate response! > >I wrote a freePascal program under Linux (Free Pascal Compiler > > version 1.0.10 [2003/06/26] for i386), which reads information from > serial > > ports and sends information to serial ports and does some > calculations. > > There are no pointers, involved. After the program had run > successfully > > for 15 hours, it terminated with the following error message. An > > unhandled exception occurred at 0x08051DC3 : EACCESSVIOLATION : Access > > violation > > 0x08051DC3 > > 0x0806ABC0 > > 0x080522D8 > > 0x080524B8 > > 0x08052DE0 > > 0x0806F98B > > 0x08130A84 > > 0xF2B3E800 > > > Any idea, what that means? > > Access violation. Do you use IOPERM to get access to the ports? > If not, look up ioperm in the manual (under the "linux" unit) No, I don't use ioperm - and I fear, I don't really understand the description in the manual. But it says there, the

Compile using -gl that will add file information and line numbers to the stack dump.

You can also run the program under gdb and ask for backtrace

Reply by email