🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.next.programmer
2 messages
2 total messages Started by Stefan Brueck Mon, 02 Nov 1992 16:13
side effects of DPSTraceContext() ?
#100
Author: Stefan Brueck
Date: Mon, 02 Nov 1992 16:13
52 lines
2164 bytes
hi

perhaps a stupid question: 

     which are the side effects of the DPSTraceContext() function?

the answer could help me to solve a problem found in a programming session: 
my program (lets call it MyApp) is builded with InterfaceBuilder 2.1 under 
NeXTStep 2.0. 

MyApp wants to add some matrix elements to its mainmenu. therefore it
uses in a seperate routine called after the appDidBecomeActive: message
something like that:

	myMenu = [NXApp mainMenu]
	[myMenu sizeToFit]

this works fine when started without debugging. when debugging is done
with GDB there occurs a "Segmentation fault" in/after the sizeToFit:
call. the stackframe looks similar to this:

	#0 nxzonefreenolock()
	#1 free()
	#2 freeBuckets()
	...
	#5 NXHashInsert()
	#6 DPSMapNames()

bad. but there is a workaround for the problem. if i use DPSTraceContext()
in the following manner

	1) DPSTraceContext() YES after loading the *nib file and before
	[NXApp run]

	2) DPSTraceContext NO before launching the main routines of MyApp
	after receiving the appDidBecomeActive: message

the fault doesn't occure. "learning" from DPSTraceContext() could solve
the problem. another help would be the documentation for DPSMapNames()
- any idea where can i find this?

ciao
stefan

--

##############################################################################
Institut fuer Neue Materialien (INM) #  
Universitaet des Saarlandes, Geb. 43 # Phone: +49 681 302 5086
Stefan Brueck                        # E-Mail (Internet): brueck@inm.uni-sb.de
W-6600 Saarbruecken (Germany)        #
##############################################################################
Re: side effects of DPSTraceContext() ?
#144
Author: Josh Doenias
Date: Wed, 04 Nov 1992 23:00
25 lines
1329 bytes
In article <BRUECK.92Nov2171304@inmsol.inm.uni-sb.de> brueck@inm.uni-sb.de  
(Stefan Brueck) writes:
>
>     which are the side effects of the DPSTraceContext() function?
>
>the answer could help me to solve a problem found in a programming  
session: 
..

This sounds to me like a classic memory smasher.
You may be overwriting a pointer and stomping on memory somewhere.  This  
could cause the crash you are seeing.  Some change to the way the program  
runs (eg. compiling with debugging, calling some new function like  
DPSTraceContext()) may change the way things are laid out in memory in  
such a way that you no longer get a crasher (although you may still be  
writing into bad areas of memory).

These are usually the hardest types of bugs to find in a program.
gdb and MallocDebug are your friends in this case.
Good luck in finding it!

-- josh

##No disclaimer.  If you want to hold my employer responsible for  
something I said, that's okay by me.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads