1--- crashme-2.4.orig/crashme.1
2+++ crashme-2.4/crashme.1
3@@ -1,4 +1,4 @@
4-.TH CRASHME 1C LOCAL
5+.TH CRASHME 1 LOCAL
6 .SH NAME
7 crashme \- test operating environment software robustness
8 .SH SYNOPSIS
9--- crashme-2.4.orig/debian/copyright
10+++ crashme-2.4/debian/copyright
11@@ -0,0 +1,25 @@
12+This package was created by Jay Kominek <jkominek@debian.org> on Sunday
13+the 7th of June, 1998.
14+
15+The copyright for crashme is as follows, taken verbatim from crashme.c:
16+
17+ *
18+ *             COPYRIGHT (c) 1990-1994 BY        *
19+ *  GEORGE J. CARRETTE, CONCORD, MASSACHUSETTS.  *
20+ *             ALL RIGHTS RESERVED               *
21+
22+Permission to use, copy, modify, distribute and sell this software
23+and its documentation for any purpose and without fee is hereby
24+granted, provided that the above copyright notice appear in all copies
25+and that both that copyright notice and this permission notice appear
26+in supporting documentation, and that the name of the author
27+not be used in advertising or publicity pertaining to distribution
28+of the software without specific, written prior permission.
29+
30+THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
31+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
32+HE BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
33+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
34+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
35+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
36+SOFTWARE.
37--- crashme-2.4.orig/debian/README.debian
38+++ crashme-2.4/debian/README.debian
39@@ -0,0 +1,23 @@
40+                    _
41+  ___ _ __ __ _ ___| |__  _ __ ___   ___
42+ / __| '__/ _` / __| '_ \| '_ ` _ \ / _ \
43+| (__| | | (_| \__ \ | | | | | | | |  __/
44+ \___|_|  \__,_|___/_| |_|_| |_| |_|\___|
45+                  ... for Debian!
46+
47+ So, you want to crash your computer, but pulling the processor out is
48+getting boring? crashme is for you! crashme works by generating strings of
49+random bytes, and then (here is the fun part) trying to execute the
50+bytes!
51+
52+*** WARNING ***
53+ If you run crashme, your system could very well crash. YOU COULD LOSE
54+YOUR ALL OF YOUR DATA!!! I (Jay Kominek), the author of crashme, Debian,
55+SPI and its officers take no responsibility if you lose data by running
56+crashme. Note: crashme is installed into /usr/bin, world executable.
57+Joe Random User could very well execute it and crash your system!
58+
59+
60+  --- Jay Kominek
61+       jkominek@debian.org
62+       jfk@acm.org
63--- crashme-2.4.orig/debian/compat
64+++ crashme-2.4/debian/compat
65@@ -0,0 +1 @@
66+4
67--- crashme-2.4.orig/debian/rules
68+++ crashme-2.4/debian/rules
69@@ -0,0 +1,46 @@
70+#!/usr/bin/make -f
71+# Originally generated by debmake, and then converted to use debhelper
72+
73+# Uncomment this to turn on verbose mode.
74+#export DH_VERBOSE=1
75+
76+CFLAGS = -Wall -g
77+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
78+	CFLAGS += -O0
79+else
80+	CFLAGS += -O2
81+endif
82+
83+build: crashme
84+
85+clean:
86+	dh_testdir
87+	dh_testroot
88+
89+	rm -f crashme
90+
91+	dh_clean
92+
93+binary-indep:
94+# Nothing to do
95+
96+binary-arch:	build
97+	dh_testdir
98+	dh_testroot
99+	dh_clean
100+	dh_installdirs
101+	dh_install crashme usr/bin
102+	dh_installdocs crashme.html
103+	dh_installman crashme.1
104+	dh_installchangelogs
105+	dh_strip
106+	dh_compress
107+	dh_fixperms
108+	dh_installdeb
109+	dh_shlibdeps
110+	dh_gencontrol
111+	dh_md5sums
112+	dh_builddeb
113+
114+binary: binary-indep binary-arch
115+.PHONY: build clean binary-indep binary-arch binary
116--- crashme-2.4.orig/debian/control
117+++ crashme-2.4/debian/control
118@@ -0,0 +1,17 @@
119+Source: crashme
120+Section: devel
121+Priority: optional
122+Maintainer: Aurélien GÉRÔME <ag@roxor.cx>
123+Standards-Version: 3.7.2
124+Build-Depends: debhelper (>= 4)
125+
126+Package: crashme
127+Architecture: any
128+Depends: ${shlibs:Depends}
129+Description: Stress tests operating system stability
130+ crashme generates strings of random bytes and then attempts to execute
131+ them. Used to test kernel stability.
132+ .
133+ **WARNING** While Linux has been known to survive days and weeks of crashme,
134+ IT IS NOT GUARANTEED THAT YOUR SYSTEM WILL SURVIVE! DO NOT USE THIS PROGRAM
135+ UNLESS YOU REALLY WANT TO CRASH YOUR COMPUTER
136--- crashme-2.4.orig/debian/changelog
137+++ crashme-2.4/debian/changelog
138@@ -0,0 +1,75 @@
139+crashme (2.4-9) unstable; urgency=low
140+
141+  * Adopt the package (Closes: #353388).
142+  * Conform to policy with CFLAGS set to "-O2 -g -Wall".
143+  * Fix resulting gcc warnings from turning on "-Wall".
144+
145+ -- Aurélien GÉRÔME <ag@roxor.cx>  Mon, 31 Jul 2006 14:41:43 +0200
146+
147+crashme (2.4-8) unstable; urgency=low
148+
149+  * QA upload.
150+  * debian/postinst: Remove; /usr/doc already handled by the old prerm.
151+  * debian/rules:
152+    - Add support for DEB_BUILD_OPTIONS=noopt.
153+    - Use dh_install.
154+
155+ -- Matej Vela <vela@debian.org>  Sun, 30 Jul 2006 22:14:56 +0200
156+
157+crashme (2.4-7) unstable; urgency=low
158+
159+  * QA upload.
160+  * s/PAQUETE/crashme/g in postinst. Sorry
161+
162+ -- Amaya Rodrigo Sastre <amaya@debian.org>  Wed, 12 Jul 2006 21:44:04 +0200
163+
164+crashme (2.4-6) unstable; urgency=low
165+
166+  * QA upload.
167+  * This package is orphaned as of #353388, so setting the Maintainer field
168+    accordingly to QA.
169+  * Fix typo in package description (Closes: #363215).
170+  * Get rid of the /usr/doc link (Closes: #359371).
171+  * Stop echoing warnings and stuff on console in postinst. Debconf should be
172+    used instead. Somebody please fix this.
173+  * Bumped Standards version to 3.7.2. No changes needed.
174+  * Fixed manual section
175+
176+ -- Amaya Rodrigo Sastre <amaya@debian.org>  Wed, 12 Jul 2006 18:47:31 +0200
177+
178+crashme (2.4-5) unstable; urgency=low
179+
180+  * New maintainer (Closes: #81889)
181+  * Bump up Standards-Version
182+  * Add Build-Depends (Closes: #70344)
183+  * Remove pddet from the package since it has no manpage and does not seem to
184+    be useful, even for the build process.
185+
186+ -- Aaron Lehmann <aaronl@vitelus.com>  Wed, 10 Jan 2001 19:29:36 -0800
187+
188+crashme (2.4-4) unstable; urgency=low
189+
190+  * Replaced execl call with execlp. (Fixes bug #37304)
191+  * Removed access to an obsolete structure member. (Fixes bug #37446)
192+
193+ -- Jay Kominek <jay.kominek@colorado.edu>  Tue, 25 May 1999 09:32:17 -0600
194+
195+crashme (2.4-3) unstable; urgency=low
196+
197+  * Switched binary-arch and binary-indep to what they should be.
198+    (Fixes bug #25452)
199+
200+ -- Jay Kominek <jkominek@debian.org>  Thu,  6 Aug 1998 03:34:49 -0600
201+
202+crashme (2.4-2) unstable; urgency=low
203+
204+  * Changed extended package description to format sanely in dselect.
205+    (Fixes bug #23666)
206+
207+ -- Jay Kominek <jkominek@debian.org>  Thu, 18 Jun 1998 02:57:30 -0400
208+
209+crashme (2.4-1) unstable; urgency=low
210+
211+  * Initial Release.
212+
213+ -- Jay Kominek <jkominek@debian.org>  Sat,  6 Jun 1998 19:12:44 -0400
214--- crashme-2.4.orig/crashme.c
215+++ crashme-2.4/crashme.c
216@@ -151,6 +151,8 @@
217 #include <unistd.h>
218 #endif
219
220+#include <sys/wait.h>
221+
222 typedef void (*BADBOY)();
223
224 BADBOY badboy;
225@@ -260,10 +262,7 @@
226 #else
227  struct sigaction act;
228  act.sa_handler = func;
229- act.sa_mask = 0;
230-#ifdef linux
231- act.sa_restorer = 0;
232-#endif /* linux */
233+ bzero(&act.sa_mask,sizeof(sigset_t));
234  act.sa_flags = SA_NOMASK;
235 #ifdef SA_RESTART
236  act.sa_flags |= SA_RESTART;
237@@ -272,7 +271,7 @@
238 #endif /* SA_ONESHOT */
239 }
240
241-set_up_signals()
242+void set_up_signals()
243 {my_signal(SIGILL,again_handler);
244 #ifdef SIGTRAP
245  my_signal(SIGTRAP,again_handler);
246@@ -295,7 +294,7 @@
247
248 #endif
249
250-compute_badboy_1(n)
251+void compute_badboy_1(n)
252      long n;
253 {long j;
254  if (malloc_flag == 1)
255@@ -347,7 +346,7 @@
256 #endif
257   return((BADBOY)dat);}
258
259-compute_badboy()
260+void compute_badboy()
261 {long n;
262  n = (nbytes < 0) ? - nbytes : nbytes;
263  if (incptr == 0)
264@@ -369,7 +368,7 @@
265                          the_data,(nbytes < 0) ? - nbytes : nbytes);
266 */
267
268-try_one_crash()
269+void try_one_crash()
270 {if (nbytes > 0)
271    (*badboy)();
272  else if (nbytes == 0)
273@@ -377,7 +376,7 @@
274
275 char *subprocess_ind = "subprocess";
276
277-main(argc,argv)
278+int main(argc,argv)
279      int argc; char **argv;
280 {long nsubs,hrs,mns,scs,tflag,j,m;
281  note_buffer = (char *) malloc(512);
282@@ -411,21 +410,23 @@
283     note(1);
284     record_note();
285     if (strchr(argv[4],':'))
286-      {sscanf(argv[4],"%d:%d:%d",&hrs,&mns,&scs);
287+      {sscanf(argv[4],"%ld:%ld:%ld",&hrs,&mns,&scs);
288        tflag = 1;
289        nsubs = (((hrs * 60) + mns) * 60) + scs;
290-       sprintf(notes,"Subprocess run for %d seconds (%d %02d:%02d:%02d)",
291+       sprintf(notes,"Subprocess run for %ld seconds (%ld %02ld:%02ld:%02ld)",
292 	       nsubs, hrs / 24, hrs % 24,mns,scs);}
293     else
294       {tflag = 0;
295        nsubs = atol(argv[4]);
296-       sprintf(notes,"Creating %d crashme subprocesses",nsubs);}
297+       sprintf(notes,"Creating %ld crashme subprocesses",nsubs);}
298     note(1);
299     vfork_main(tflag,nsubs,argv[0],argv[1],atol(argv[2]),argv[3]);}
300  else
301    {sprintf(notes,
302 	    "crashme [+]<nbytes>[.inc] <srand> <ntrys> [nsub] [verbose]");
303-    note(0);}}
304+    note(0);}
305+ return 0;
306+}
307
308 void copyright_note(n)
309      long n;
310@@ -440,19 +441,19 @@
311 {char *ptr;
312  copyright_note(3);
313  nbytes = atol(argv[1]);
314- if (ptr = strchr(argv[1],'.'))
315+ if ((ptr = strchr(argv[1],'.')))
316    incptr = atol(&ptr[1]);
317  if (argv[1][0] == '+') malloc_flag = 1;
318  nseed = atol(argv[2]);
319  ntrys = atol(argv[3]);
320- sprintf(notes,"crashme %s%ld.%d %ld %ld",
321+ sprintf(notes,"crashme %s%ld.%ld %ld %ld",
322 	 (malloc_flag == 0) ? "" : "+",nbytes,incptr,nseed,ntrys);
323  note(3);
324  record_note();
325  if (malloc_flag == 0)
326    {the_data = bad_malloc((nbytes < 0) ? -nbytes : nbytes);
327     badboy = castaway(the_data);
328-    sprintf(notes,"Badboy at %d. 0x%X",badboy,badboy);
329+    sprintf(notes,"Badboy at %d. 0x%X",(int) badboy,(unsigned int) badboy);
330     note(3);}
331  srand(nseed);
332 #ifdef WIN32
333@@ -481,9 +482,9 @@
334  for(i=0;i<ntrys;++i)
335    {compute_badboy();
336     if (offset)
337-      sprintf(notes,"try %d, offset %d",i,offset);
338+      sprintf(notes,"try %d, offset %ld",i,offset);
339     else if (malloc_flag == 1)
340-      sprintf(notes,"try %d, Badboy at %d. 0x%X",i,badboy,badboy);
341+      sprintf(notes,"try %d, Badboy at %d. 0x%X",i,(int) badboy,(unsigned int) badboy);
342     else
343       sprintf(notes,"try %d",i);
344     note(5);
345@@ -514,7 +515,7 @@
346
347 struct status_list *slist = NULL;
348
349-record_status(n)
350+int record_status(n)
351      long n;
352 {struct status_list *l;
353  for(l=slist;l != NULL; l = l->next)
354@@ -527,13 +528,13 @@
355  slist = l;
356  return(1);}
357
358-summarize_status()
359+void summarize_status()
360 {struct status_list *l;
361  sprintf(notes,"exit status ... number of cases");
362  note(2);
363  for(l=slist;l != NULL; l = l->next)
364    {sprintf(notes,"exit status ... number of cases");
365-    sprintf(notes,"%11d ... %5d",l->status,l->count);
366+    sprintf(notes,"%11ld ... %5ld",l->status,l->count);
367     note(2);}}
368
369 #ifndef WIN32
370@@ -552,7 +553,7 @@
371  if (monitor_active)
372    {++monitor_count;
373     if (monitor_count >= monitor_limit)
374-      {sprintf(notes,"time limit reached on pid %d 0x%X. using kill.",
375+      {sprintf(notes,"time limit reached on pid %ld 0x%lX. using kill.",
376 	       monitor_pid,monitor_pid);
377        note(3);
378        status = kill(monitor_pid,SIGKILL);
379@@ -581,24 +582,24 @@
380    {my_signal(SIGALRM,monitor_fcn);
381     alarm(monitor_period);}
382  time(&before_time);
383- sprintf(arg5,"%d",verbose_level);
384+ sprintf(arg5,"%ld",verbose_level);
385  for(j=0;j<n;++j)
386-   {sprintf(arg2,"%d",sr+j);
387-    sprintf(arg4,"%d",j+1);
388+   {sprintf(arg2,"%ld",sr+j);
389+    sprintf(arg4,"%ld",j+1);
390 #ifdef VMS
391     status = vfork();
392 #else
393     status = fork();
394 #endif
395     if (status == 0)
396-      {status = execl(cmd,cmd,nb,arg2,nt,arg4,arg5,subprocess_ind,0);
397+      {status = execlp(cmd,cmd,nb,arg2,nt,arg4,arg5,subprocess_ind,NULL);
398        if (status == -1)
399 	 {perror(cmd);
400 	  exit(1);}}
401     else if (status < 0)
402       perror(cmd);
403     else
404-      {sprintf(notes,"pid = %d 0x%X (subprocess %d)",status,status,j+1);
405+      {sprintf(notes,"pid = %d 0x%X (subprocess %ld)",status,status,j+1);
406        note(3);
407        if (seq == 1)
408 	 {monitor_pid = status;
409@@ -606,19 +607,19 @@
410 	  monitor_active = 1;
411 	  while((pid = wait(&status)) > 0)
412 	    {monitor_active = 0;
413-	     sprintf(notes,"pid %d 0x%X exited with status %d",pid,pid,status);
414+	     sprintf(notes,"pid %ld 0x%lX exited with status %d",pid,pid,status);
415 	     note(3);
416 	     record_status(status);}}
417        if (tflag == 1)
418 	 {time(&after_time);
419 	  total_time = after_time - before_time;
420 	  if (total_time >= nsubs)
421-	    {sprintf(notes,"Time limit reached after run %d",j+1);
422+	    {sprintf(notes,"Time limit reached after run %ld",j+1);
423 	     note(2);
424 	     break;}}}}
425  if (seq == 0)
426    while((pid = wait(&status)) > 0)
427-     {sprintf(notes,"pid %d 0x%X exited with status %d",pid,pid,status);
428+     {sprintf(notes,"pid %ld 0x%lX exited with status %d",pid,pid,status);
429       note(3);
430       record_status(status);}
431  time(&after_time);
432@@ -632,7 +633,7 @@
433  hrs = hrs % 24;
434  open_record();
435  sprintf(notes,
436-	 "Test complete, total real time: %d seconds (%d %02d:%02d:%02d)",
437+	 "Test complete, total real time: %ld seconds (%ld %02ld:%02ld:%02ld)",
438 	 total_time,dys,hrs,mns,scs);
439  note(1);
440  summarize_status();
441