bug-m4
[Top][All Lists]
Advanced

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

[sparc64] SIGBUS error


From: Paweł Sikora
Subject: [sparc64] SIGBUS error
Date: Tue, 24 May 2005 03:46:19 +0200
User-agent: KMail/1.8

Hi,

I've found a bug in m4 code.

Program received signal SIGBUS, Bus error.
0xfffffbaad995ed54 in argz_create_sep () from /lib64/libc.so.6
(gdb) bt
#0  0xfffffbaad995ed54 in argz_create_sep () from /lib64/libc.so.6
#1  0xfffffbaad96b84b8 in argzize_path ()
from /home/users/pluto/rpm/BUILD/m4-1.4q/m4/.libs/libm4.so.0
#2  0xfffffbaad96b8794 in foreach_dirinpath ()
from /home/users/pluto/rpm/BUILD/m4-1.4q/m4/.libs/libm4.so.0
#3  0xfffffbaad96b8a74 in find_file ()
from /home/users/pluto/rpm/BUILD/m4-1.4q/m4/.libs/libm4.so.0
#4  0xfffffbaad96b9ad8 in try_dlopen ()
from /home/users/pluto/rpm/BUILD/m4-1.4q/m4/.libs/libm4.so.0
#5  0xfffffbaad96b9f40 in lt_dlopenext ()
from /home/users/pluto/rpm/BUILD/m4-1.4q/m4/.libs/libm4.so.0
#6  0xfffffbaad96bca1c in m4_module_open ()
from /home/users/pluto/rpm/BUILD/m4-1.4q/m4/.libs/libm4.so.0
#7  0xfffffbaad96bcddc in m4_module_load ()
from /home/users/pluto/rpm/BUILD/m4-1.4q/m4/.libs/libm4.so.0
#8  0x00000000001032a4 in main ()

(gdb) x/s $i0
0x2139d0:        "/usr/lib64/m4"
(gdb) p/c $i1
$11 = 58 ':'
(gdb) p/x $i2
$12 = 0x5cb4db18ee0
(gdb) p/x $i3
$13 = 0x5cb4db18eec    <= this address % 8 != 0

(...)
0xfffffbaad995ed54 <argz_create_sep+180>:       stx  %l0, [ %i3 ]
                                                ^^^^^^^^^^^^^^^^^ bus error
(...)

The argz_create_sep() uses `stx` instruction to store the size_t (8-byte word)
in *argz_len but argzize_path() passes the &int instead of &size_t.
On sparc64 int has 4 bytes and smaller alignment than long/size_t.
Finally we go forward into bus error due to missaligned access.

Regards,
Pawel.

-- 
The only thing necessary for the triumph of evil
  is for good men to do nothing.
                                           - Edmund Burke
--- m4-1.4q/m4/ltdl.c.orig      2001-10-19 15:50:02.000000000 +0000
+++ m4-1.4q/m4/ltdl.c   2005-05-24 01:16:39.000000000 +0000
@@ -2165,7 +2165,7 @@
   int   result         = 0;
   int   filenamesize   = 0;
   int   lenbase        = LT_STRLEN (base_name);
-  int  argz_len        = 0;
+  size_t argz_len      = 0;
   char *argz           = 0;
   char *filename       = 0;
   char *canonical      = 0;

reply via email to

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