[9502] in The GTK GIMP ToolKit mailing list archive
[gtk-list] Re: gtk_init wierdness
daemon@ATHENA.MIT.EDU (Scott Stone)
Thu Oct 22 09:48:44 1998
Date: Thu, 22 Oct 1998 22:48:37 +0900 (JST)
From: Scott Stone <sstone@ume.pht.co.jp>
To: gtk-list@redhat.com
In-Reply-To: <Pine.GSO.4.05.9810220944580.5350-100000@xi>
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com
On Thu, 22 Oct 1998, Jason A. Pfeil wrote:
> What is the value of story_file_p? Trying to close a file pointer that
> points to null is also suicidal for a program.
I've noticed that closing a null pointer IS ok if you're using libc5, but
glibc does produce the segv, as it should. Note, some older apps that
were designed with libc5 think that it's perfectly okay to close null
pointers, and don't check for it... it's scary :)
>
> --Jason
>
> On Thu, 22 Oct 1998, katre wrote:
>
> >
> > I am writing a gtk program. (I am using gtk 1.0.6) Whenever I remove the
> > "#ifdef ... #endif" from the below, the program crashes with the output,
> > "Starting gtk...
> >
> > Error: *** Sigsegv caught."
> >
> > With the #ifdef in to remove the code, it works fine. Both ways, the program
> > compiles with no problems. What could be going on?
> > I've commented out all code that actually calls the function, and it looks
> > correct. I just don't get it.
> >
> > katre
> > --------------------------------------------------------------------------------
> >
> > /* main.c */
> > /* snippage */
> > int
> > main (int argc, char *argv[])
> > {
> > /* initialization */
> > printf("Starting gtk.\n");
> > gtk_init(&argc, &argv);
> > printf("Gtk has started.\n");
> > return EXIT_SUCCESS;
> > }
> >
> > /* files.c */
> > /* snippage */
> > int
> > close_files (void)
> > {
> > #ifdef NOT
> > debug_print("Closing all files...");
> >
> > if (story_map != NULL)
> > {
> > bb_destroy_map(story_map);
> > }
> >
> > fclose(story_file_p);
> > #endif
> >
> > return SUCCESS;
> > }
> >
> > --
> > To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null
> >
> >
>
> -------------------------------------------------------------------------------
> Jason A. Pfeil, Computer Science Graduate Student 101 Carothers Hall
> http://www.cs.fsu.edu/~pfeil C3527 University Center
> pfeil@cs.fsu.edu (850)644-8014
>
> --
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null
>
--------------------------------------------------
Scott M. Stone <sstone@pht.com, sstone@turbolinux.com>
<sstone@pht.co.jp>
Head of TurboLinux Development/Systems Administrator
Pacific HiTech, Inc (USA) / Pacific HiTech, KK (Japan)
http://www.pht.com http://armadillo.pht.co.jp
http://www.pht.co.jp http://www.turbolinux.com
--
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null