Chinaunix首页 | 论坛 | 博客
  • 博客访问: 558982
  • 博文数量: 142
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1452
  • 用 户 组: 普通用户
  • 注册时间: 2013-09-12 16:28
文章分类

全部博文(142)

文章存档

2016年(10)

2015年(60)

2014年(72)

我的朋友

分类: C/C++

2015-04-01 08:50:18

变量j未初始化,导致访问出错。

点击(此处)折叠或打开

  1. gwwu@hz-dev2.wgw.com:~/codes/istanbul_3_31/build_BR200>powerpc-linux-gnu-gdb
  2. GNU gdb (Sourcery G++ Lite 2010.09-55) 7.2.50.20100908-cvs
  3. Copyright (C) 2010 Free Software Foundation, Inc.
  4. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  5. This is free software: you are free to change and redistribute it.
  6. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  7. and "show warranty" for details.
  8. This GDB was configured as "--host=i686-pc-linux-gnu --target=powerpc-linux-gnu".
  9. For bug reporting instructions, please see:
  10. <https://support.codesourcery.com/GNUToolchain/>.
  11. (gdb) set solib-absolute-prefix ./images/rootfs_tmp
  12. (gdb) set solib-search-path set ./images/rootfs_tmp
  13. (gdb) file ./images/rootfs_tmp/opt/ah/bin/ah_scd
  14. app/ br200_install/ drivers/ include/ mgt/ system/
  15. awe/ build/ fe/ ipc/ rootfs_debug/ tools/
  16. bootloader/ db/ images/ kernel/ scripts/ util/
  17. (gdb) file ./images/rootfs_tmp/opt/ah/bin/ah_scd
  18. Reading symbols from /home/gwwu/codes/istanbul_3_31/build_BR200/images/rootfs_tmp/opt/ah/bin/ah_scd...done.
  19. (gdb) core-file ../ah_scd_pid1745_sig11_time1970-01-01_00-00-34.core
  20. warning: exec file is newer than core file.
  21. [New LWP 1842]
  22. [New LWP 1768]
  23. [New LWP 1775]
  24. [New LWP 1774]
  25. [New LWP 1844]
  26. [New LWP 1845]
  27. [New LWP 1846]
  28. [New LWP 1847]
  29. [New LWP 1745]
  30. [New LWP 1769]
  31. [New LWP 1770]
  32. [New LWP 1776]
  33. warning: Can't read pathname for load map: Input/output error.
  34. Reading symbols from ./images/rootfs_tmp/sbin/gethostbyname_wrap.so...(no debugging symbols found)...done.
  35. Loaded symbols for ./images/rootfs_tmp/sbin/gethostbyname_wrap.so
  36. Reading symbols from ./images/rootfs_tmp/opt/ah/lib/libah_cli.so...done.
  37. Loaded symbols for ./images/rootfs_tmp/opt/ah/lib/libah_cli.so
  38. Reading symbols from ./images/rootfs_tmp/opt/ah/lib/libah_event.so...done.
  39. Loaded symbols for ./images/rootfs_tmp/opt/ah/lib/libah_event.so
  40. Reading symbols from ./images/rootfs_tmp/opt/ah/lib/libah_mpi.so...done.
  41. Loaded symbols for ./images/rootfs_tmp/opt/ah/lib/libah_mpi.so
  42. Reading symbols from ./images/rootfs_tmp/opt/ah/lib/libah_sys.so...done.
  43. Loaded symbols for ./images/rootfs_tmp/opt/ah/lib/libah_sys.so
  44. Reading symbols from ./images/rootfs_tmp/opt/ah/lib/libah_hw.so...done.
  45. Loaded symbols for ./images/rootfs_tmp/opt/ah/lib/libah_hw.so
  46. Reading symbols from ./images/rootfs_tmp/opt/ah/lib/libah.so...done.
  47. Loaded symbols for ./images/rootfs_tmp/opt/ah/lib/libah.so
  48. Reading symbols from ./images/rootfs_tmp/lib/libpthread.so.0...(no debugging symbols found)...done.
  49. Loaded symbols for ./images/rootfs_tmp/lib/libpthread.so.0
  50. Reading symbols from ./images/rootfs_tmp/opt/ah/lib/libah_scd.so...done.
  51. Loaded symbols for ./images/rootfs_tmp/opt/ah/lib/libah_scd.so
  52. Reading symbols from ./images/rootfs_tmp/opt/ah/lib/libah_tpa.so...done.
  53. Loaded symbols for ./images/rootfs_tmp/opt/ah/lib/libah_tpa.so
  54. Reading symbols from ./images/rootfs_tmp/opt/ah/lib/libah_top.so...done.
  55. Loaded symbols for ./images/rootfs_tmp/opt/ah/lib/libah_top.so
  56. Reading symbols from ./images/rootfs_tmp/opt/ah/lib/libah_dcd.so...done.
  57. Loaded symbols for ./images/rootfs_tmp/opt/ah/lib/libah_dcd.so
  58. Reading symbols from ./images/rootfs_tmp/opt/ah/lib/libah_upgrade.so...done.
  59. Loaded symbols for ./images/rootfs_tmp/opt/ah/lib/libah_upgrade.so
  60. Reading symbols from ./images/rootfs_tmp/opt/ah/lib/libah_dhcp.so...done.
  61. Loaded symbols for ./images/rootfs_tmp/opt/ah/lib/libah_dhcp.so
  62. Reading symbols from ./images/rootfs_tmp/opt/ah/lib/libah_img.so...done.
  63. Loaded symbols for ./images/rootfs_tmp/opt/ah/lib/libah_img.so
  64. Reading symbols from ./images/rootfs_tmp/opt/ah/lib/libgdbm.so.3...(no debugging symbols found)...done.
  65. Loaded symbols for ./images/rootfs_tmp/opt/ah/lib/libgdbm.so.3
  66. Reading symbols from ./images/rootfs_tmp/opt/ah/lib/libgdbm_compat.so.3...(no debugging symbols found)...done.
  67. Loaded symbols for ./images/rootfs_tmp/opt/ah/lib/libgdbm_compat.so.3
  68. Reading symbols from ./images/rootfs_tmp/opt/ah/lib/libah_db.so...done.
  69. Loaded symbols for ./images/rootfs_tmp/opt/ah/lib/libah_db.so
  70. Reading symbols from ./images/rootfs_tmp/opt/ah/lib/libah_capwap.so...done.
  71. Loaded symbols for ./images/rootfs_tmp/opt/ah/lib/libah_capwap.so
  72. Reading symbols from ./images/rootfs_tmp/opt/ah/lib/libah_cli_sec.so...done.
  73. Loaded symbols for ./images/rootfs_tmp/opt/ah/lib/libah_cli_sec.so
  74. Reading symbols from ./images/rootfs_tmp/opt/ah/lib/libssl.so.0.9.8...(no debugging symbols found)...done.
  75. Loaded symbols for ./images/rootfs_tmp/opt/ah/lib/libssl.so.0.9.8
  76. Reading symbols from ./images/rootfs_tmp/opt/ah/lib/libcrypto.so.0.9.8...(no debugging symbols found)...done.
  77. Loaded symbols for ./images/rootfs_tmp/opt/ah/lib/libcrypto.so.0.9.8
  78. Reading symbols from ./images/rootfs_tmp/opt/ah/lib/libah_dhcp_db.so...done.
  79. Loaded symbols for ./images/rootfs_tmp/opt/ah/lib/libah_dhcp_db.so
  80. Reading symbols from ./images/rootfs_tmp/opt/ah/lib/libah_user.so...done.
  81. Loaded symbols for ./images/rootfs_tmp/opt/ah/lib/libah_user.so
  82. Reading symbols from ./images/rootfs_tmp/opt/ah/lib/libah_vpn.so...done.
  83. Loaded symbols for ./images/rootfs_tmp/opt/ah/lib/libah_vpn.so
  84. Reading symbols from ./images/rootfs_tmp/opt/ah/lib/libah_brd.so...done.
  85. Loaded symbols for ./images/rootfs_tmp/opt/ah/lib/libah_brd.so
  86. Reading symbols from ./images/rootfs_tmp/opt/ah/lib/libah_amrp.so...(no debugging symbols found)...done.
  87. Loaded symbols for ./images/rootfs_tmp/opt/ah/lib/libah_amrp.so
  88. Reading symbols from ./images/rootfs_tmp/opt/ah/lib/libah_httpc_lib.so...(no debugging symbols found)...done.
  89. Loaded symbols for ./images/rootfs_tmp/opt/ah/lib/libah_httpc_lib.so
  90. Reading symbols from ./images/rootfs_tmp/opt/ah/lib/libcurl.so.4...(no debugging symbols found)...done.
  91. Loaded symbols for ./images/rootfs_tmp/opt/ah/lib/libcurl.so.4
  92. Reading symbols from ./images/rootfs_tmp/opt/ah/lib/libah_nbrcom.so...done.
  93. Loaded symbols for ./images/rootfs_tmp/opt/ah/lib/libah_nbrcom.so
  94. Reading symbols from ./images/rootfs_tmp/opt/ah/lib/libah_radius.so...done.
  95. Loaded symbols for ./images/rootfs_tmp/opt/ah/lib/libah_radius.so
  96. Reading symbols from ./images/rootfs_tmp/lib/libc.so.6...(no debugging symbols found)...done.
  97. Loaded symbols for ./images/rootfs_tmp/lib/libc.so.6
  98. Reading symbols from ./images/rootfs_tmp/lib/libdl.so.2...(no debugging symbols found)...done.
  99. Loaded symbols for ./images/rootfs_tmp/lib/libdl.so.2
  100. Reading symbols from ./images/rootfs_tmp/lib/ld.so.1...(no debugging symbols found)...done.
  101. Loaded symbols for ./images/rootfs_tmp/lib/ld.so.1
  102. Reading symbols from ./images/rootfs_tmp/lib/libcrypt.so.1...(no debugging symbols found)...done.
  103. Loaded symbols for ./images/rootfs_tmp/lib/libcrypt.so.1
  104. Reading symbols from ./images/rootfs_tmp/lib/librt.so.1...(no debugging symbols found)...done.
  105. Loaded symbols for ./images/rootfs_tmp/lib/librt.so.1
  106. Reading symbols from ./images/rootfs_tmp/lib/libz.so.1...(no debugging symbols found)...done.
  107. Loaded symbols for ./images/rootfs_tmp/lib/libz.so.1
  108. Reading symbols from ./images/rootfs_tmp/lib/libnss_files.so.2...(no debugging symbols found)...done.
  109. Loaded symbols for ./images/rootfs_tmp/lib/libnss_files.so.2
  110. Core was generated by `/opt/ah/bin/ah_scd'.
  111. Program terminated with signal 11, Segmentation fault.
  112. #0 0x1004d548 in ah_scd_dhcps_vendor_specific_hex (cmd=0x4ba50cc8, ptr=0x100c451c)
  113.     at ah_scd_dhcp_cli.c:4661
  114. 4661 while(ptr->value[j] != 0 && ptr->value[j+1] != 0) {
  115. (gdb) bt
  116. #0 0x1004d548 in ah_scd_dhcps_vendor_specific_hex (cmd=0x4ba50cc8, ptr=0x100c451c)
  117.     at ah_scd_dhcp_cli.c:4661
  118. #1 0x100100a0 in ah_scd_dhcps_vendor_specific_hex_vec (cmd=0x4ba50cc8, data=0x100c4514, ntlvs=1)
  119.     at /home/gwwu/codes/istanbul_3_31/build_BR200/mgt/cli/scd/ah_cli_agt_auto.c:1199
  120. #2 0x0ffb9258 in process_msg (peer_mpi_port=65568, buf=0x100c44e8 "", len=180)
  121.     at ah_cli_agent.c:965
  122. #3 0x0ffbb258 in ah_cli_main (arg=0xffceb48) at ah_cli_agent.c:1119
  123. #4 0x0fe9559c in ?? () from ./images/rootfs_tmp/lib/libpthread.so.0
  124. #5 0x0f7dfbc4 in clone () from ./images/rootfs_tmp/lib/libc.so.6
  125. (gdb) p j-----------------变量j为初始化,出错
  126. $1 = 1269107808
  127. (gdb) p j
  128. $2 = 1269107808
  129. (gdb) info locals
  130. rc = 0
  131. dhcps_cfg = {if_name = "mgt0", '\000' <repeats 11 times>, vlan = 1, enable = ah_false,
  132.   dhcrelay = ah_false, auth_flag = ah_true, arp_check = ah_true, flags = 0, debug = 0, port = 67,
  133.   lease = 86400, renew_type = 1, netmask = 0, netmask_configed = 0, ip_addr = 0, max_hops = 0,
  134.   mac_addr = "\000\000\000\000\000", dfmask = 0, options = {dns_ip = {3232257281, 0, 0},
  135.     logsrv_ip = {0}, ntp_ip = {0, 0}, win_ip = {0, 0}, pop3_ip = {0}, smtp_ip = {0}, gateway = {
  136.       3232257281}, hm_ip = {0}, mtu = 0, domain = '\000' <repeats 32 times>,
  137.     hm_name = '\000' <repeats 64 times>, gw_nat_support = {ah_false}, vendor = {{
  138.         vendor_name = "AEROHIVE", '\000' <repeats 24 times>, vendor_specific = {{
  139.             sub_opt = 225 '\341', type = 1 '\001', len = 4 '\004', value = {ip = 369432069,
  140.               string = "\026\005\026\005", '\000' <repeats 28 times>}}, {sub_opt = 226 '\342',
  141.             type = 2 '\002', len = 6 '\006', value = {ip = 1633837921,
  142.               string = "abcabc", '\000' <repeats 26 times>}}, {sub_opt = 228 '\344',
  143.             type = 4 '\004', len = 2 '\002', value = {ip = 0,
  144.               string = '\000' <repeats 32 times>}}, {sub_opt = 0 '\000', type = 0 '\000',
  145.             len = 0 '\000', value = {ip = 0, string = '\000' <repeats 32 times>}}, {
  146.             sub_opt = 0 '\000', type = 0 '\000', len = 0 '\000', value = {ip = 0,
  147.               string = '\000' <repeats 32 times>}}, {sub_opt = 0 '\000', type = 0 '\000',
  148.             len = 0 '\000', value = {ip = 0, string = '\000' <repeats 32 times>}}, {
  149.             sub_opt = 0 '\000', type = 0 '\000', len = 0 '\000', value = {ip = 0,
  150.               string = '\000' <repeats 32 times>}}, {sub_opt = 0 '\000', type = 0 '\000',
  151.             len = 0 '\000', value = {ip = 0, string = '\000' <repeats 32 times>}}, {
  152.             sub_opt = 0 '\000', type = 0 '\000', len = 0 '\000', value = {ip = 0,
  153.               string = '\000' <repeats 32 times>}}}}, {vendor_name = '\000' <repeats 32 times>,
  154.         vendor_specific = {{sub_opt = 0 '\000', type = 0 '\000', len = 0 '\000', value = {ip = 0,
  155.               string = '\000' <repeats 32 times>}}, {sub_opt = 0 '\000', type = 0 '\000',
  156.             len = 0 '\000', value = {ip = 0, string = '\000' <repeats 32 times>}}, {
  157.             sub_opt = 0 '\000', type = 0 '\000', len = 0 '\000', value = {ip = 0,
  158.               string = '\000' <repeats 32 times>}}, {sub_opt = 0 '\000', type = 0 '\000',
  159.             len = 0 '\000', value = {ip = 0, string = '\000' <repeats 32 times>}}, {
  160.             sub_opt = 0 '\000', type = 0 '\000', len = 0 '\000', value = {ip = 0,
  161.               string = '\000' <repeats 32 times>}}, {sub_opt = 0 '\000', type = 0 '\000',
  162.             len = 0 '\000', value = {ip = 0, string = '\000' <repeats 32 times>}}, {
  163.             sub_opt = 0 '\000', type = 0 '\000', len = 0 '\000', value = {ip = 0,
  164.               string = '\000' <repeats 32 times>}}, {sub_opt = 0 '\000', type = 0 '\000',
  165.             len = 0 '\000', value = {ip = 0, string = '\000' <repeats 32 times>}}, {
  166.             sub_opt = 0 '\000', type = 0 '\000', len = 0 '\000', value = {ip = 0,
  167.               string = '\000' <repeats 32 times>}}}}, {vendor_name = '\000' <repeats 32 times>,
  168.         vendor_specific = {{sub_opt = 0 '\000', type = 0 '\000', len = 0 '\000', value = {ip = 0,
  169.               string = '\000' <repeats 32 times>}}, {sub_opt = 0 '\000', type = 0 '\000',
  170.             len = 0 '\000', value = {ip = 0, string = '\000' <repeats 32 times>}}, {
  171.             sub_opt = 0 '\000', type = 0 '\000', len = 0 '\000', value = {ip = 0,
  172. ---Type <return> to continue, or q <return> to quit---
  173.               string = '\000' <repeats 32 times>}}, {sub_opt = 0 '\000', type = 0 '\000',
  174.             len = 0 '\000', value = {ip = 0, string = '\000' <repeats 32 times>}}, {
  175.             sub_opt = 0 '\000', type = 0 '\000', len = 0 '\000', value = {ip = 0,
  176.               string = '\000' <repeats 32 times>}}, {sub_opt = 0 '\000', type = 0 '\000',
  177.             len = 0 '\000', value = {ip = 0, string = '\000' <repeats 32 times>}}, {
  178.             sub_opt = 0 '\000', type = 0 '\000', len = 0 '\000', value = {ip = 0,
  179.               string = '\000' <repeats 32 times>}}, {sub_opt = 0 '\000', type = 0 '\000',
  180.             len = 0 '\000', value = {ip = 0, string = '\000' <repeats 32 times>}}, {
  181.             sub_opt = 0 '\000', type = 0 '\000', len = 0 '\000', value = {ip = 0,
  182.               string = '\000' <repeats 32 times>}}}}}}, server_ip = {0, 0}, ip_pool = {{start = 0,
  183.       end = 0}, {start = 0, end = 0}, {start = 0, end = 0}, {start = 0, end = 0}, {start = 0,
  184.       end = 0}, {start = 0, end = 0}, {start = 0, end = 0}, {start = 0, end = 0}}, ip_reserved = {{
  185.       start = 0, end = 0}, {start = 0, end = 0}, {start = 0, end = 0}, {start = 0, end = 0}, {
  186.       start = 0, end = 0}, {start = 0, end = 0}, {start = 0, end = 0}, {start = 0, end = 0}},
  187.   static_lease = {{chaddr = "\000\000\000\000\000", yiaddr = 0} <repeats 1000 times>},
  188.   static_lease_num = 0, custom = {{code = 0 '\000', type = 0 '\000', len = 0 '\000',
  189.       value = '\000' <repeats 255 times>}, {code = 0 '\000', type = 0 '\000', len = 0 '\000',
  190.       value = '\000' <repeats 255 times>}, {code = 0 '\000', type = 0 '\000', len = 0 '\000',
  191.       value = '\000' <repeats 255 times>}, {code = 0 '\000', type = 0 '\000', len = 0 '\000',
  192.       value = '\000' <repeats 255 times>}, {code = 0 '\000', type = 0 '\000', len = 0 '\000',
  193.       value = '\000' <repeats 255 times>}, {code = 0 '\000', type = 0 '\000', len = 0 '\000',
  194.       value = '\000' <repeats 255 times>}, {code = 0 '\000', type = 0 '\000', len = 0 '\000',
  195.       value = '\000' <repeats 255 times>}, {code = 0 '\000', type = 0 '\000', len = 0 '\000',
  196.       value = '\000' <repeats 255 times>}, {code = 0 '\000', type = 0 '\000', len = 0 '\000',
  197.       value = '\000' <repeats 255 times>}}, tty = '\000' <repeats 15 times>, is_used = ah_true}
  198. if_index = 14
  199. if_name = 0x100c452c "mgt0"
  200. i = 9
  201. index = 0
  202. j = 1269107808-----------------变量j为初始化,出错
  203. k = 2
  204. bflag = ah_false
  205. length = 4
  206. vendor_specific = 0x4ba4cf70

阅读(1615) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~