* Re: Need help with a backtrace
@ 2001-02-15 12:48 Michael Elizabeth Chastain
0 siblings, 0 replies; 9+ messages in thread
From: Michael Elizabeth Chastain @ 2001-02-15 12:48 UTC (permalink / raw)
To: gdb, mschalit
Hi Matt,
> In general, when a backtrace gives a really meager output
> like the following:
>
> ...
>
> and that's all the lines it output, am I supposed to
> put breakpoints into my convert program to see when
> it makes a call to a libc function?
That depends on what your goal is.
If your goal is to debug your gnome app and send useful reports to
the gnome people -- then you put breakpoints in your convert program.
You could also build your program with "-static", which brings in a
static copy of all the library functions that you use. That will make
gdb behave a lot better.
If your goal is to help improve gdb -- then you write up a detailed
bug report:
the whole source code of a program that demonstrates the bug
the exact command line you used to build
"gcc --version" (or the equivalent with the compiler you use)
"ldd a.out" on your executable (or the Unixware equivalent)
ls -l on each shared library used
"gdb --version"
a typescript showing your whole gdb session
Writing a detailed gdb bug report is a task in its own right.
Then you post the bug report, and see if someone will work on it.
If no one responds in a couple of days, you can check the MAINTAINERS
file and e-mail the SCO/Unixware maintainers and ask them the status of
your bug report.
Michael Elizabeth Chastain
<chastain@redhat.com>
"love without fear"
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Need help with a backtrace
@ 2001-02-12 11:46 Michael Elizabeth Chastain
2001-02-12 17:09 ` Matt Schalit
0 siblings, 1 reply; 9+ messages in thread
From: Michael Elizabeth Chastain @ 2001-02-12 11:46 UTC (permalink / raw)
To: gdb, mschalit
Gurgle. It looks like your gdb is doing its job properly.
You'll have to show that backtrace to some Gnome people.
If you can get a core dump, then it would be useful to put some
files in a directory on your ftp server:
the core file
the executable file
all shared libraries that you use
(check out the "ldd" command if you have it)
a typescript with the backtrace and any messages
I can help you with gdb but I can't help you with gnome.
Michael Elizabeth Chastain
<chastain@redhat.com>
"love without fear"
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: Need help with a backtrace
2001-02-12 11:46 Michael Elizabeth Chastain
@ 2001-02-12 17:09 ` Matt Schalit
0 siblings, 0 replies; 9+ messages in thread
From: Matt Schalit @ 2001-02-12 17:09 UTC (permalink / raw)
To: gdb
Michael Elizabeth Chastain wrote:
>
> Gurgle. It looks like your gdb is doing its job properly.
> You'll have to show that backtrace to some Gnome people.
>
> If you can get a core dump, then it would be useful to put some
> files in a directory on your ftp server:
>
> the core file
> the executable file
> all shared libraries that you use
> (check out the "ldd" command if you have it)
> a typescript with the backtrace and any messages
>
> I can help you with gdb but I can't help you with gnome.
Roger that. I think I can get a core, but I'm not sure.
I'll check into that. Thanks.
Matthew
^ permalink raw reply [flat|nested] 9+ messages in thread
* Need help with a backtrace
@ 2001-02-12 11:33 Matt Schalit
2001-02-12 11:53 ` Fernando Nasser
0 siblings, 1 reply; 9+ messages in thread
From: Matt Schalit @ 2001-02-12 11:33 UTC (permalink / raw)
To: gdb
Hi all,
Thanks for reading this. I'm new to debugging and don't understand
enough to read a backtrace. I could use a little help with that.
I'm running an i586-sco-sysv5uw7.1.1, and getting SIGSEGV's whenever
I try to run gnomecc-1.2.2 (gnome control center) via
enlightenment-0.16.5. I never see a window.
Regardless of whether I try to open any windows in Gnome, as soon
as I start the desktop, I do see one warning about MIT-SHM not
working correctly and to disable to Enlightenment Pager snapshots.
I don't think that issue is relate to gnomecc.
Can someone tell me what this means or point me to a nifty howto?
Thanks a lot,
Matthew
----------------------------------------------------------------------------
$ gdb
(gdb) file /usr/local/bin/gnomecc
Reading symbols from /usr/local/bin/gnomecc...done.
(gdb) run
Starting program: /usr/local/bin/gnomecc
warning: Lowest section in /usr/lib/libdl.so.1 is .hash at 00000094
[New LWP 1]
[New LWP 2]
Program received signal SIGSEGV, Segmentation fault.
0xbfa6f929 in _Xwcslen () from /usr/lib/libX11.so.6.1
[New Thread 1]
(gdb) bt
#0 0xbfa6f929 in _Xwcslen () from /usr/lib/libX11.so.6.1
#1 0x400 in ?? ()
#2 0xbfa6fa28 in _XwcTextListToTextProperty () from /usr/lib/libX11.so.6.1
#3 0xbfb9048b in gtk_label_parse_uline (label=0x8139180,
string=0xc615 <Address 0xc615 out of bounds>) at gtklabel.c:1005
#4 0xbfd95397 in create_label (label_text=0xbfe0a339 "", keyval=0x8047878)
at gnome-app-helper.c:402
#5 0xbfd9630e in create_menu_item (menu_shell=0x8137ed0, uiinfo=0x809c770,
is_radio=0, radio_group=0x81379f8, uibdata=0x8047988,
accel_group=0x812ea40, uline_accels=1, pos=134510536)
at gnome-app-helper.c:933
#6 0xbfd96f1a in gnome_app_fill_menu_custom (menu_shell=0x8137ed0,
uiinfo=0x809c770, uibdata=0x8047988, accel_group=0x812ea40,
uline_accels=1, pos=1) at gnome-app-helper.c:1326
#7 0xbfd96fa9 in gnome_app_fill_menu_custom (menu_shell=0x812bd28,
uiinfo=0x809c84c, uibdata=0x8047988, accel_group=0x812ea40,
uline_accels=1, pos=1) at gnome-app-helper.c:1341
#8 0xbfd976a1 in gnome_app_create_menus_custom (app=0x812db90,
uiinfo=0x809c820, uibdata=0x8047988) at gnome-app-helper.c:1516
#9 0xbfd97163 in gnome_app_create_menus (app=0x812db90, uiinfo=0x809c820)
at gnome-app-helper.c:1395
#10 0x804e967 in create_window () at main.c:200
#11 0x804ecf8 in main (argc=1, argv=0x8047a0c) at main.c:282
(gdb)
-------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: Need help with a backtrace
2001-02-12 11:33 Matt Schalit
@ 2001-02-12 11:53 ` Fernando Nasser
2001-02-15 5:33 ` Matt Schalit
0 siblings, 1 reply; 9+ messages in thread
From: Fernando Nasser @ 2001-02-12 11:53 UTC (permalink / raw)
To: Matt Schalit; +Cc: gdb
Matt,
Look at the backtrace (it goes backwards from the last function to be called to the caller of it, the caller of this caller and so on).
The call to gnome_app_create_menus() failed miserably. If you look further on the stack you'll notice that the function create_label() in gnome-app-helper.c at line 402 called gtk_label_parse_uline() and one of the parameters seem to be an invalid pointer:
> string=0xc615 <Address 0xc615 out of bounds>
It is either a bug in the gnome library or the GnomeUIInfo structure was not set properly.
It goes always like that. See who called who and what the arguments were.
Using the up and down commands you can go up and down the stack and look at variables at that context.
Good luck.
Regards,
Fernando
Matt Schalit wrote:
>
> Hi all,
>
> Thanks for reading this. I'm new to debugging and don't understand
> enough to read a backtrace. I could use a little help with that.
>
> I'm running an i586-sco-sysv5uw7.1.1, and getting SIGSEGV's whenever
> I try to run gnomecc-1.2.2 (gnome control center) via
> enlightenment-0.16.5. I never see a window.
>
> Regardless of whether I try to open any windows in Gnome, as soon
> as I start the desktop, I do see one warning about MIT-SHM not
> working correctly and to disable to Enlightenment Pager snapshots.
> I don't think that issue is relate to gnomecc.
>
> Can someone tell me what this means or point me to a nifty howto?
> Thanks a lot,
> Matthew
>
> ----------------------------------------------------------------------------
> $ gdb
>
> (gdb) file /usr/local/bin/gnomecc
> Reading symbols from /usr/local/bin/gnomecc...done.
> (gdb) run
> Starting program: /usr/local/bin/gnomecc
> warning: Lowest section in /usr/lib/libdl.so.1 is .hash at 00000094
> [New LWP 1]
> [New LWP 2]
>
> Program received signal SIGSEGV, Segmentation fault.
> 0xbfa6f929 in _Xwcslen () from /usr/lib/libX11.so.6.1
> [New Thread 1]
> (gdb) bt
> #0 0xbfa6f929 in _Xwcslen () from /usr/lib/libX11.so.6.1
> #1 0x400 in ?? ()
> #2 0xbfa6fa28 in _XwcTextListToTextProperty () from /usr/lib/libX11.so.6.1
> #3 0xbfb9048b in gtk_label_parse_uline (label=0x8139180,
> string=0xc615 <Address 0xc615 out of bounds>) at gtklabel.c:1005
> #4 0xbfd95397 in create_label (label_text=0xbfe0a339 "", keyval=0x8047878)
> at gnome-app-helper.c:402
> #5 0xbfd9630e in create_menu_item (menu_shell=0x8137ed0, uiinfo=0x809c770,
> is_radio=0, radio_group=0x81379f8, uibdata=0x8047988,
> accel_group=0x812ea40, uline_accels=1, pos=134510536)
> at gnome-app-helper.c:933
> #6 0xbfd96f1a in gnome_app_fill_menu_custom (menu_shell=0x8137ed0,
> uiinfo=0x809c770, uibdata=0x8047988, accel_group=0x812ea40,
> uline_accels=1, pos=1) at gnome-app-helper.c:1326
> #7 0xbfd96fa9 in gnome_app_fill_menu_custom (menu_shell=0x812bd28,
> uiinfo=0x809c84c, uibdata=0x8047988, accel_group=0x812ea40,
> uline_accels=1, pos=1) at gnome-app-helper.c:1341
> #8 0xbfd976a1 in gnome_app_create_menus_custom (app=0x812db90,
> uiinfo=0x809c820, uibdata=0x8047988) at gnome-app-helper.c:1516
> #9 0xbfd97163 in gnome_app_create_menus (app=0x812db90, uiinfo=0x809c820)
> at gnome-app-helper.c:1395
> #10 0x804e967 in create_window () at main.c:200
> #11 0x804ecf8 in main (argc=1, argv=0x8047a0c) at main.c:282
> (gdb)
> -------------------------------------------------------------------------
--
Fernando Nasser
Red Hat - Toronto E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Need help with a backtrace
2001-02-12 11:53 ` Fernando Nasser
@ 2001-02-15 5:33 ` Matt Schalit
2001-02-15 6:17 ` Fernando Nasser
0 siblings, 1 reply; 9+ messages in thread
From: Matt Schalit @ 2001-02-15 5:33 UTC (permalink / raw)
To: gdb
Fernando Nasser wrote:
>
> Matt,
Thanks for the excellent tutorial.
> Look at the backtrace (it goes backwards from the last
> function to be called to the caller of it, the caller
> of this caller and so on).
Ok. It looks like it only lists an entry when a function
calls another function, like main() calling printf()?
But it doesn't seem to list things like loops or if/case tests
or variable values?
I know how to write C programs. How would I backtrace or
step my way through hello-world.c if it exits normally, and
I just want to see how the trace looks?
> The call to gnome_app_create_menus() failed miserably.
> If you look further on the stack you'll notice that the
> function create_label() in gnome-app-helper.c at line 402
> called gtk_label_parse_uline() and one of the parameters seem
> to be an invalid pointer:
> > #3 0xbfb9048b in gtk_label_parse_uline (label=0x8139180,
> > string=0xc615 <Address 0xc615 out of bounds>) at gtklabel.c:1005
Ok I took a look at gnome-app-helper.c and gtklabel.c and
I see how the bt correlates to the functions code.
> It is either a bug in the gnome library or the GnomeUIInfo
> structure was not set properly.
Isn't it possible that my development platform could be
missing a key app, like gnu sed or gnu's install program or
something along those lines?
I say that as a possibility, because I read a Solairis Gnome
Install Howto that mentioned those were needed, and I've noticed,
when doing a truss on some of these programs that I get an extra '/'
showing up in paths to applications that are being called, as in:
xstat(2, "./gnome/config-override//Gnome", 0x08047614) Err#2 ENOENT
xstat(2, "/usr/local/etc/gnome/config//Gnome", 0x08047614) Err#2 ENOENT
xstat(2, "./gnome/config//Gnome", 0x08047614) Err#2 ENOENT
xstat(2, "/home/matthew/.gnome//Gnome", 0x08047674) = 0
open("/home/matthew/.gnome//Gnome", O_RDONLY, 0666) = 6
I guess the last two lines do show a file being found
using the odd path.
> It goes always like that. See who called who and what the
> arguments were.
>
> Using the up and down commands you can go up and down the
> stack and look at variables at that context.
Is up and down how I see what variables get set to which values
while moving through a function?
And finally, where does
> > #4 0xbfd95397 in create_label
^^^^^^^^^^
that value come from, or what man page should I look at
for the decoding formula?
Thanks again,
Matt
> Good luck.
>
> Regards,
> Fernando
> Matt Schalit wrote:
> >
> > Hi all,
> >
> > Thanks for reading this. I'm new to debugging and don't understand
> > enough to read a backtrace. I could use a little help with that.
> >
> > I'm running an i586-sco-sysv5uw7.1.1, and getting SIGSEGV's whenever
> > I try to run gnomecc-1.2.2 (gnome control center) via
> > enlightenment-0.16.5. I never see a window.
> >
> > Regardless of whether I try to open any windows in Gnome, as soon
> > as I start the desktop, I do see one warning about MIT-SHM not
> > working correctly and to disable to Enlightenment Pager snapshots.
> > I don't think that issue is relate to gnomecc.
> >
> > Can someone tell me what this means or point me to a nifty howto?
> > Thanks a lot,
> > Matthew
> >
> > ----------------------------------------------------------------------------
> > $ gdb
> >
> > (gdb) file /usr/local/bin/gnomecc
> > Reading symbols from /usr/local/bin/gnomecc...done.
> > (gdb) run
> > Starting program: /usr/local/bin/gnomecc
> > warning: Lowest section in /usr/lib/libdl.so.1 is .hash at 00000094
> > [New LWP 1]
> > [New LWP 2]
> >
> > Program received signal SIGSEGV, Segmentation fault.
> > 0xbfa6f929 in _Xwcslen () from /usr/lib/libX11.so.6.1
> > [New Thread 1]
> > (gdb) bt
> > #0 0xbfa6f929 in _Xwcslen () from /usr/lib/libX11.so.6.1
> > #1 0x400 in ?? ()
> > #2 0xbfa6fa28 in _XwcTextListToTextProperty () from /usr/lib/libX11.so.6.1
> > #3 0xbfb9048b in gtk_label_parse_uline (label=0x8139180,
> > string=0xc615 <Address 0xc615 out of bounds>) at gtklabel.c:1005
> > #4 0xbfd95397 in create_label (label_text=0xbfe0a339 "", keyval=0x8047878)
> > at gnome-app-helper.c:402
> > #5 0xbfd9630e in create_menu_item (menu_shell=0x8137ed0, uiinfo=0x809c770,
> > is_radio=0, radio_group=0x81379f8, uibdata=0x8047988,
> > accel_group=0x812ea40, uline_accels=1, pos=134510536)
> > at gnome-app-helper.c:933
> > #6 0xbfd96f1a in gnome_app_fill_menu_custom (menu_shell=0x8137ed0,
> > uiinfo=0x809c770, uibdata=0x8047988, accel_group=0x812ea40,
> > uline_accels=1, pos=1) at gnome-app-helper.c:1326
> > #7 0xbfd96fa9 in gnome_app_fill_menu_custom (menu_shell=0x812bd28,
> > uiinfo=0x809c84c, uibdata=0x8047988, accel_group=0x812ea40,
> > uline_accels=1, pos=1) at gnome-app-helper.c:1341
> > #8 0xbfd976a1 in gnome_app_create_menus_custom (app=0x812db90,
> > uiinfo=0x809c820, uibdata=0x8047988) at gnome-app-helper.c:1516
> > #9 0xbfd97163 in gnome_app_create_menus (app=0x812db90, uiinfo=0x809c820)
> > at gnome-app-helper.c:1395
> > #10 0x804e967 in create_window () at main.c:200
> > #11 0x804ecf8 in main (argc=1, argv=0x8047a0c) at main.c:282
> > (gdb)
> > -------------------------------------------------------------------------
>
> --
> Fernando Nasser
> Red Hat - Toronto E-Mail: fnasser@redhat.com
> 2323 Yonge Street, Suite #300
> Toronto, Ontario M4P 2C9
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: Need help with a backtrace
2001-02-15 5:33 ` Matt Schalit
@ 2001-02-15 6:17 ` Fernando Nasser
2001-02-15 11:04 ` Matt Schalit
0 siblings, 1 reply; 9+ messages in thread
From: Fernando Nasser @ 2001-02-15 6:17 UTC (permalink / raw)
To: Matt Schalit; +Cc: gdb
Matt Schalit wrote:
>
> Ok. It looks like it only lists an entry when a function
> calls another function, like main() calling printf()?
> But it doesn't seem to list things like loops or if/case tests
> or variable values?
>
Yes, because all information it has are the stack frames, which are
created when a function is called.
When you want to debug something in between, you set a breakpoint in a
line of source code and tell your program to run (or continue if you had
stopped somewhere else before). Of course, all this only work before you
program crashes.
> I know how to write C programs. How would I backtrace or
> step my way through hello-world.c if it exits normally, and
> I just want to see how the trace looks?
>
Insert a breakpoint at that last function (look at the source file and
line number in the bad backtrace). Run your program. When it stops at
the breakpoint use the backtrace command.
> I say that as a possibility, because I read a Solairis Gnome
> Install Howto that mentioned those were needed, and I've noticed,
> when doing a truss on some of these programs that I get an extra '/'
> showing up in paths to applications that are being called, as in:
>
> xstat(2, "./gnome/config-override//Gnome", 0x08047614) Err#2 ENOENT
> xstat(2, "/usr/local/etc/gnome/config//Gnome", 0x08047614) Err#2 ENOENT
> xstat(2, "./gnome/config//Gnome", 0x08047614) Err#2 ENOENT
> xstat(2, "/home/matthew/.gnome//Gnome", 0x08047674) = 0
> open("/home/matthew/.gnome//Gnome", O_RDONLY, 0666) = 6
>
> I guess the last two lines do show a file being found
> using the odd path.
>
Yes, AFAIK the extra "/" won't hurt.
> Is up and down how I see what variables get set to which values
> while moving through a function?
>
You only see what the values of these variables where when the next
function was called. It is a "snapshot".
> And finally, where does
>
> > > #4 0xbfd95397 in create_label
> ^^^^^^^^^^
>
This is the instruction pointer (PC). That is where the CPU was
executing instructions when another function was called or your program
stopped/crashed.
> that value come from, or what man page should I look at
> for the decoding formula?
>
With the GDB sources, there is a nice user manual. It is in the sources
under gdb/doc. It is in a format called "texinfo" which can produce
several different formats like Postcript for instance. You just have to
use "make" with the appropriate type on that directory.
I am sure that if you do a Web search you'll find a HTML on line
version.
W.r.t. your original problem, maybe if you post it to the Gnome list
people will recognize that as a known problem or something. It worth a
try.
Cheers,
Fernando
--
Fernando Nasser
Red Hat Canada Ltd. E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: Need help with a backtrace
2001-02-15 6:17 ` Fernando Nasser
@ 2001-02-15 11:04 ` Matt Schalit
2001-02-15 12:56 ` Fernando Nasser
0 siblings, 1 reply; 9+ messages in thread
From: Matt Schalit @ 2001-02-15 11:04 UTC (permalink / raw)
To: gdb
Fernando Nasser wrote:
>
> Matt Schalit wrote:
Thanks again for the reply. My followup was stuck in Pacbell's
queue for a few days, during which time I figured out how
to make the info files and read them.
Your post definitely helped me and confirmed what I read.
Btw, that was one of the best info files I've ever seen.
It was very intuitive and logical in it's layout.
Thanks to everyone who worked on that, for sure!
Amazing.
Now I finally understand about breakpoints, and will
just have to man handle it a bit until I get good.
They're a bit swamped over in the gnome bugs department,
and I haven't heard anything back on this. Part of the
problem is that there are so many lists that things slip by.
I'll have to post to them again with a better subject line.
------
I'm going to stick a final question in down here, in case you've
read this far :)
In general, when a backtrace gives a really meager output
like the following:
> > (gdb) file /usr/local/cgi-bin/convert
> > (gdb) run
> > Program received signal SIGSEGV, Segmentation fault.
> > 0x80016d76 in ?? () from /usr/lib/libc.so.1
> > (gdb) bt
> > #0 0x80016d76 in ?? () from /usr/lib/libc.so.1
> > #1 0x80016c5c in ?? () from /usr/lib/libc.so.1
> > #2 0x8001826d in ?? () from /usr/lib/libc.so.1
> > #3 0x8001932d in ?? () from /usr/lib/libc.so.1
> > #4 0x80014b20 in ?? () from /usr/lib/libc.so.1
and that's all the lines it output, am I supposed to
put breakpoints into my convert program to see when
it makes a call to a libc function? I can't understand
why there's so little info nor why it left out the function
values.
Thanks again for your help!
Matthew
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Need help with a backtrace
2001-02-15 11:04 ` Matt Schalit
@ 2001-02-15 12:56 ` Fernando Nasser
0 siblings, 0 replies; 9+ messages in thread
From: Fernando Nasser @ 2001-02-15 12:56 UTC (permalink / raw)
To: Matt Schalit; +Cc: gdb
Matt Schalit wrote:
>
> In general, when a backtrace gives a really meager output
> like the following:
>
> > > (gdb) file /usr/local/cgi-bin/convert
> > > (gdb) run
> > > Program received signal SIGSEGV, Segmentation fault.
> > > 0x80016d76 in ?? () from /usr/lib/libc.so.1
> > > (gdb) bt
> > > #0 0x80016d76 in ?? () from /usr/lib/libc.so.1
> > > #1 0x80016c5c in ?? () from /usr/lib/libc.so.1
> > > #2 0x8001826d in ?? () from /usr/lib/libc.so.1
> > > #3 0x8001932d in ?? () from /usr/lib/libc.so.1
> > > #4 0x80014b20 in ?? () from /usr/lib/libc.so.1
>
> and that's all the lines it output, am I supposed to
> put breakpoints into my convert program to see when
> it makes a call to a libc function? I can't understand
> why there's so little info nor why it left out the function
> values.
>
These addresses are inside the libc.so that was probably compiled without debugging symbols. That is why the debugger cannot give you more information.
Unless you are dealing with a bug in libc (very unlikely), just forget about these lines and check how your program called the library function. Probably it called it with a bad argument and causes the crash.
--
Fernando Nasser
Red Hat - Toronto E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2001-02-15 12:56 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-02-15 12:48 Need help with a backtrace Michael Elizabeth Chastain
-- strict thread matches above, loose matches on Subject: below --
2001-02-12 11:46 Michael Elizabeth Chastain
2001-02-12 17:09 ` Matt Schalit
2001-02-12 11:33 Matt Schalit
2001-02-12 11:53 ` Fernando Nasser
2001-02-15 5:33 ` Matt Schalit
2001-02-15 6:17 ` Fernando Nasser
2001-02-15 11:04 ` Matt Schalit
2001-02-15 12:56 ` Fernando Nasser
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox