Re: glibc utility function errors



On Sun, 2006-04-23 at 21:03 -0400, Matt Bragano wrote:
> Every time I use the glibc utility functions (Glib::get_home_directory() 
> specifically), I receive this runtime error:

The library is called glibmm, not glibc. Also, I think you mean
Glib::get_home_dir().

> *** glibc detected *** double free or corruption (out): 0x080827f8 ***

valgrind might help you to detect the cause of this kind of problem. I
guess that it is caused by some other part of your program.

> However, if I replace Glib::get_home_directory() with a hard coded path 
> (i.e. /home/matt/) everything seems to work fine.
> 
> I'm fairly new to both c++ and gtkmm, so please excuse me if this is an 
> obvious thing or the wrong list.

I can't see any problem in the implementation of that method:

std::string get_home_dir()
{
  const char *const value = g_get_home_dir();
  return (value) ? std::string(value) : std::string();
}

But I suppose there could be a problem in g_get_home_dir(). If you can
reduce this to a simple test case then we can investigate.

-- 
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]