1 From mjeffery@reed.edu Sun Nov 29 14:07:23 1992
2 From: mjeffery@reed.edu (Mark Jefferys)
3 Newsgroups: comp.lang.perl
4 Subject: Re: Recursion error in perl 4.035 ?
5 Date: 28 Nov 92 23:31:14 GMT
6 Organization: Reed College, Portland, OR
8 In article <1f7uvvINN9tp@roundup.crhc.uiuc.edu> parkes@uiuc.edu writes:
10 % In cons.c, change the code at or around 1423 from
13 % (void)apush(tosave,arg->arg_ptr.arg_str);
17 % if (willsave && arg->arg_ptr.arg_str )
18 % (void)apush(tosave,arg->arg_ptr.arg_str);
20 This is half of my patch to which Larry gave a "Looks OK to me."
21 It's been a few months, do I'll post it again.
28 *** Orig/cons.c Thu Jun 11 22:42:01 1992
29 --- cons.c Sun Jun 28 18:31:20 1992
33 /* in any event, save the iterator */
35 ! (void)apush(tosave,cmd->c_short);
37 shouldsave |= tmpsave;
41 /* in any event, save the iterator */
43 ! if (cmd->c_short) /* Better safe than sorry */
44 ! (void)apush(tosave,cmd->c_short);
46 shouldsave |= tmpsave;
54 (void)apush(tosave,arg->arg_ptr.arg_str);
61 ! if (willsave && arg->arg_ptr.arg_str)
62 (void)apush(tosave,arg->arg_ptr.arg_str);
66 Mark Jefferys Internet: mjeffery@reed.edu
68 From ezk@cs.columbia.edu Fri Dec 4 19:44:03 1992
69 From: ezk@cs.columbia.edu (Erez "HWank1" Zadok)
70 Newsgroups: comp.lang.perl
71 Subject: REPOST: FIXES to perl/makewhatis (core dump on OW3 man pages)
72 Date: 3 Dec 92 12:42:05 GMT
74 [This is a repost... -Erez]
76 I've found three small bugs in the the latest version of perl (4.035), which
79 The bugs only appeared when I got Tom Christiansen's man package, and ran
80 the makewhatis script. Furthermore, it only occurred for one particular set
81 of manual pages -- SunOS's OpenWindows 3.
83 Since it seemed related to DBM, I tried to recompile perl with several
84 possible combinations of Sun's /bin/cc, gcc (2.2.2), ndbm, gdbm,
85 - -DDEBUGGING, -traditional (for gcc), Perl's malloc, Sun's malloc, etc. to no
86 avail. Perl was still dumping core with a segmentation fault. "make test"
87 was ok. I was running on various Sun 4 machines, running SunOS 4.1.2.
89 After debugging I found out that perl was trying to dereference pointers
90 that were not initialized.
92 I fixed this by adding initialization to three declarations in perl.h. The
93 ones to rsfp and statstab were needed for non-compressed man pages. When I
94 started using compressed man pages I discovered I had to initialize fdpid as
95 well. Now everything works fine. Here is the diff file:
97 *** array.h.orig Tue Nov 24 02:16:30 1992
98 --- array.h Mon Nov 23 14:31:16 1992
113 + #define Null(type) ((type)NULL)
114 + #define Nullarray Null(ARRAY*)
119 *** perl.h.orig Tue Nov 24 02:16:10 1992
120 --- perl.h Mon Nov 23 14:30:51 1992
124 EXT char *hexdigit INIT("0123456789abcdef0123456789ABCDEFx");
125 EXT char *origfilename;
126 ! EXT FILE * VOLATILE rsfp;
132 EXT char *hexdigit INIT("0123456789abcdef0123456789ABCDEFx");
133 EXT char *origfilename;
134 ! EXT FILE * VOLATILE rsfp INIT(Nullfp);
140 EXT struct stat statbuf;
141 EXT struct stat statcache;
142 EXT STAB *statstab INIT(Nullstab);
145 EXT struct tms timesbuf;
148 EXT struct stat statbuf;
149 EXT struct stat statcache;
150 EXT STAB *statstab INIT(Nullstab);
151 ! EXT STR *statname INIT(Nullstr);
153 EXT struct tms timesbuf;
157 EXT ARRAY *lineary; /* lines of script for debugger */
158 EXT ARRAY *dbargs; /* args to call listed by caller function */
160 ! EXT ARRAY *fdpid; /* keep fd-to-pid mappings for mypopen */
161 EXT HASH *pidstatus; /* keep pid-to-status mappings for waitpid */
163 EXT int *di; /* for tmp use in debuggers */
165 EXT ARRAY *lineary; /* lines of script for debugger */
166 EXT ARRAY *dbargs; /* args to call listed by caller function */
168 ! EXT ARRAY *fdpid INIT(Nullarray); /* keep fd-to-pid mappings for mypopen */
169 EXT HASH *pidstatus; /* keep pid-to-status mappings for waitpid */
171 EXT int *di; /* for tmp use in debuggers */
175 Central Research Facilities.
176 Columbia University Department of Computer Science.
178 "A wank's morning starts one jiffy | Arpa: ezk@cs.columbia.edu
179 after midnight." | Usenet: ...!rutgers!columbia!cs!ezk
180 -HebrewWank #1 (US meaning, not UK!) | Bitnet: erzus@cuvmb.BITNET