Re: Illegal Operation.



Hi Martyn,

I did what you requested. Still no results....

[david LAPTOP gui]$ gcc -Wall -g main.c fids_gui1.c pdu_interface.c -o fids
`gtk-config --cflags --libs`
[david LAPTOP gui]$ ./fids
Calling gtk_init_check
Illegal instruction (core dumped)
[david LAPTOP gui]$

Here, I test out the core with gdb:

[david LAPTOP gui]$ gdb fids core
GNU gdb 5.0rh-5 Red Hat Linux 7.1
Copyright 2001 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux"...
Core was generated by `./fids'.
Program terminated with signal 4, Illegal instruction.
Reading symbols from /usr/lib/libgtk-1.2.so.0...done.
Loaded symbols for /usr/lib/libgtk-1.2.so.0
Reading symbols from /usr/lib/libgdk-1.2.so.0...done.
Loaded symbols for /usr/lib/libgdk-1.2.so.0
Reading symbols from /usr/lib/libgmodule-1.2.so.0...done.
Loaded symbols for /usr/lib/libgmodule-1.2.so.0
Reading symbols from /usr/lib/libglib-1.2.so.0...done.
Loaded symbols for /usr/lib/libglib-1.2.so.0
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /usr/X11R6/lib/libXi.so.6...done.
Loaded symbols for /usr/X11R6/lib/libXi.so.6
Reading symbols from /usr/X11R6/lib/libXext.so.6...done.
Loaded symbols for /usr/X11R6/lib/libXext.so.6
Reading symbols from /usr/X11R6/lib/libX11.so.6...done.
Loaded symbols for /usr/X11R6/lib/libX11.so.6
Reading symbols from /lib/i686/libm.so.6...done.
Loaded symbols for /lib/i686/libm.so.6
Reading symbols from /lib/i686/libc.so.6...done.
Loaded symbols for /lib/i686/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
#0  0x0804c020 in socket () at eval.c:41
41      eval.c: No such file or directory.
        in eval.c
(gdb) run
Starting program: /home/david/fyp/gui/fids

Calling gtk_init_check

Program received signal SIGILL, Illegal instruction.
0x0804c020 in socket () at eval.c:41
41      eval.c: No such file or directory.
        in eval.c
(gdb)

Here is the code snippet from my program:

int main(int argc, char **argv)
{
    gboolean rv;

    ............

    printf("Calling gtk_init_check\n");
    rv = gtk_init_check(&argc, &argv);
    if (rv == TRUE)
        printf("Return TRUE\n");
    else if (rv == FALSE) {
        printf("Return FALSE\n");
        return 0;
    }
    ........
    ........
}

Anyone have any suggestions, pls feel free to tell me....
BTW, I have little experience with gdb. I don't understand the output shown.
Can anyone explain to me the error message?

Thanks,
David


----- Original Message -----
From: "Martyn Russell" <jackrussell subdimension com>
To: "Gtk-App-Devel" <gtk-app-devel-list gnome org>
Sent: Wednesday, March 13, 2002 1:58 AM
Subject: Re: Illegal Operation.


On Tue, 2002-03-12 at 17:16, David Chao wrote:
Hi,

I wrote a small GTK program. It compiles ok and run fine. However, when I
begin to expand the program by breaking it into multiple source files, it
compiles ok but when run, it terminates with an illegal operation. I tried
to pinpoint the fault location and found that it fails when the call to
gtk_init() was made. This is really very puzzling to me. I then tried to
compile only the original source file alone into a binary (done by
commenting out all the external function calls in the main function), and
run it, it runs fine again. I am sure there must be something very
fundamental and simple that I must have missed. Can anyone suggest a
possible cause?

Im assuming your only calling gtk_init() once?! Just to make sure it
comes back fine, use gtk_init_check(argv,argc)

that returns TRUE/FALSE based on success.  What does it return you?

Martyn


Thanks,
David

PS: I am using GTK+ 1.2.9.

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




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