Re: [gtk-list] Gtk--: Tracking down clobbered pointers and mysterious crashes



As the well known robert_gasch@peoplesoft.com said...
->
->
->Hi,
->
->I'm experiencing 2 mysterious crashes in my Gtk-- program
->which I can't figure out and which I'm guessing to be some
->kind of pointer gone astray. What I'm wondering is this:
->
->1) Does anybody have any suggestions for some (software)
->tools which might aid in discovering these obsucre bugs?

	Well... gdb does it right, no ? [I'm so impatient
	to see your response to this stupid answer... :)]

->2) I typically allocate most my Gtk-- objects on the stack.
->Is this considered OK or would dynamic allocation be
->better? I seem to remember that Gtk objects are very
->small themselves and dynamically allocate the memory
->they need (which would make stack allocation OK). Any
->tips from the Gtk-- gurus?

	Could you provide some example code of what you
	"typically" do ? Some common errors in such cases
	look like :

	int *foo(int f) 
	{
		int		i;
		
		i = 2*f + 4;
		return (&i);
	}

	which allways lead to some problems, since the stack
	is cleared at the exit of the function (so you end up
	with a int * that goes nowhere, and can contain
	everything... bad).
->
->Thanks
->--> R

-- 
__________________________________________________________________________
   Emmanuel DELOGET [pixel] pixel@{dotcom.fr,epita.fr}  ----  DotCom SA
         http://www.epita.fr/~pixel | http://www.dotcom.fr/~pixel
"On the last day, God created Linux. And Microsoft won its antitrust case"
--------------------------------------------------------------------------



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