Subject: Re: Bitchx and bus error
To: Andrey Petrov <petrov@netbsd.org>
From: john heasley <heas@shrubbery.net>
List: port-sparc64
Date: 06/11/2004 10:53:02
Fri, Jun 11, 2004 at 10:35:45AM -0700, john heasley:
> Fri, Jun 11, 2004 at 10:21:55AM -0700, Andrey Petrov:
> > On Fri, Jun 11, 2004 at 10:06:29AM +0200, Matthieu Estrade wrote:
> > > Hi,
> > > 
> > > I have installed the bitchx from pkgsrc. When i want to join a channel, 
> > > and there is many verbose, i always get a bus error and a core is dumped.
> > > It say that there is a problem with sscanf. i can provide the core if 
> > > somebody is interested.
> > > 
> > 
> > Hmm, alignment problem. Verify that formats correspond arguments types.
> 
> for one, modval.h has a mucked-up define.  it links cursor_not_in_display to
> BX_cursor_in_display instead of BX_cursor_not_in_display.
> 
> This app appears to be a 64bit mess....at least from -Wall.

This seems to fix it.

pkgsrc/chat/bitchx/patches/patch-an
$NetBSD$

--- work/BitchX/include/modval.h.orig	2001-05-19 20:40:58.000000000 +0000
+++ work/BitchX/include/modval.h
@@ -279,8 +279,8 @@ extern Function_ptr *global;
 #define output_line(x) ((int) (global[OUTPUT_LINE]((const unsigned char *)x)))
 #define output_with_count(x, y, z) ((int) (global[OUTPUT_WITH_COUNT]((const unsigned char *)x, (int)y, (int)z)))
 #define scroll_window(x) ((void) (global[SCROLL_WINDOW]((Window *)x)))
-#define cursor_not_in_display(x) ((void) (global[CURSOR_IN_DISPLAY]((Screen *)x)))
-#define cursor_in_display(x) ((void) (global[CURSOR_IN_DISPLAY]((Screen *)x)))
+#define cursor_not_in_display(x) ((void) (global[CURSOR_NOT_IN_DISPLAY]((Screen *)x)))
+#define cursor_in_display(x) ((void) (global[CURSOR_IN_DISPLAY]((Window *)x)))
 #define is_cursor_in_display(x) ((int) (global[IS_CURSOR_IN_DISPLAY]((Screen *)x)))
 #define repaint_window(x, y, z) ((void) (global[REPAINT_WINDOW]((Window *)x, (int)y, (int)z)))