View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0030922 | FPC | Textmode IDE | public | 2016-11-12 21:01 | 2021-01-08 17:33 |
Reporter | alex256 | Assigned To | Florian | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | duplicate | ||
Platform | Linux | OS | Ubuntu | ||
Product Version | 3.0.0 | ||||
Fixed in Version | 3.3.1 | ||||
Summary | 0030922: IDE crash when terminal height is one line | ||||
Description | The IDE crashes when the terminal is only one line height. | ||||
Steps To Reproduce | 1. Open a terminal. 2. Launch fp. 3. Make the terminal height equal to one line. 4. The IDE will crash. | ||||
Tags | No tags attached. | ||||
Fixed in Revision | 48115 | ||||
FPCOldBugId | |||||
FPCTarget | - | ||||
Attached Files |
|
|
|
|
Added screenshot. Bug also in RaspBian. |
|
This bug is the same with http://bugs.freepascal.org/view.php?id=25280 |
|
Just tried building the IDE from trunk, the issue is still present there. |
|
views-division_by_zero.patch (5,218 bytes)
--- packages/fv/src/views.pas.orig 2012-07-12 12:15:20.000000000 +0300 +++ packages/fv/src/views.pas 2019-02-26 06:05:42.828352709 +0200 @@ -824,6 +824,13 @@ staticVar2 : TstatVar2; + FUNCTION AntiZero_1(Z: int64): int64; + BEGIN + if Z=0 then Z:=1; + AntiZero_1:=Z; + END; + + {***************************************************************************} { PRIVATE INTERNAL ROUTINES } {***************************************************************************} @@ -1899,7 +1906,7 @@ PROCEDURE GrowI (Var I: Sw_Integer); BEGIN If (GrowMode AND gfGrowRel = 0) Then Inc(I, D) - Else I := (I * S + (S - D) SHR 1) DIV (S - D); { Calc grow value } + Else I := (I * S + (S - D) SHR 1) DIV AntiZero_1(S - D); { Calc grow value } END; BEGIN @@ -3251,13 +3258,13 @@ End Else I := GetPos; { Get position } If (I <> P) Then Begin SetValue(LongInt((LongInt(I)*(Max-Min)) - +(S SHR 1)) DIV S + Min); { Set new value } + +(S SHR 1)) DIV AntiZero_1(S) + Min);{ Set new value } P := I; { Hold new position } End; Until NOT MouseEvent(Event, evMouseMove); { Until not moving } If Tracking AND (S > 0) Then { Tracking mouse } SetValue(LongInt((LongInt(P)*(Max-Min))+ - (S SHR 1)) DIV S + Min); { Set new value } + (S SHR 1)) DIV AntiZero_1(S) + Min); { Set new value } If (Iv <> Value) Then Clicked; { Scroll has moved } End; ClearEvent(Event); { Clear the event } @@ -3470,7 +3477,7 @@ AVScrollBar^.SetStep(PgStep, ArStep); { Set scroll values } End; If (AHScrollBar <> Nil) Then - AHScrollBar^.SetStep(Size.X DIV NumCols, 1); { Set step size } + AHScrollBar^.SetStep(Size.X DIV AntiZero_1(NumCols), 1);{ Set step size } HScrollBar := AHScrollBar; { Horz scrollbar held } VScrollBar := AVScrollBar; { Vert scrollbar held } END; @@ -3524,7 +3531,7 @@ Color: Word; SCOff: Byte; Text: String; B: TDrawBuffer; BEGIN - ColWidth := Size.X DIV NumCols + 1; { Calc column width } + ColWidth := Size.X DIV AntiZero_1(NumCols) + 1; { Calc column width } If (HScrollBar = Nil) Then Indent := 0 Else { Set indent to zero } Indent := HScrollBar^.Value; { Fetch any indent } For I := 0 To Size.Y - 1 Do Begin { For each line } @@ -3575,10 +3582,10 @@ VScrollBar^.SetValue(Item); { Scrollbar to value } If (Item < TopItem) Then { Item above top item } If (NumCols = 1) Then TopItem := Item { Set top item } - Else TopItem := Item - Item MOD Size.Y { Set top item } + Else TopItem := Item - Item MOD AntiZero_1(Size.Y) { Set top item } Else If (Item >= TopItem + (Size.Y*NumCols)) Then { Item below bottom } If (NumCols = 1) Then TopItem := Item-Size.Y+1 { Set new top item } - Else TopItem := Item - Item MOD Size.Y - + Else TopItem := Item - Item MOD AntiZero_1(Size.Y) - (Size.Y*(NumCols-1)); { Set new top item } END; @@ -3703,7 +3710,7 @@ End; End; evMouseDown: Begin { Mouse down event } - Cw := Size.X DIV NumCols + 1; { Column width } + Cw := Size.X DIV AntiZero_1(NumCols) + 1; { Column width } Oi := Focused; { Hold focused item } MakeLocal(Event.Where, Mouse); { Localize mouse } If MouseInView(Event.Where) Then Ni := Mouse.Y @@ -3730,10 +3737,10 @@ If (Mouse.X >= Size.X) Then { Mouse x above width } Ni := Focused+Size.Y; { Move up 1 column } If (Mouse.Y < 0) Then { Mouse y below zero } - Ni := Focused-Focused MOD Size.Y; { Move up one item } + Ni := Focused-Focused MOD AntiZero_1(Size.Y); { Move up one item } If (Mouse.Y > Size.Y) Then { Mouse y above height } Ni := Focused-Focused MOD - Size.Y+Size.Y-1; { Move down one item } + AntiZero_1(Size.Y)+Size.Y-1; { Move down one item } End; End; End Else Ni := Mouse.Y + (Size.Y*(Mouse.X @@ -3755,7 +3762,7 @@ BEGIN Inherited ChangeBounds(Bounds); { Call ancestor } If (HScrollBar <> Nil) Then { Valid horz scrollbar } - HScrollBar^.SetStep(Size.X DIV NumCols, + HScrollBar^.SetStep(Size.X DIV AntiZero_1(NumCols), HScrollBar^.ArStep); { Update horz bar } If (VScrollBar <> Nil) Then { Valid vert scrollbar } VScrollBar^.SetStep(Size.Y * NumCols, |
|
Nobody fixed. There is patch in attachment. |
|
What? It IS fixed.... In 3.2.0 even, but certainly in trunk. Tested debian stretch and windows, 3.3.1. from today and 3.2.0 RC |
|
Problem still persists on trunk r41522. Crash due to floating point exception. Tested on x64 Linux Ubuntu terminal xterm. |
Date Modified | Username | Field | Change |
---|---|---|---|
2016-11-12 21:01 | alex256 | New Issue | |
2016-11-13 09:01 | Thaddy de Koning | File Added: Selection_027.png | |
2016-11-13 09:02 | Thaddy de Koning | Note Added: 0095816 | |
2018-12-19 03:43 | AlexL | Note Added: 0112679 | |
2018-12-19 22:44 | Marco van de Voort | Relationship added | duplicate of 0025280 |
2019-01-02 00:55 | Florian | Status | new => resolved |
2019-01-02 00:55 | Florian | Resolution | open => duplicate |
2019-01-02 00:55 | Florian | Assigned To | => Florian |
2019-02-11 15:17 | alex256 | Note Added: 0114037 | |
2019-02-11 15:17 | alex256 | Status | resolved => feedback |
2019-02-11 15:17 | alex256 | Resolution | duplicate => reopened |
2019-02-28 05:10 | AlexL | File Added: views-division_by_zero.patch | |
2019-02-28 05:11 | AlexL | Note Added: 0114497 | |
2019-02-28 10:09 | Thaddy de Koning | Note Added: 0114498 | |
2019-02-28 10:10 | Thaddy de Koning | Note Edited: 0114498 | View Revisions |
2019-02-28 14:59 | Marģers | Note Added: 0114501 | |
2021-01-08 16:07 | Florian | Note View State: 0114497: private | |
2021-01-08 16:07 | Florian | Note View State: 0114497: public | |
2021-01-08 17:33 | Florian | Status | feedback => resolved |
2021-01-08 17:33 | Florian | Resolution | reopened => duplicate |
2021-01-08 17:33 | Florian | Fixed in Version | => 3.3.1 |
2021-01-08 17:33 | Florian | Fixed in Revision | => 48115 |
2021-01-08 17:33 | Florian | FPCTarget | => - |