LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Segmentation fault, what does it mean ? (https://www.linuxquestions.org/questions/linux-newbie-8/segmentation-fault-what-does-it-mean-883582/)

Mcfestoe 05-30-2011 03:20 PM

Segmentation fault, what does it mean ?
 
Hi all

I am very new to linux and have had some success so far, many from reading post in here for the last year. I have now come up agaist something that i cant google and get a proper explaination for.

So hoping somebody might be able to explain it.

Iam currently messing about with a Raq4 server and getting the above response, i have post the log below.

Thanks

admin admin]$ su
Password:
[root admin]# cd /romtools
[root /romtools]# dir
backup.rom cobalt-2.10.3-ext3-1M.rom flashtool
[root /romtools]# chmod 777 flashtool
[root /romtools]# ./flashtool -v -r > backup.rom
Segmentation fault
[root /romtools]# ./flashtool -v -r >backup.rom
Segmentation fault
[root /romtools]#

tredegar 05-30-2011 03:27 PM

Welcome to LQ!
segmentation fault usually means that a program is trying to access memory to which it has no rights.

So there is a problem with the way the flashtool program was written, installed or run.

It would help us help you if you told us a bit about which version of linux you are running, and what you are trying to achieve.

T3RM1NVT0R 05-30-2011 03:33 PM

@ Reply
 
Hi there,

A segfault error occurs when an application tries to access that part of memory which a CPU cannot address. In this scenario what happens is that the application sends request to CPU for memory, CPU in turn request the hardware to get that much memory. However, hardware in return send a message to CPU that the memory location it is looking for it either not there or not of the type it is requesting (suppose CPU is looking for r/w memory location and the pointer it is giving is for read only memory location). Once that is done CPU sends a sigsegv signal to application to notify that the memory location it requested if invalid.

In simple language segfault occurs when an application tries to access the memory location which is either not there or not of the type it is looking for.

Can you please paste the output of /var/log/messages

Mcfestoe 05-30-2011 03:54 PM

tredegar,

Thanks for the reply you could have a point there, the file downloaded as flashtool.txt and i read up on making an executable file, this could be where i have gone wrong.

As for the OS i beleive its modified Red Hat (stripped to the bones) and was going to install CentOS but after some more reading unbuntu may also be looked at.

T3RM1NVT0R

That makes sense, i will have a look at the log files and post them.

Mcfestoe 05-31-2011 12:07 PM

Must be doing something wrong as the log files seams empty.

[admin admin]$ su
Password:
[root admin]# tail -f /var/log/messages
May 30 20:26:41 localhost init: Switching to runlevel: 0
May 30 20:26:48 localhost exiting on signal 15
May 31 18:57:32 localhost syslogd 1.3-3: restart.
May 31 18:58:46 localhost init: Switching to runlevel: 6
May 31 18:58:52 localhost exiting on signal 15
May 31 19:00:57 localhost syslogd 1.3-3: restart.
May 31 19:15:00 localhost proftpd[1127]: localhost (localhost[127.0.0.1]) - FTP
session closed.
May 31 19:15:04 localhost telnetd[1135]: ttloop: read: Broken pipe
May 31 19:30:00 localhost proftpd[1840]: localhost (localhost[127.0.0.1]) - FTP
session closed.
May 31 19:30:03 localhost telnetd[1848]: ttloop: read: Broken pipe

johnsfine 05-31-2011 12:38 PM

Quote:

Originally Posted by Mcfestoe (Post 4371315)
[root /romtools]# chmod 777 flashtool

Quote:

Originally Posted by Mcfestoe (Post 4371339)
Thanks for the reply you could have a point there, the file downloaded as flashtool.txt and i read up on making an executable file, this could be where i have gone wrong.

That sounds like either the file was not originally a Linux executable or the download operation modified it.

So I think the file on which you did that chmod operation was not the kind of file for which that operation was constructive (chmod just gives permission for the file to be executed. It doesn't change a file into something that should be executed).

The following command might provide info that would help us determine what kind of a file you really have (done in the directory where that file is located):
Code:

file flashtool
Did you start from some public download site? I expect you misunderstood what was available there and/or how to use it. Rather than guess the details, or have you try complicated tests, it would be much easier if you just post the URL where you got the file(s). Then someone else could just look and see what you got.

Quote:

Segmentation fault, what does it mean ?
It really just means you have a serious problem. To a programmer armed with the source code and a debugger and a fair amount of expertise and experience, "Segmentation fault" may also be important info about a possible starting point for diagnosis. But to an ordinary user, it give nothing beyond "serious problem".

There is a lot of roughly correct info in T3RM1NVT0R's description of what underlies "Segmentation fault". But the result of all that info is only misleading.

Mcfestoe 06-03-2011 10:51 AM

Thanks all

You where all correct, i downloaded the file again from a different source this time it was a .tar file, followed you advice and it worked.


All times are GMT -5. The time now is 10:34 PM.