LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-19-2013, 09:34 PM   #1
xnew2008
LQ Newbie
 
Registered: May 2013
Posts: 5

Rep: Reputation: Disabled
gdb: xxx is not a core dump: File format is ambiguous


I have download gdb from gnu. And compile it with the following command.
./configure --enable-targets=all
make
make install

issue gdb vmlinux vmcore
There is one error information: xxx is not a core dump: File format is ambiguous

Any body can help me fix this issue. thanks in advance.
 
Old 05-20-2013, 06:10 AM   #2
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
Blog Entries: 2

Rep: Reputation: 244Reputation: 244Reputation: 244
How does it work on something simpler - like a "hello world; abort();" program ?
 
Old 05-21-2013, 08:59 PM   #3
xnew2008
LQ Newbie
 
Registered: May 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
Dear linosaurusroot:
thanks your feedback. I wrote one "hello" program to test gdb, it seams that same error information. I have paste all the information here. Could you help check why? thanks.

xinhua@xinhua-ThinkCentre-M81:~/test$ gcc -Wall -g hello.c -c
xinhua@xinhua-ThinkCentre-M81:~/test$ gdb hello.o hello
GNU gdb (GDB) 7.6
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/xinhua/test/hello.o...done.
"/home/xinhua/test/hello" is not a core dump: File format not recognized
 
Old 05-22-2013, 04:56 AM   #4
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
Blog Entries: 2

Rep: Reputation: 244Reputation: 244Reputation: 244
Your commands reveal you are in fact running gdb with a second argument that is not a core file.
Code:
gdb hello.o hello
The above is wrong.

I suggest you try this.
Code:
gcc -Wall -g -o hello hello.c
./hello
gdb hello core
Assuming you are successful with the block just above here then your original problem may be to do with how you called gdb or to do with using it on the kernel as opposed to a userspace program.
 
Old 05-22-2013, 05:11 AM   #5
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,838

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
and actually ./hello must procude a corefile (named core). Using any other file (including any other core file) will give you an error message, the core and app should belong to each other (the name of the corefile is not relevant)
 
Old 05-22-2013, 05:56 AM   #6
xnew2008
LQ Newbie
 
Registered: May 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
Dear linosaurusroot and pan64:
Thanks your mention. It seams that gdb enviroment is ok. The follow is my new try. But when i use it for android kernel dump. still has issue. And crash tool is ok.
$ ulimit -a
$ gcc -Wall -g hello.c
there is new file a.out
$ ./a.out -> there will be one new file "core"
$ gdb a.out core
GNU gdb (GDB) 7.6
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/xinhua/test/a.out...done.
[New LWP 28132]

warning: Can't read pathname for load map: Input/output error.
Core was generated by `./a.out'.
Program terminated with signal 11, Segmentation fault.
#0 0x0000000000400508 in main () at hello.c:5
5 printf("p=%d\n",*p);
 
Old 05-22-2013, 07:24 AM   #7
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,838

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
that looks like the normal (expected) behaviour. I can't see your hello.c, but in line 5 printf("p=%d\n",*p); there is an error which caused the segmentation fault. That was reported by gdb.
I do not know what does that warning means:
warning: Can't read pathname for load map: Input/output error.
 
Old 05-22-2013, 07:59 PM   #8
xnew2008
LQ Newbie
 
Registered: May 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
The follow is hello.c. the printf function used to generate dump.

#include <stdio.h>
int main(void)
{
int *p=NULL;
printf("p=%d\n",*p);
return 0;
}
 
Old 05-23-2013, 02:39 AM   #9
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,838

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
see here https://www.linuxquestions.org/quest...-error-817820/
and also the link at the bottom of that page: http://www.ffnn.nl/pages/articles/li...gger-intro.php
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Core dump analyzing by gdb igalch Linux - Newbie 5 07-01-2013 04:04 AM
[GDB] Core dump analysis and debug info Accinson Programming 1 10-23-2010 10:32 PM
Core dump issues. Program crashes but does not generate core dump file sabeel_ansari Programming 1 10-07-2009 04:23 PM
gdb & core dump Alexlun Programming 4 04-03-2009 10:35 AM
where are core dump files and how to analyse them using gdb manish.chauhan Linux - Software 1 11-21-2007 01:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration