Eric napsal(a):
On Tue, Sep 19, 2006 at 10:31:38PM +0200, Daniel Smolik wrote:
Package: sparc-utils
Version: 1.9-2.5
Severity: important
In newer kernel > 2.6.18-rc1 is changed /dev/openprom interface (may be)
and eeprom tool dies with SIGBUS. On 2.6.17 works. There is a backtrace.
NU gdb 6.4.90-debian
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "sparc-linux-gnu"...Using host libthread_db
library "/lib/libthread_db.so.1".
(gdb) run
Starting program: /home/marvin/sparc-utils-1.9.orig/prtconf-1.3/eeprom
Program received signal SIGBUS, Bus error.
0x00012160 in main (argc=0, argv=<value optimized out>) at eeprom.c:661
661 *(int *)op->oprom_array = 0;
(gdb) bt
#0 0x00012160 in main (argc=0, argv=<value optimized out>) at eeprom.c:661
(gdb)
Hello Daniel,
I don't have access to a sparc workstation anymore. All those from
debian network are currently down, therefore it is hard for me to
investigate.
SIGBUS is raised on non aligned access. But I don't know why it fails
here. Code just above this line to set up 'op' pointer seems to be ok:
char buf2[4096];
struct openpromio *op = (struct openpromio *)buf2;
op is an alias to buf2. I guess buf2 is aligned on a 32-bits boundary
since it is allocated on stack and is a multiple of 4 bytes. Therefore I
cannot figure out what fails.
Did you recompile sparc-utils package?
Yes. I recompile eeprom.c with -ggdb.
What your asm/openpromio.h
header contains about openpromio struct definition?
The last I can find is from 2.6.17 kernel:
struct openpromio
{
u_int oprom_size; /* Actual size of the oprom_array. */
char oprom_array[1]; /* Holds property names and values. */
};
In my /usr/include/asm-sparc64 and /usr/src/linux-2.6.18-rc6 are tha same as you
have.
Could you print out addresses of 'op' pointer and op->oprom_array field
under gdb to see whether they are 32-bits aligned or not?
I am not very familiar with gdb but I test this:Starting program:
/home/marvin/sparc-utils-1.9.orig/prtconf-1.3/eeprom
main (argc=0, argv=0x0) at eeprom.c:775
775 if (argc && *argv)
(gdb) step
776 program_name = *argv;
(gdb) step
777 while ((c = getopt_long (argc, argv, "d:f:h", long_options, 0))
!= EOF)
(gdb) step
613 promfd = open(promdev, O_RDWR);
(gdb) step
614 if (promfd == -1) {
(gdb) step
622 prom_root_node = prom_getsibling(0);
(gdb) step
prom_getsibling (node=0) at eeprom.c:65
65 DECL_OP(sizeof(int));
(gdb) step
64 {
(gdb) step
67 if (node == -1) return 0;
(gdb) step
65 DECL_OP(sizeof(int));
(gdb) step
67 if (node == -1) return 0;
(gdb) step
69 if (ioctl (promfd, OPROMNEXT, op) < 0)
(gdb) step
68 *(int *)op->oprom_array = node;
(gdb) display op
1: op = (struct openpromio *) 0x0
(gdb) step
69 if (ioctl (promfd, OPROMNEXT, op) < 0)
1: op = (struct openpromio *) 0x0
(gdb) step
71 prom_current_node = *(int *)op->oprom_array;
1: op = (struct openpromio *) 0x0
(gdb) step
main (argc=-268262256, argv=0x2) at eeprom.c:623
623 if (!prom_root_node) {
(gdb) step
628 if (!uname (&u) && !strcmp (u.machine, "sparc64"))
(gdb) step
629 p1275 = 1;
(gdb) step
795 } else if (optind >= argc)
(gdb) step
657 struct openpromio *op = (struct openpromio *)buf2;
(gdb) display op
No symbol "op" in current context.
(gdb) display buf2
No symbol "buf2" in current context.
(gdb)
Best regards,
Eric.
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]