View Issue Details

IDProjectCategoryView StatusLast Update
0036365FPCTextmode IDEpublic2020-01-24 08:42
ReporterMarģersAssigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
Status newResolutionopen 
Platformx86_64OSlinuxOS Version.
Product VersionProduct Build 
Target VersionFixed in Version 
Summary0036365: sigseg error no resize screen
Descriptionexiting from full screen mode when in user output mode make sigseg error in IDE
Steps To Reproduce1. use xterm in full screen mode
2. run any console program
3. on message "Press any key to return to IDE" press Alt-Enter
4. press any key. Enjoy SIGSEG error. Close terminal window.
Tagspatch
Fixed in Revision
FPCOldBugId
FPCTarget
Attached Files
  • ideresize.patch (1,362 bytes)
    Index: packages/ide/fpide.pas
    ===================================================================
    --- packages/ide/fpide.pas	(revision 44007)
    +++ packages/ide/fpide.pas	(working copy)
    @@ -1451,6 +1451,7 @@
     
     
     procedure TIDEApp.ShowIDEScreen;
    +var oldH,oldW : byte;
     begin
       if Assigned(UserScreen) then
         UserScreen^.SaveConsoleScreen;
    @@ -1460,6 +1461,8 @@
         InitMouse
       else
         ButtonCount:=0;
    +  oldH:=ScreenHeight;
    +  oldW:=ScreenWidth;
     {$ifndef go32v2}
       initvideo;
     {$endif ndef go32v2}
    @@ -1474,7 +1477,13 @@
       InitSysError;
       CurDirChanged;
     {$ifndef Windows}
    -  Message(Application,evBroadcast,cmUpdate,nil);
    +  if (oldH<>ScreenHeight) or (oldW<>ScreenWidth) then
    +  begin
    +    { acknowledge new screen dimensions } 
    +    { prevents to draw out of boundaries of new video buffer }
    +    ResizeApplication(ScreenWidth, ScreenHeight);
    +  end else
    +    Message(Application,evBroadcast,cmUpdate,nil);
     {$endif Windows}
     {$ifdef Windows}
       // WindowsShowMouse;
    @@ -1481,7 +1490,8 @@
     {$endif Windows}
     
       if Assigned(UserScreen) then
    -    UserScreen^.SwitchBackToIDEScreen;
    +    if (oldH = ScreenHeight) and (oldW = ScreenWidth) then
    +      UserScreen^.SwitchBackToIDEScreen;
     {$ifdef Windows}
       { This message was sent when the VideoBuffer was smaller
         than was the IdeApp thought => writes to random memory and random crashes... PM }
    
    ideresize.patch (1,362 bytes)
  • ideresize_v2.patch (1,388 bytes)
    Index: packages/ide/fpide.pas
    ===================================================================
    --- packages/ide/fpide.pas	(revision 44007)
    +++ packages/ide/fpide.pas	(working copy)
    @@ -1451,6 +1451,7 @@
     
     
     procedure TIDEApp.ShowIDEScreen;
    +var oldH,oldW : byte;
     begin
       if Assigned(UserScreen) then
         UserScreen^.SaveConsoleScreen;
    @@ -1460,6 +1461,8 @@
         InitMouse
       else
         ButtonCount:=0;
    +  oldH:=ScreenHeight;
    +  oldW:=ScreenWidth;
     {$ifndef go32v2}
       initvideo;
     {$endif ndef go32v2}
    @@ -1474,7 +1477,13 @@
       InitSysError;
       CurDirChanged;
     {$ifndef Windows}
    -  Message(Application,evBroadcast,cmUpdate,nil);
    +  if (oldH<>ScreenHeight) or (oldW<>ScreenWidth) then
    +  begin
    +    { acknowledge new screen dimensions } 
    +    { prevents to draw out of boundaries of new video buffer }
    +    ResizeApplication(ScreenWidth,ScreenHeight);
    +  end else
    +    Message(Application,evBroadcast,cmUpdate,nil);
     {$endif Windows}
     {$ifdef Windows}
       // WindowsShowMouse;
    @@ -1481,7 +1490,10 @@
     {$endif Windows}
     
       if Assigned(UserScreen) then
    -    UserScreen^.SwitchBackToIDEScreen;
    +{$ifdef unix}
    +    if (oldH=ScreenHeight) and (oldW=ScreenWidth) then
    +{$endif unix}
    +      UserScreen^.SwitchBackToIDEScreen;
     {$ifdef Windows}
       { This message was sent when the VideoBuffer was smaller
         than was the IdeApp thought => writes to random memory and random crashes... PM }
    
    ideresize_v2.patch (1,388 bytes)

Activities

Marģers

2019-11-27 01:31

reporter  

Marģers

2020-01-21 01:58

reporter  

ideresize.patch (1,362 bytes)
Index: packages/ide/fpide.pas
===================================================================
--- packages/ide/fpide.pas	(revision 44007)
+++ packages/ide/fpide.pas	(working copy)
@@ -1451,6 +1451,7 @@
 
 
 procedure TIDEApp.ShowIDEScreen;
+var oldH,oldW : byte;
 begin
   if Assigned(UserScreen) then
     UserScreen^.SaveConsoleScreen;
@@ -1460,6 +1461,8 @@
     InitMouse
   else
     ButtonCount:=0;
+  oldH:=ScreenHeight;
+  oldW:=ScreenWidth;
 {$ifndef go32v2}
   initvideo;
 {$endif ndef go32v2}
@@ -1474,7 +1477,13 @@
   InitSysError;
   CurDirChanged;
 {$ifndef Windows}
-  Message(Application,evBroadcast,cmUpdate,nil);
+  if (oldH<>ScreenHeight) or (oldW<>ScreenWidth) then
+  begin
+    { acknowledge new screen dimensions } 
+    { prevents to draw out of boundaries of new video buffer }
+    ResizeApplication(ScreenWidth, ScreenHeight);
+  end else
+    Message(Application,evBroadcast,cmUpdate,nil);
 {$endif Windows}
 {$ifdef Windows}
   // WindowsShowMouse;
@@ -1481,7 +1490,8 @@
 {$endif Windows}
 
   if Assigned(UserScreen) then
-    UserScreen^.SwitchBackToIDEScreen;
+    if (oldH = ScreenHeight) and (oldW = ScreenWidth) then
+      UserScreen^.SwitchBackToIDEScreen;
 {$ifdef Windows}
   { This message was sent when the VideoBuffer was smaller
     than was the IdeApp thought => writes to random memory and random crashes... PM }
ideresize.patch (1,362 bytes)

Marģers

2020-01-24 08:41

reporter   ~0120697

Updated patch. Make sure, changes does not affect other than unix like targets.

ideresize_v2.patch (1,388 bytes)
Index: packages/ide/fpide.pas
===================================================================
--- packages/ide/fpide.pas	(revision 44007)
+++ packages/ide/fpide.pas	(working copy)
@@ -1451,6 +1451,7 @@
 
 
 procedure TIDEApp.ShowIDEScreen;
+var oldH,oldW : byte;
 begin
   if Assigned(UserScreen) then
     UserScreen^.SaveConsoleScreen;
@@ -1460,6 +1461,8 @@
     InitMouse
   else
     ButtonCount:=0;
+  oldH:=ScreenHeight;
+  oldW:=ScreenWidth;
 {$ifndef go32v2}
   initvideo;
 {$endif ndef go32v2}
@@ -1474,7 +1477,13 @@
   InitSysError;
   CurDirChanged;
 {$ifndef Windows}
-  Message(Application,evBroadcast,cmUpdate,nil);
+  if (oldH<>ScreenHeight) or (oldW<>ScreenWidth) then
+  begin
+    { acknowledge new screen dimensions } 
+    { prevents to draw out of boundaries of new video buffer }
+    ResizeApplication(ScreenWidth,ScreenHeight);
+  end else
+    Message(Application,evBroadcast,cmUpdate,nil);
 {$endif Windows}
 {$ifdef Windows}
   // WindowsShowMouse;
@@ -1481,7 +1490,10 @@
 {$endif Windows}
 
   if Assigned(UserScreen) then
-    UserScreen^.SwitchBackToIDEScreen;
+{$ifdef unix}
+    if (oldH=ScreenHeight) and (oldW=ScreenWidth) then
+{$endif unix}
+      UserScreen^.SwitchBackToIDEScreen;
 {$ifdef Windows}
   { This message was sent when the VideoBuffer was smaller
     than was the IdeApp thought => writes to random memory and random crashes... PM }
ideresize_v2.patch (1,388 bytes)

Issue History

Date Modified Username Field Change
2019-11-27 01:31 Marģers New Issue
2019-11-27 01:31 Marģers File Added: Screenshot_2019-11-27_02-10-12.png
2020-01-21 01:58 Marģers File Added: ideresize.patch
2020-01-24 08:41 Marģers File Added: ideresize_v2.patch
2020-01-24 08:41 Marģers Note Added: 0120697
2020-01-24 08:42 Marģers Tag Attached: patch