Bug 89914 - seg fault analyzing programs compiled with gnu pascal 20011222
Summary: seg fault analyzing programs compiled with gnu pascal 20011222
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: memcheck (show other bugs)
Version: 2.2.0
Platform: Unlisted Binaries Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-20 23:39 UTC by Patrick Timlick
Modified: 2012-08-10 13:38 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Patch to dix parsing of d descriptor in stabs (537 bytes, patch)
2005-07-19 19:57 UTC, Tom Hughes
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Timlick 2004-09-20 23:39:41 UTC
>gpc --version
20011222, based on gcc-2.95.3 20010315 (release)
>gpc -g  head.pas
>cat head.pas
Program Head;  (* No "Output" specification needed. *)

begin
  writeln ( 'OK' );
end.
>valgrind --tool=memcheck ./a.out
==4451== Memcheck, a memory error detector for x86-linux.
==4451== Copyright (C) 2002-2004, and GNU GPL'd, by Julian Seward et al.
==4451== Using valgrind-2.2.0, a program supervision framework for x86-linux.
==4451== Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward et al.
 @@ unlikely looking definition in unparsed remains ";"

 @@ expected ',' at struct TYPE (remains=",0,8;Timevalid:(0,23),8,8;Year:(0,1),
32,32;Month:(0,24)=r(0,1);0000000000001;0000000000014;,64,32;Day:(0,25)=r(0,1);
0000000000001;0000000000037;,96,32;Dayofweek:(0,26)=r(0,1);0000000000000;
0000000000006;,128,32;Hour:(0,27)=r(0,1);0000000000000;0000000000027;,160,32;
Minute:(0,28)=r(0,1);0000000000000;0000000000073;,192,32;Second:(0,29)=r(0,1);
0000000000000;0000000000075;,224,32;Microsecond:(0,30)=r(0,1);0000000000000;
0000003641077;,256,32;Timezone:(0,1),288,32;Dst:(0,23),320,8;Tzname1:(0,31)
=s44Capacity:(0,4),0,32;length:(0,4),32,32;_p_schema_:(0,32)=@s264;@S;S(0,33)
=r(0,1);0000000000001;0000000000041;,64,264;;,352,352;Tzname2:(0,34)
=s44Capacity:(0,4),0,32;length:(0,4),32,32;_p_schema_:(0,35)=@s264;@S;S(0,33),
64,264;;,704,352;;")
 @@ parsing (0,22)=s132Datevalid:(0,23)=@s8;-16;,0,8;Timevalid:(0,23),8,8;Year:
(0,1),32,32;Month:(0,24)=r(0,1);0000000000001;0000000000014;,64,32;Day:(0,25)
=r(0,1);0000000000001;0000000000037;,96,32;Dayofweek:(0,26)=r(0,1);
0000000000000;0000000000006;,128,32;Hour:(0,27)=r(0,1);0000000000000;
0000000000027;,160,32;Minute:(0,28)=r(0,1);0000000000000;0000000000073;,192,32;
Second:(0,29)=r(0,1);0000000000000;0000000000075;,224,32;Microsecond:(0,30)=r(0,
1);0000000000000;0000003641077;,256,32;Timezone:(0,1),288,32;Dst:(0,23),320,8;
Tzname1:(0,31)=s44Capacity:(0,4),0,32;length:(0,4),32,32;_p_schema_:(0,32)
=@s264;@S;S(0,33)=r(0,1);0000000000001;0000000000041;,64,264;;,352,352;Tzname2:
(0,34)=s44Capacity:(0,4),0,32;length:(0,4),32,32;_p_schema_:(0,35)=@s264;@S;S(0,
33),64,264;;,704,352;; gave NULL type (s132Datevalid:(0,23)=@s8;-16;,0,8;
Timevalid:(0,23),8,8;Year:(0,1),32,32;Month:(0,24)=r(0,1);0000000000001;
0000000000014;,64,32;Day:(0,25)=r(0,1);0000000000001;0000000000037;,96,32;
Dayofweek:(0,26)=r(0,1);0000000000000;0000000000006;,128,32;Hour:(0,27)=r(0,1);
0000000000000;0000000000027;,160,32;Minute:(0,28)=r(0,1);0000000000000;
0000000000073;,192,32;Second:(0,29)=r(0,1);0000000000000;0000000000075;,224,32;
Microsecond:(0,30)=r(0,1);0000000000000;0000003641077;,256,32;Timezone:(0,1),
288,32;Dst:(0,23),320,8;Tzname1:(0,31)=s44Capacity:(0,4),0,32;length:(0,4),32,
32;_p_schema_:(0,32)=@s264;@S;S(0,33)=r(0,1);0000000000001;0000000000041;,64,
264;;,352,352;Tzname2:(0,34)=s44Capacity:(0,4),0,32;length:(0,4),32,32;
_p_schema_:(0,35)=@s264;@S;S(0,33),64,264;;,704,352;; remains)
Segmentation fault
>valgrind --tool=addrcheck ./a.out
(similar to above)
>>valgrind --tool=none ./a.out
(similar to above)
Comment 1 Nicholas Nethercote 2005-07-19 06:21:45 UTC
Patrick, is this still a problem with Valgrind 2.4.0 or the code from the 3.0 repository?  Several stabs-related fixes have gone in since 2.2.0.
Comment 2 Patrick Timlick 2005-07-19 18:49:55 UTC
Hi Nicholas,
Thanks for getting back to me.

Answers merged below

On Monday 18 July 2005 09:21 pm, you wrote:
[bugs.kde.org quoted mail]
I have downloaded and built 2.4.0.  Every pascal program that I try gives 
approximately the following:
valgrind `which drtest`
==14998== Memcheck, a memory error detector for x86-linux.
==14998== Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward et al.
==14998== Using valgrind-2.4.0, a program supervision framework for x86-linux.
==14998== Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et al.
 @@ don't know what type 'd' is
 @@ parsing d(0,2) gave NULL type ((0,2) remains)
 @@ parsing (0,50)=d(0,2) gave NULL type ((0,2) remains)
Segmentation fault

where:
valgrind --version
valgrind-2.4.0

gpc --version
20011222, based on gcc-2.95.3 20010315 (release)

or the code
> from the 3.0 repository?  

I do not know what "3.0 repository" refers to.

>Several stabs-related fixes have gone in since
> 2.2.0.


Hope this helps.  If this information is insufficient, write back and
I will try harder.

Thanks again for working on this.

-- Pat
Comment 3 Tom Hughes 2005-07-19 19:57:55 UTC
Created attachment 11852 [details]
Patch to dix parsing of d descriptor in stabs

At least valgrind 2.4 is producing a more helpful error message... The problem
is the 'd' descriptor which is something only pascal uses - it indicates a file
of records of some type.

Can you try this patch please - hopefully it will fix the problem.
Comment 4 Patrick Timlick 2005-07-20 19:32:59 UTC
Hi Tom,

It works!  I tried it on several pascal programs.  Even found an uninitialized 
variable or two.  

Thanks a lot.

-- Pat

On Tuesday 19 July 2005 10:57 am, you wrote:
[bugs.kde.org quoted mail]
Comment 5 Tom Hughes 2005-07-20 19:48:39 UTC
Thanks for confirming that. I have committed the fix to the 3.0 SVN repository.