View Issue Details

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



2017-12-06 06:40


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;
   for i:=fMissingUnits.Count-1 downto 0 do begin
-    if assigned( ACommentedUnits ) then
     if ACommentedUnits.Find(fMissingUnits[i], x) then begin
converter.diff (461 bytes)   


2017-12-06 10: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 11:32

developer   ~0104524

$ 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 15: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 06:40 Timl New Issue
2017-12-06 06:40 Timl File Added: converter.diff
2017-12-06 10:41 wp Note Added: 0104516
2017-12-06 11:32 Juha Manninen Note Added: 0104524
2017-12-07 14:48 Juha Manninen Assigned To => Juha Manninen
2017-12-07 14:48 Juha Manninen Status new => assigned
2017-12-07 15:08 Juha Manninen Fixed in Revision => r56660
2017-12-07 15:08 Juha Manninen LazTarget => -
2017-12-07 15:08 Juha Manninen Note Added: 0104570
2017-12-07 15:08 Juha Manninen Status assigned => resolved
2017-12-07 15:08 Juha Manninen Resolution open => fixed