Path: utzoo!attcan!uunet!aplcen!samsung!usc!ucsd!ucbvax!ANDREW.CMU.EDU!gk5g+ From: gk5g+@ANDREW.CMU.EDU (Gary Keim) Newsgroups: comp.soft-sys.andrew Subject: Re: problems with menulists Message-ID: Date: 19 Oct 90 21:14:42 GMT References: Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 48 Excerpts from internet.info-andrew: 19-Oct-90 Re: problems with menulists Nathaniel Borenstein@thu (1537) > I'm not really sure > how your code managed to get the menu to show up at all, nor am I sure > why it core dumped when you selected it, but I'd recommend, as a first > pass to fixing it, that you try moving your ChainAfter into a PostMenus > method. The menu appears because textview doesn't ever clear it's menus chain (menulist_ClearChain). The reason it was core-dumping was that the menulist->object (set via menulist_DuplicateML, menulist_Create, or menulist_SetView) field wasn't set and at some point in the enqueueing of the menu event this routine is called: boolean class_IsType(testobject, typeobject) struct basicobject *testobject, *typeobject; { struct classinfo *testtype = testobject->methods->info; do { if (testtype == typeobject->methods->info) return TRUE; /* Check for both NULL and "" superclassname because class generates "", * but should be fixed. */ if (testtype->superclass == NULL && testtype->superclassname != NULL && *testtype->superclassname != '\0') if ((testtype->superclass = class_Load(testtype->superclassnamekey)) == NULL) { fprintf(stderr, "Could not load class %s.\n", testtype->superclassname); exit(1); } testtype = testtype->superclass; } while (testtype != NULL); return FALSE; } with these arguments: class_IsType(menulist->object,proctable_entry->type) So, you can see that a NULL pointer is dereferenced. Gary