External SIGFPE in CPortLazerus

Für Fragen von Einsteigern und Programmieranfängern...
Antworten
delphifant
Beiträge: 6
Registriert: Mo 27. Jul 2009, 07:48

External SIGFPE in CPortLazerus

Beitrag von delphifant »

Hallo, ich schreib ins dieses Forum da ich Neuling mit Lazarus bin und hoffe hier ein Problem gelöst zu bekommen.

Da ich mal wieder versuche über die die serielle Schnittstelle zu komunizieren (Win32) hab ich mir das Package CPortLazarus installier und aktiviert. Bei der Einbindung des Package in Lazarus verlief fehlerfrei. Doch nun beim create meines Programmes kommt die Fehlermeldung: exception class "External SIGFPE "

Die Funktion sieht wie folgt aus:

Code: Alles auswählen

 procedure TCustomComTerminal.Paint;
var
  ARect: TRect;
begin
  Canvas.Font := Font;
  Canvas.Brush.Color := Color;
  if csDesigning in ComponentState then
    PaintDesign
  else
  begin
    MoveCaret(FCaretPos.X, FCaretPos.Y);
    // don't paint whole screen, but only the invalidated portion
    if (FFontWidth +1) > 0 then
     ARect.Left := Canvas.ClipRect.Left div FFontWidth + 1
    else
     ARect.Left := 0;
 
    ARect.Right := Min(Canvas.ClipRect.Right div FFontWidth + 1, FColumns);
    ARect.Top := Canvas.ClipRect.Top div FFontHeight + 1;
    ARect.Bottom := Min(Canvas.ClipRect.Bottom div FFontHeight + 1, FRows);
    PaintTerminal(ARect);
  end;
end;


Auch bei dem Versuch mit try..except kein erfolg und auch die Prüfung bei der Div=0 kein Fehler.

Bei der Stackprüfung zeigte sich folgendes:



Auszug aus Stack:

#0 TCUSTOMCOMTERMINAL__PAINT(0x1819508) at CPortCtl.pas:1895
#1 TCUSTOMCONTROL__PAINTWINDOW(436277481, 0x1819508) at customcontrol.inc:127
#2 TWINCONTROL__PAINTHANDLER({MSG = 66592, DC = 436277481, PAINTSTRUCT = 0x6f968, RESULT = 457128}, 0x1819508) at wincontrol.inc:4239
#3 TWINCONTROL__WMPAINT({MSG = 66592, DC = 436277481, PAINTSTRUCT = 0x6f968, RESULT = 457128}, 0x1819508) at wincontrol.inc:6062
#4 TCUSTOMCONTROL__WMPAINT({MSG = 66592, DC = 436277481, PAINTSTRUCT = 0x6f968, RESULT = 457128}, 0x1819508) at customcontrol.inc:107
#5 SYSTEM_TOBJECT_$__DISPATCH$formal at :0
#6 TCUSTOMCONTROL__SETCOLOR(457048, 0x1819508) at customcontrol.inc:94
#7 TWINCONTROL__WNDPROC({MSG = 66592, WPARAM = 436277481, LPARAM = 457064, RESULT = 457128, WPARAMLO = 4329, WPARAMHI = 6657, LPARAMLO = 63848, LPARAMHI = 6, RESULTLO = 63912, RESULTHI = 6}, 0x1819508) at wincontrol.inc:4749
#8 DELIVERMESSAGE(0x1819508, void) at lclmessageglue.pas:103
#9 SENDPAINTMESSAGE(0, 0x6fba0) at win32callback.inc:540
#10 WINDOWPROC(132910, 15, 0, 0) at win32callback.inc:2016
#11 USER32!GetDC at :0
#12 ?? at :0
#13 ?? at :0
#14 ?? at :0

Was mach ich falsch oder was läuft hier falsch :cry:

Danke

delphifant

Benutzeravatar
theo
Beiträge: 10497
Registriert: Mo 11. Sep 2006, 19:01

Re: External SIGFPE in CPortLazerus

Beitrag von theo »

Was passiert, wenn du überall FFontWidth + 1 in Klammern setzt?
.. div (FFontWidth + 1)

Das gleiche mit (FFontHeight + 1)

delphifant
Beiträge: 6
Registriert: Mo 27. Jul 2009, 07:48

Re: External SIGFPE in CPortLazerus

Beitrag von delphifant »

Ich glaube ich weiß worauf die hin willst. Ich habe FFontHeigth und FFontwidth initalisiert und "Create" funktioniert.

Danke...

Verstehe ich richtig das SIPFPE eine NullDivision-Fehlermeldung ist???

Nun tritt aber ein neues Problem auf:

Beim Aufruf des ComPort-Dialog erscheint nun die Fehlermeldung: External SIGSEGV...

Code: Alles auswählen

procedure TComComboBox.SetComPort(const Value: TCustomComPort);
begin
 
  if FComSelect.ComPort <> Value then
  begin
    FComSelect.ComPort := Value;
    if FComSelect.ComPort <> nil then
    begin
      FComSelect.ComPort.FreeNotification(Self);
      // transfer settings from ComPort to this control
      UpdateSettings;
    end;
  end;
end;


Der Stack sagt folgendes:
#0 TCOMCOMBOBOX__SETCOMPORT(0x16f9a0, 0x0) at CPortCtl.pas:805
#1 EDITCOMPORT(0x16f9a0) at CPortSetup.pas:68
#2 TCUSTOMCOMPORT__SHOWSETUPDIALOG(0x16f9a0) at CPort.pas:2006
#3 TFORM1__BUTTON1CLICK(0x1819508, 0x18190c8) at umain.pas:35
#4 TCONTROL__CLICK(0x1819508) at control.inc:2094
#5 TBUTTONCONTROL__CLICK(0x1819508) at buttoncontrol.inc:52
#6 TCUSTOMBUTTON__CLICK(0x1819508) at buttons.inc:185
#7 TBUTTON__CLICK(0x1819508) at buttons.inc:329
#8 TCUSTOMBUTTON__WMDEFAULTCLICKED({MSG = 66567, WPARAM = 5240720, LPARAM = -591746099, RESULT = 0, WPARAMLO = 63376, WPARAMHI = 79, LPARAMLO = 43981, LPARAMHI = 56506, RESULTLO = 0, RESULTHI = 0}, 0x1819508) at buttons.inc:240
#9 SYSTEM_TOBJECT_$__DISPATCH$formal at :0
#10 TCUSTOMBUTTON__CMUIACTIVATE({MSG = 66567, WPARAM = 5240720, LPARAM = -591746099, RESULT = 0, WPARAMLO = 63376, WPARAMHI = 79, LPARAMLO = 43981, LPARAMHI = 56506, RESULTLO = 0, RESULTHI = 0}, 0x1819508) at buttons.inc:229
#11 TWINCONTROL__WNDPROC({MSG = 66567, WPARAM = 5240720, LPARAM = -591746099, RESULT = 0, WPARAMLO = 63376, WPARAMHI = 79, LPARAMLO = 43981, LPARAMHI = 56506, RESULTLO = 0, RESULTHI = 0}, 0x1819508) at wincontrol.inc:4749
#12 DELIVERMESSAGE(0x1819508, void) at lclmessageglue.pas:103
#13 WINDOWPROC(9700876, 273, 38152, 10028712) at win32callback.inc:2410
#14 USER32!GetDC at :0
#15 ?? at :0
#16 ?? at :0
#17 ?? at :0
#18 ?? at :0
#19 GETNEEDPARENTPAINT(0x4ff790, 0x6f7d4) at win32callback.inc:204
#20 USER32!GetDC at :0
#21 GETNEEDPARENTPAINT(0x0, 0x7e368830) at win32callback.inc:204
#22 USER32!GetParent at :0
#23 ?? at :0

Bei dem Versuch mit :

Code: Alles auswählen

if FComSelect<>nil then {bzw assigned()};
 showmessage('COMPORT lebt') ;

stoppt die IDE bei dieser Zeile, jedoch ist FComSelect inizilaisiert???

pluto
Lazarusforum e. V.
Beiträge: 7178
Registriert: So 19. Nov 2006, 12:06
OS, Lazarus, FPC: Linux Mint 19.3
CPU-Target: AMD
Wohnort: Oldenburg(Oldenburg)

Re: External SIGFPE in CPortLazerus

Beitrag von pluto »

Verstehe ich richtig das SIPFPE eine NullDivision-Fehlermeldung ist???

Eigentlich sollte eine entsprechende Fehler Meldung kommen. Und nicht sowas wie bei dir....
MFG
Michael Springwald

Antworten