View Issue Details

IDProjectCategoryView StatusLast Update
0032785PatchesConverterpublic2017-12-07 16:08
ReporterTiml Assigned ToJuha Manninen  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformx86OSLinux 
Product Version1.8 
Summary0032785: Crash converting a file
DescriptionSegmentation fault when converting a file
TagsNo tags attached.
Fixed in Revisionr56660
LazTarget-
WidgetsetGTK 2
Attached Files

Activities

Timl

2017-12-06 07:40

reporter  

converter.diff (461 bytes)   
Index: converter/usedunits.pas
===================================================================
--- converter/usedunits.pas	(working copy)
+++ converter/usedunits.pas	(revision 56652)
@@ -464,7 +464,6 @@
   i, x: Integer;
 begin
   for i:=fMissingUnits.Count-1 downto 0 do begin
-    if assigned( ACommentedUnits ) then
     if ACommentedUnits.Find(fMissingUnits[i], x) then begin
       fUnitsToComment.Add(fMissingUnits[i]);
       fMissingUnits.Delete(i);
converter.diff (461 bytes)   

wp

2017-12-06 11:41

developer   ~0104516

If I am not completely wrong your patch removes the line "if assigned(ACommentedUnit) then". But looking at current and older source I never see this line.

It would make sense to add it to prevent a seg fault.

But beyond that: what are you doing? Yes, trying to "convert a file". But: which file? How? What do I have to do to see the error?

Juha Manninen

2017-12-06 12:32

developer   ~0104524

Indeed!
---
$ patch -p0 < ~/patch/converter.diff
patching file converter/usedunits.pas
patch unexpectedly ends in middle of line
Reversed (or previously applied) patch detected! Assume -R? [n]
Apply anyway? [n]
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file converter/usedunits.pas.rej
---

Juha Manninen

2017-12-07 16:08

developer   ~0104570

Ok, after realizing the patch was inverted I analysed the code and yes, ACommentedUnits can be Nil when converting a single unit.
It is created for project and package conversion.
I added the Assigned() test as suggested. Thanks.

I wonder why it has not shown up in my tests. I have tested project conversion more that unit conversion but still...

Issue History

Date Modified Username Field Change
2017-12-06 07:40 Timl New Issue
2017-12-06 07:40 Timl File Added: converter.diff
2017-12-06 11:41 wp Note Added: 0104516
2017-12-06 12:32 Juha Manninen Note Added: 0104524
2017-12-07 15:48 Juha Manninen Assigned To => Juha Manninen
2017-12-07 15:48 Juha Manninen Status new => assigned
2017-12-07 16:08 Juha Manninen Fixed in Revision => r56660
2017-12-07 16:08 Juha Manninen LazTarget => -
2017-12-07 16:08 Juha Manninen Note Added: 0104570
2017-12-07 16:08 Juha Manninen Status assigned => resolved
2017-12-07 16:08 Juha Manninen Resolution open => fixed