• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: | 推荐给好友 上一篇 | 下一篇

C/C++内存问题检查利器—Purify文件描述符问题

发布: 2009-4-20 17:29 | 作者: 陈皓 | 来源: 测试时代采编 | 查看: 112次 | 进入软件测试论坛讨论

领测软件测试网

 

MILY: 宋体">下面,是一个Purify生成的ASCII文本文件的样子:

> ./hello

****  Purify instrumented hello (pid 25698 at Wed Dec 10 22:29:33 2003)

  * Purify 2003.06.00 Solaris 2 (32-bit) Copyright (C) 1992-2002 Rational Software Corp.  All rights reserved. 

  * For contact information type: "purify -help"

  * Options settings: -follow-child-processes=yes -purify -windows=no \

    -purify-home=/usr/rational/releases/purify.sol.2003.06.00 \

    -gcc3_path=/usr/local/bin/gcc \

    -cache-dir=/usr/rational/releases/purify.sol.2003.06.00/cache \

    -demangle_program=/usr/local/bin/c++filt

  * License successfully checked out.

  * Command-line: ./hello

 

****  Purify instrumented hello (pid 25698)  ****

ABR: Array bounds read:

  * This is occurring while in:

        strlen         [rtlib.o]

        _doprnt        [libc.so.1]

        printf         [libc.so.1]

        main           [hello.c:11]

        _start         [crt1.o]

  * Reading 13 bytes from 0x8ea08 in the heap (1 byte at 0x8ea14 illegal).

  * Address 0x8ea08 is at the beginning of a malloc'd block of 12 bytes.

  * This block was allocated from:

        malloc         [rtlib.o]

        main           [hello.c:8]

        _start         [crt1.o]

Hello, World

 

****  Purify instrumented hello (pid 25698)  ****

Current file descriptors in use: 5

FIU: file descriptor 0: <stdin>

FIU: file descriptor 1: <stdout>

FIU: file descriptor 2: <stderr>

FIU: file descriptor 26: <reserved for Purify internal use>

FIU: file descriptor 27: <reserved for Purify internal use>

 

****  Purify instrumented hello (pid 25698)  ****

Purify: Searching for all memory leaks...

 

Memory leaked: 12 bytes (100%); potentially leaked: 0 bytes (0%)

 

MLK: 12 bytes leaked at 0x8ea08

  * This memory was allocated from:

        malloc         [rtlib.o]

        main           [hello.c:8]

        _start         [crt1.o]

 

Purify Heap Analysis (combining suppressed and unsuppressed blocks)

                         Blocks        Bytes

              Leaked          1           12

  Potentially Leaked          0            0

              In-Use          0            0

  ----------------------------------------

     Total Allocated          1           12

 

****  Purify instrumented hello (pid 25698)  ****

  * Program exited with status code 13.

  * 1 access error, 1 total occurrence.

  * 12 bytes leaked.

  * 0 bytes potentially leaked.

  * Basic memory usage (including Purify overhead):

    351348 code

    101724 data/bss

    8192 heap (peak use)

    1272 stack

  * Shared library memory usage (including Purify overhead):

    992 libpure_solaris2_init.so.1 (shared code)

    280 libpure_solaris2_init.so.1 (private data)

    1079516 libc.so.1_pure_p3_c0_111202132_58_32_1158500S (shared code)

    31404 libc.so.1_pure_p3_c0_111202132_58_32_1158500S (private data)

    2324 libdl.so.1_pure_p3_c0_111202132_58_32_4624S (shared code)

    4 libdl.so.1_pure_p3_c0_111202132_58_32_4624S (private data)

    14048 libinternal_stubs.so.1 (shared code)

    940 libinternal_stubs.so.1 (private data)

 

 

延伸阅读

文章来源于领测软件测试网 https://www.ltesting.net/

54/5<12345>

关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备2023014753号-2
技术支持和业务联系:info@testage.com.cn 电话:010-51297073

软件测试 | 领测国际ISTQBISTQB官网TMMiTMMi认证国际软件测试工程师认证领测软件测试网