[PATCH] ports/150287: Segfault: games/spider crashes after 51 moves
Pascal Stumpf
Pascal.Stumpf at cubes.de
Mon Sep 6 22:16:22 UTC 2010
Ok, found the problem. The *alloc functions are declared in global.h.
These declarations have been removed by a local patch which adds #ifndef
__FreeBSD__, However, it has been forgotten to #include <stdlib.h> in
those files that use any of the *alloc functions, which apparently leads
to problems on amd64. I’ve patched all of these files just to be sure.
(This includes the already existing patch for movelog.c)
--- movelog.c.orig 1991-09-28 19:46:17.000000000 +0200
+++ movelog.c 2010-09-07 00:00:30.000000000 +0200
@@ -16,6 +16,7 @@
#include "defs.h"
#include "globals.h"
+#include <stdlib.h>
#include <string.h>
#include <sys/file.h>
#include <ctype.h>
@@ -33,6 +34,9 @@
extern int cheat_count;
+static int card_to_int(CardPtr card);
+static int restore_game(char *str, char *str2);
+
make_deck_cache()
{
CardPtr tmp;
--- util.c.orig 2010-09-07 00:01:46.000000000 +0200
+++ util.c 2010-09-07 00:02:35.000000000 +0200
@@ -23,6 +23,7 @@
#include "xaw_ui.h"
#endif /* XAW */
#include <ctype.h>
+#include <stdlib.h>
#include <string.h>
#include <pwd.h>
--- xv_stubs.c.orig 2010-09-07 00:01:59.000000000 +0200
+++ xv_stubs.c 2010-09-07 00:03:01.000000000 +0200
@@ -10,6 +10,7 @@
* @(#)xv_stubs.c 2.2 90/04/27
*/
#include <stdio.h>
+#include <stdlib.h>
#include <X11/Xlib.h>
#include <xview/xview.h>
#include <xview/panel.h>
--- xv_ui.c.orig 2010-09-07 00:02:12.000000000 +0200
+++ xv_ui.c 2010-09-07 00:03:29.000000000 +0200
@@ -16,6 +16,7 @@
*/
#include <stdio.h>
+#include <stdlib.h>
#include <xview/xview.h>
#include <xview/canvas.h>
#include <xview/icon_load.h>
--- gfx.c.orig 2010-09-07 00:01:08.000000000 +0200
+++ gfx.c 2010-09-07 00:01:25.000000000 +0200
@@ -15,6 +15,7 @@
*/
#include "defs.h"
#include "globals.h"
+#include <stdlib.h>
#ifdef ROUND_CARDS
#include <X11/Xmu/Drawing.h>
More information about the freebsd-ports-bugs
mailing list