View Issue Details

IDProjectCategoryView StatusLast Update
0036173FPCPackagespublic2019-10-19 14:15
ReporterIoulianos KakoulidisAssigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Product Version3.0.4Product Build 
Target VersionFixed in Version 
Summary0036173: PTCGRAPH InitGraph call generates exception in Debug mode
DescriptionFollowing code generates exception on InitGraph call in Debug mode. See - except.JPG in attachment.
After pressing "Break" button - see break_assm.JPG
After pressing "Continue" button program generates expected output and terminates with error - see continue_heaptrc.JPG
Release mode works as expected.
Same behavoir on Wondows 8 64 bit FPC 3.0.4 / Lazarus 2.0.0.

program tgraph;
{$mode tp}

uses
  PTCGRAPH,
  PTCCRT;

var
  grmode, grdriver: smallint;
  x, y: integer;
  ch: Char;
begin
  grdriver := DETECT;
  PTCGRAPH.InitGraph(grdriver, grmode, '');
  PTCGRAPH.SetColor(white);
  ch := PTCCRT.ReadKey;
  PTCGRAPH.Line(0, 00, getmaxx, getmaxy);
  ch := PTCCRT.ReadKey;
end.

Additional InformationFPC - 3.0.4
Lazarus - 2.0.0
OS - Windows Vista 32bit SP1
CPU - Intel Pentium Dual E2200
GPU - GPU - Intel Q33 Express
RAM - 3GB

TagsNo tags attached.
Fixed in Revision
FPCOldBugId
FPCTarget
Attached Files

Activities

Ioulianos Kakoulidis

2019-10-13 12:14

reporter  

tgraph.lpr (333 bytes)
break_assm.JPG (143,588 bytes)
break_assm.JPG (143,588 bytes)
continue_heaptrc.JPG (33,588 bytes)
continue_heaptrc.JPG (33,588 bytes)
except.JPG (24,256 bytes)
except.JPG (24,256 bytes)
tgraph.lpi (4,042 bytes)

Ioulianos Kakoulidis

2019-10-15 09:23

reporter   ~0118614

Exception occurs here - file fpc\3.0.4\source\packages\ptc\src\win32\directx\win32directxconsolei.inc
procedure TDirectXConsole.internal_recycle(const _title: string; window: HWND; const mode: IPTCMode; _pages: Integer; exact: Boolean);
begin
  { Check if the console is open }
  if not FOpen then
    raise TPTCError.Create('cannot recycle because it is not already open');
...

Ioulianos Kakoulidis

2019-10-17 09:13

reporter   ~0118638

Backtrace -

#0 fpc_raiseexception at :0
0000001 PTC$_$TDIRECTXCONSOLE_$__$$_INTERNAL_RECYCLE$ANSISTRING$QWORD$IPTCMODE$LONGINT$BOOLEAN at :0
0000002 PTC$_$TDIRECTXCONSOLE_$__$$_INTERNAL_OPEN$ANSISTRING$QWORD$IPTCMODE$LONGINT$BOOLEAN at :0
0000003 PTC$_$TDIRECTXCONSOLE_$__$$_OPEN$ANSISTRING$LONGINT$LONGINT$IPTCFORMAT$LONGINT at :0
0000004 _$PTC$_Lj22270 at :0
0000005 ?? at :0
0000006 ?? at :0

Ioulianos Kakoulidis

2019-10-19 13:32

reporter   ~0118688

Maybe-this is normal behavior. If Yes - please delete issue.

Thaddy de Koning

2019-10-19 14:01

reporter   ~0118689

Last edited: 2019-10-19 14:03

View 2 revisions

You should study the examples in the PTC package directory: there are many.
At least on Debian-armhf all examples work. There must be something wrong with your code.

That goes for debug mode too: no difference.

Ioulianos Kakoulidis

2019-10-19 14:15

reporter   ~0118691

No problem. Delete issue.

Issue History

Date Modified Username Field Change
2019-10-13 12:14 Ioulianos Kakoulidis New Issue
2019-10-13 12:14 Ioulianos Kakoulidis File Added: tgraph.lpr
2019-10-13 12:14 Ioulianos Kakoulidis File Added: break_assm.JPG
2019-10-13 12:14 Ioulianos Kakoulidis File Added: continue_heaptrc.JPG
2019-10-13 12:14 Ioulianos Kakoulidis File Added: except.JPG
2019-10-13 12:14 Ioulianos Kakoulidis File Added: tgraph.lpi
2019-10-15 09:23 Ioulianos Kakoulidis Note Added: 0118614
2019-10-17 09:13 Ioulianos Kakoulidis Note Added: 0118638
2019-10-19 13:32 Ioulianos Kakoulidis Note Added: 0118688
2019-10-19 14:01 Thaddy de Koning Note Added: 0118689
2019-10-19 14:03 Thaddy de Koning Note Edited: 0118689 View Revisions
2019-10-19 14:15 Ioulianos Kakoulidis Note Added: 0118691