confuse-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Confuse-devel] Bus Error on Sparc


From: Nathan Ollerenshaw
Subject: [Confuse-devel] Bus Error on Sparc
Date: Tue, 11 Jan 2011 09:06:51 +1100

Hi,

I was checking out confuse today on a Solaris Sparc box, and with the
"simple" example code, I was able to generate a bus error.

signal BUS (invalid address alignment) in cfg_opt_getnint at line 215
in file "confuse.c"
  215           return *(signed long *)opt->simple_value;
(dbx) where
=>[1] cfg_opt_getnint(opt = 0x1001139e0, index = 0), line 215 in "confuse.c"
  [2] cfg_opt_nprint_var(opt = 0x1001139e0, index = 0, fp =
0x10010f6a0), line 1407 in "confuse.c"
  [3] cfg_opt_print_indent(opt = 0x1001139e0, fp = 0x10010f6a0, indent
= 0), line 1513 in "confuse.c"
  [4] cfg_print_indent(cfg = 0x100111060, fp = 0x10010f6a0, indent =
0), line 1536 in "confuse.c"
  [5] cfg_print(cfg = 0x100111060, fp = 0x10010f6a0), line 1541 in "confuse.c"

Sparc CPUs disallow misaligned memory access. x86 allows this with a
penalty of speed. Sparc just raises a bus error. There are a few
strategies around this; I prefer to copy the bytes with memcpy into
temporary storage.

I haven't gone through the code and tried to find all instances of
misaligned memory access, but I've attached a patch for the specific
instance that I hit when running the example code.

Regards,

Nathan.

Attachment: confuse-2.7-sparc.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]