LinuxQuestions.org
Help answer threads with 0 replies.
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 11-11-2010, 05:22 AM   #1
vlasovla
LQ Newbie
 
Registered: Nov 2010
Posts: 2

Rep: Reputation: 0
General protection in /var/log/messages, how to find related source line?


Hi.

SuSE SLES10, 32 bit.
I have an app which crashes with general protection often.
There is message every time in /var/log/messages:
2010-10-22T08:49:49.350476+02:00 HostName kernel: ProgramName[28023] general protection rip:404575 rsp:7fffc5656270 error:0
How do I establish relation between this message and source code?

Error was observed on another host where some tests were running, now license is expired and I can't get more info nor core dump.
I have to investigate what I have and try to reproduce it locally.

Unfortunately original binary was stripped.
Now I prepared non-stripped version.
Does it has the same addresses for function as original?
Is it possible to use symbol information for finding where RIP points to?
 
Old 11-11-2010, 02:17 PM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
IF, and only IF, the non-stripped version was built with EXACTLY the same options, compiler version, and libaries as the stripped, then the addresses should still be the same.

These errors are caused by a bad pointer dereference in your system. It is essentially the same as a segfault, but occurs before segmentation checking when it checks if the address is valid (only certain x86-64 addresses are currently valid).[1] RIP is the 64-bit instruction pointer and RSP is the 64-bit stack pointer.[2] See [2] for more information on debugging using this information to find your issue.

[1] http://lists.opensuse.org/opensuse-a.../msg00195.html
[2] http://stackoverflow.com/questions/1...ow-to-use-them
 
Old 11-16-2010, 03:23 AM   #3
vlasovla
LQ Newbie
 
Registered: Nov 2010
Posts: 2

Original Poster
Rep: Reputation: 0
Thank you for help.

Actually I have already found these links prior to topic creation.
After your message I have checked them one more time and found that they are much more useful than it seems to be first time.

I did like this:
1) build the same sources in the same environment as for faulty executable (this is simple, environment is tracked by version control system) and tell linker to create a map file.
2) open map file and find RIP here.

Doing like this I managed to find function where crash has occurred.

I think that it is right way because function deals with memory allocation and has some updates for migration from 32 bit architecture to 64 bit. As soon as only certain 64 bit pointers are valid currently, I expect that there is some wrong allocation or conversion.

Now I'm trying to reproduce issue and test this piece of code.

What do you think about technique which I have used?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
/var/adm/messages vs /var/log/messages gomes1333 Linux - General 1 04-06-2010 04:08 AM
Small bash script to find 'error' in /var/log/messages rolypoly Programming 3 10-28-2008 08:55 AM
/var/log/messages and /var/log/cron not working sigkill Linux - Software 6 08-09-2008 01:08 PM
Redirecting the kernel messages to file other than /var/log/messages jyotika_b83 Linux - General 3 04-28-2005 06:39 PM
/var/log/message : kernel: general protection fault: 0000 philipina Linux - General 0 08-05-2004 05:21 AM

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

All times are GMT -5. The time now is 06:29 AM.

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