CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2009
    Posts
    118

    Question valgrind 's "invalid read" error regarding boost

    Hi All,

    Given the following line numbered 780 in my_daemon.cc:

    Code:
    exit(EXIT_FAILURE);
    valgrind generates the following invalid read error:

    Code:
    ==13527== Invalid read of size 4
    ==13527==    at 0x41908E: boost::char_separator<char, std::char_traits<char> >::~char_separator() (atomicity.h:46)
    ==13527==    by 0x5C2AC11: exit (exit.c:78)
    ==13527==    by 0x408ACF: main (my_daemon.cc:780)
    ==13527==  Address 0x65b36b0 is 16 bytes inside a block of size 26 free'd
    ==13527==    at 0x4C24A7A: operator delete(void*) (vg_replace_malloc.c:346)
    ==13527==    by 0x4190A0: boost::char_separator<char, std::char_traits<char> >::~char_separator() (basic_string.h:231)
    ==13527==    by 0x5C2AC11: exit (exit.c:78)
    ==13527==    by 0x408ACF: main (my_daemon.cc:780)
    To me, the error message generated by valgrind is not self-explanatory.

    How should I interpret this message ?

    Thanks.

  2. #2
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: valgrind 's "invalid read" error regarding boost

    Presumably, some aspect of Boost that you're using registered an atexit() method to be called. However, I can't guess which one, or why this is causing trouble.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured