[U-Boot] sandbox crashes...

Dear Simon,
with current top of tree (v2011.09-690-gfec79ac) I see this (on a i686 host):
-> ./MAKEALL sandbox Configuring for sandbox board... cmd_nvedit.c: In function ‘do_env_export’: cmd_nvedit.c:748:3: warning: format ‘%zX’ expects argument of type ‘size_t’, but argument 3 has type ‘long unsigned int’ [-Wformat] cmd_nvedit.c:774:2: warning: format ‘%zX’ expects argument of type ‘size_t’, but argument 3 has type ‘long unsigned int’ [-Wformat] cmd_nvedit.c: In function ‘do_env_import’: cmd_nvedit.c:865:3: warning: format ‘%zd’ expects argument of type ‘signed size_t’, but argument 2 has type ‘size_t’ [-Wformat] cmd_nvedit.c:865:3: warning: format ‘%zX’ expects argument of type ‘size_t’, but argument 3 has type ‘long unsigned int’ [-Wformat] hashtable.c: In function ‘hexport_r’: hashtable.c:494:2: warning: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ [-Wformat] hashtable.c:542:4: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘size_t’ [-Wformat] hashtable.c:542:4: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘long unsigned int’ [-Wformat] hashtable.c: In function ‘himport_r’: hashtable.c:643:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘size_t’ [-Wformat] text data bss dec hex filename 101737 3004 26128 130869 1ff35 ./u-boot
--------------------- SUMMARY ---------------------------- Boards compiled: 1 Boards with warnings or errors: 1 ( sandbox ) ---------------------------------------------------------- -> git describe v2011.09-690-gfec79ac -> gdb u-boot GNU gdb (GDB) Fedora (7.3-43.fc15) Copyright (C) 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i686-redhat-linux-gnu". For bug reporting instructions, please see: http://www.gnu.org/software/gdb/bugs/... Reading symbols from /home/wd/git/u-boot/work/u-boot...done. (gdb) run Starting program: /home/wd/git/u-boot/work/u-boot
Program received signal SIGSEGV, Segmentation fault. memset (s=0x0, c=0, count=72) at string.c:418 418 *sl++ = cl; Missing separate debuginfos, use: debuginfo-install glibc-2.14-5.i686 (gdb) bt #0 memset (s=0x0, c=0, count=72) at string.c:418 #1 0x08048de4 in board_init_f (bootflag=0) at board.c:153 #2 0x08048b58 in main (argc=1, argv=0xbfffeb44) at start.c:30 (gdb)
memset(NULL, 0, 72) ?
Best regards,
Wolfgang Denk

Hi Wolfgang,
On Thu, Nov 3, 2011 at 2:39 PM, Wolfgang Denk wd@denx.de wrote:
Dear Simon,
with current top of tree (v2011.09-690-gfec79ac) I see this (on a i686 host):
-> ./MAKEALL sandbox Configuring for sandbox board... cmd_nvedit.c: In function ‘do_env_export’: cmd_nvedit.c:748:3: warning: format ‘%zX’ expects argument of type ‘size_t’, but argument 3 has type ‘long unsigned int’ [-Wformat] cmd_nvedit.c:774:2: warning: format ‘%zX’ expects argument of type ‘size_t’, but argument 3 has type ‘long unsigned int’ [-Wformat]
Interesting - I don't get these but do see another one in the same file:
cmd_nvedit.c:408:2: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘long unsigned int’ [-Wformat]
cmd_nvedit.c: In function ‘do_env_import’: cmd_nvedit.c:865:3: warning: format ‘%zd’ expects argument of type ‘signed size_t’, but argument 2 has type ‘size_t’ [-Wformat] cmd_nvedit.c:865:3: warning: format ‘%zX’ expects argument of type ‘size_t’, but argument 3 has type ‘long unsigned int’ [-Wformat]
I'm not sure what to do with that last one - the two arguments are the same and %X should work ok as unsigned I thought. Since it doesn't happen with my compiler I'm not sure of the best fix - perhaps a cast?
hashtable.c: In function ‘hexport_r’: hashtable.c:494:2: warning: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ [-Wformat] hashtable.c:542:4: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘size_t’ [-Wformat] hashtable.c:542:4: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘long unsigned int’ [-Wformat] hashtable.c: In function ‘himport_r’: hashtable.c:643:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘size_t’ [-Wformat]
I will send a patch for these.
text data bss dec hex filename 101737 3004 26128 130869 1ff35 ./u-boot
--------------------- SUMMARY ---------------------------- Boards compiled: 1 Boards with warnings or errors: 1 ( sandbox )
-> git describe v2011.09-690-gfec79ac -> gdb u-boot GNU gdb (GDB) Fedora (7.3-43.fc15) Copyright (C) 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i686-redhat-linux-gnu". For bug reporting instructions, please see: http://www.gnu.org/software/gdb/bugs/... Reading symbols from /home/wd/git/u-boot/work/u-boot...done. (gdb) run Starting program: /home/wd/git/u-boot/work/u-boot
Program received signal SIGSEGV, Segmentation fault. memset (s=0x0, c=0, count=72) at string.c:418 418 *sl++ = cl; Missing separate debuginfos, use: debuginfo-install glibc-2.14-5.i686 (gdb) bt #0 memset (s=0x0, c=0, count=72) at string.c:418 #1 0x08048de4 in board_init_f (bootflag=0) at board.c:153 #2 0x08048b58 in main (argc=1, argv=0xbfffeb44) at start.c:30 (gdb)
memset(NULL, 0, 72) ?
This is because an earlier change broken Sandbox by adding dlmalloc.o to common/Makefile twice:
2d01dd9 omap: spl: fix build break due to changes in FAT
I do have a patch to fix it, but a better solution is to apply Matthias Weisser's 'sandbox: Add improved RAM simulation' patch. I will test the latest version today.
Regards, Simon
Best regards,
Wolfgang Denk
-- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de "I'm growing older, but not up." - Jimmy Buffett

On Thursday 03 November 2011 17:39:36 Wolfgang Denk wrote:
(gdb) run Starting program: /home/wd/git/u-boot/work/u-boot
Program received signal SIGSEGV, Segmentation fault. memset (s=0x0, c=0, count=72) at string.c:418
yes, a change to the build system broke sandbox. you'll need the recent patch to fix things up: [PATCH V3] sandbox: Add improved RAM simulation -mike

On Thu, Nov 3, 2011 at 3:19 PM, Mike Frysinger vapier@gentoo.org wrote:
On Thursday 03 November 2011 17:39:36 Wolfgang Denk wrote:
(gdb) run Starting program: /home/wd/git/u-boot/work/u-boot
Program received signal SIGSEGV, Segmentation fault. memset (s=0x0, c=0, count=72) at string.c:418
yes, a change to the build system broke sandbox. you'll need the recent patch to fix things up: [PATCH V3] sandbox: Add improved RAM simulation -mike
But it now needs a rebase (Mike, your fault :-)
Regards, Simon

Hi Wolfgang,
On Thu, Nov 3, 2011 at 2:39 PM, Wolfgang Denk wd@denx.de wrote:
Dear Simon,
with current top of tree (v2011.09-690-gfec79ac) I see this (on a i686 host):
-> ./MAKEALL sandbox Configuring for sandbox board... cmd_nvedit.c: In function ‘do_env_export’: cmd_nvedit.c:748:3: warning: format ‘%zX’ expects argument of type ‘size_t’, but argument 3 has type ‘long unsigned int’ [-Wformat] cmd_nvedit.c:774:2: warning: format ‘%zX’ expects argument of type ‘size_t’, but argument 3 has type ‘long unsigned int’ [-Wformat] cmd_nvedit.c: In function ‘do_env_import’: cmd_nvedit.c:865:3: warning: format ‘%zd’ expects argument of type ‘signed size_t’, but argument 2 has type ‘size_t’ [-Wformat] cmd_nvedit.c:865:3: warning: format ‘%zX’ expects argument of type ‘size_t’, but argument 3 has type ‘long unsigned int’ [-Wformat] hashtable.c: In function ‘hexport_r’: hashtable.c:494:2: warning: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ [-Wformat] hashtable.c:542:4: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘size_t’ [-Wformat] hashtable.c:542:4: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘long unsigned int’ [-Wformat] hashtable.c: In function ‘himport_r’: hashtable.c:643:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘size_t’ [-Wformat] text data bss dec hex filename 101737 3004 26128 130869 1ff35 ./u-boot
I have sent up a series which aims to fix a few of these warnings. They don't come up on MAKEALL for me except for microblaze:
fat.c: In function 'do_fat_read': fat.c:876: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int' cmd_nvedit.c: In function 'do_env_export': cmd_nvedit.c:748: warning: format '%zX' expects type 'size_t', but argument 3 has type 'unsigned int' cmd_nvedit.c:774: warning: format '%zX' expects type 'size_t', but argument 3 has type 'unsigned int' cmd_nvedit.c: In function 'do_env_import': cmd_nvedit.c:865: warning: format '%zu' expects type 'size_t', but argument 2 has type 'unsigned int' cmd_nvedit.c:865: warning: format '%zX' expects type 'size_t', but argument 3 has type 'unsigned int' cmd_mtdparts.c: In function 'device_parse': cmd_mtdparts.c:878: warning: field precision should have type 'int', but argument 2 has type 'long unsigned int' hashtable.c: In function 'hexport_r': hashtable.c:494: warning: format '%zu' expects type 'size_t', but argument 5 has type 'unsigned int' hashtable.c:542: warning: format '%zu' expects type 'size_t', but argument 2 has type 'unsigned int' hashtable.c:542: warning: format '%zu' expects type 'size_t', but argument 3 has type 'unsigned int' hashtable.c: In function 'himport_r': hashtable.c:643: warning: format '%zu' expects type 'size_t', but argument 2 has type 'unsigned int'
I can't easily see how to remove the hashtable / cmd_nvedit ones in this case.
Regards, Simon
Regards, Simon
--------------------- SUMMARY ---------------------------- Boards compiled: 1 Boards with warnings or errors: 1 ( sandbox )
-> git describe v2011.09-690-gfec79ac -> gdb u-boot GNU gdb (GDB) Fedora (7.3-43.fc15) Copyright (C) 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i686-redhat-linux-gnu". For bug reporting instructions, please see: http://www.gnu.org/software/gdb/bugs/... Reading symbols from /home/wd/git/u-boot/work/u-boot...done. (gdb) run Starting program: /home/wd/git/u-boot/work/u-boot
Program received signal SIGSEGV, Segmentation fault. memset (s=0x0, c=0, count=72) at string.c:418 418 *sl++ = cl; Missing separate debuginfos, use: debuginfo-install glibc-2.14-5.i686 (gdb) bt #0 memset (s=0x0, c=0, count=72) at string.c:418 #1 0x08048de4 in board_init_f (bootflag=0) at board.c:153 #2 0x08048b58 in main (argc=1, argv=0xbfffeb44) at start.c:30 (gdb)
memset(NULL, 0, 72) ?
Best regards,
Wolfgang Denk
-- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de "I'm growing older, but not up." - Jimmy Buffett
participants (3)
-
Mike Frysinger
-
Simon Glass
-
Wolfgang Denk