LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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 10-23-2006, 06:48 AM   #1
hsupoyang
LQ Newbie
 
Registered: Oct 2006
Posts: 11

Rep: Reputation: 0
where does SIGSEGV come from?


dear all,
How can I know where does the SIGSEGV signal come from in the application? Since there always got signal 11 in my program and my program signal handling processes that signal, but this should not happen in normal case, there might be something wrong. Can anybody help pointing out the tips? Thanks in advance.

Regards,
 
Old 10-23-2006, 10:01 AM   #2
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
SIGSEGV is the signal for a segmentation fault. This happens whenever your program tries to access a piece of memory that doesn't belong to it.

In what language are you writing your program?

If it's C/C++, try linking in the libefence (electric fence library) or similar tools. You may also want to run some tools to check for memory leaks and stuff like that.

Next time you run into a signal you don't know, try looking in:
Code:
man 7 signal
for instance.

Last edited by timmeke; 10-23-2006 at 10:05 AM.
 
Old 10-24-2006, 01:44 AM   #3
hsupoyang
LQ Newbie
 
Registered: Oct 2006
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by timmeke
SIGSEGV is the signal for a segmentation fault. This happens whenever your program tries to access a piece of memory that doesn't belong to it.

In what language are you writing your program?

If it's C/C++, try linking in the libefence (electric fence library) or similar tools. You may also want to run some tools to check for memory leaks and stuff like that.

Next time you run into a signal you don't know, try looking in:
Code:
man 7 signal
for instance.
thanks very much, but how can I know where does that signal happen? The story is, I am using proftpd and found that everytime I download/upload file onto it, it always disconnect the connection after file transfering was done (and the file is perfectly stored on target), so I cannot do another command until I reconnect to ftp server since the ftp connection is down. By looking up to dmesg, I found the following message:
Quote:
proftpd got unhandled page fault at pc=0x400ccab4, lr=0x4009fca8 (bad address=0x00000070, code 7)
pc : [<400ccab4>] lr : [<4009fca8>] Tainted: P
sp : bfffdd74 ip : 401768d4 fp : bfffe34c
r10: 401761e4 r9 : bfffe358 r8 : 00000072
r7 : 40162fdc r6 : 00000000 r5 : 0207910f r4 : 02079110
r3 : 00000001 r2 : bfffe49c r1 : 00000070 r0 : 00000072
Flags: nZCv IRQs on FIQs on Mode USER_32 Segment user
Control: 4000317F Table: 09B70000 DAC: 00000015
and I cannot find the address 0x400 in the proftpd binary file, so I am looking into the /proc/<fd>/maps:
Quote:
02000000-02081000 r-xp 00000000 01:00 2442 /usr/local/bin/proftpd
02088000-02092000 rw-p 00080000 01:00 2442 /usr/local/bin/proftpd
02092000-020c0000 rwxp 00000000 00:00 0
40000000-40015000 r-xp 00000000 01:00 2122 /lib/ld-2.2.5.so
40015000-40018000 rw-p 00000000 00:00 0
4001c000-4001e000 rw-p 00014000 01:00 2122 /lib/ld-2.2.5.so
4001e000-40023000 r-xp 00000000 01:00 2136 /lib/libcrypt-2.2.5.so
40023000-40026000 ---p 00005000 01:00 2136 /lib/libcrypt-2.2.5.so
40026000-4002b000 rw-p 00000000 01:00 2136 /lib/libcrypt-2.2.5.so
4002b000-40052000 rw-p 00000000 00:00 0
40052000-4016c000 r-xp 00000000 01:00 2127 /lib/libc-2.2.5.so
4016c000-40172000 ---p 0011a000 01:00 2127 /lib/libc-2.2.5.so
40172000-40179000 rw-p 00118000 01:00 2127 /lib/libc-2.2.5.so
40179000-4017d000 rw-p 00000000 00:00 0
4017d000-40187000 r-xp 00000000 01:00 2124 /lib/libnss_files-2.2.5.so
40187000-4018d000 ---p 0000a000 01:00 2124 /lib/libnss_files-2.2.5.so
4018d000-4018f000 rw-p 00008000 01:00 2124 /lib/libnss_files-2.2.5.so
bfff6000-c0000000 rwxp ffff7000 00:00 0
the signal might come from library libc-2.2.5.so, but how can I figure out what should I do to solve this crash?
 
Old 10-24-2006, 02:19 AM   #4
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
Unfortunately, I'm not quite experienced enough in crash investigations to help you with the debugging.

I am wondering about 2 issues though:
1. Are you working with the latest versions of proftpd and the C libs?
2. It's normal for FTP to close the data connection after file transfer, but not the control connection. When a new file transmission begins, another data connection is opened automatically. Maybe there's a problem in the connection closure routine that closes the data connection.
3. Does proftpd have some options to make the output (in the log file) more verbose (ie debug level, etc)? Not sure if this'll help if the problem is indeed coming from one of your C libs, though.
 
Old 10-25-2006, 12:55 AM   #5
hsupoyang
LQ Newbie
 
Registered: Oct 2006
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by timmeke
Unfortunately, I'm not quite experienced enough in crash investigations to help you with the debugging.

I am wondering about 2 issues though:
1. Are you working with the latest versions of proftpd and the C libs?
2. It's normal for FTP to close the data connection after file transfer, but not the control connection. When a new file transmission begins, another data connection is opened automatically. Maybe there's a problem in the connection closure routine that closes the data connection.
3. Does proftpd have some options to make the output (in the log file) more verbose (ie debug level, etc)? Not sure if this'll help if the problem is indeed coming from one of your C libs, though.
1. no, I am not working under the latest version of proftpd, the version is 1.2.10rc3. I've tried hard to port latest version 1.3.0 to my environment, it alway complain the setpgrp and setgrent error while I'm configuring v1.3.0.
2. my case is the ftp server closes not only data connection but also control connection, so I can see "421 Service not available, remote server has closed connection" message at client side, but the file upload/download is completely, problem seems to rise after the data connection, right?
3. yes, i have enable the most detailed log message to see what happened, but still not be able to figure it out, things always happened right after file transfering >_<.
thanks in advance for any kindly hint
 
Old 10-25-2006, 02:01 AM   #6
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
[QUOTE=hsupoyang]1. no, I am not working under the latest version of proftpd, the version is 1.2.10rc3. I've tried hard to port latest version 1.3.0 to my environment, it alway complain the setpgrp and setgrent error while I'm configuring v1.3.0.
[QUOTE]
Can you please provide the exact error messages? Maybe we can make this work somehow...

Quote:
Originally Posted by hsupoyang
2. my case is the ftp server closes not only data connection but also control connection, so I can see "421 Service not available, remote server has closed connection" message at client side, but the file upload/download is completely, problem seems to rise after the data connection, right?
This is a long shot, maybe, but does your client send out TCP keepalive messages to keep the connection open? While downloading/uploading, the control connection may be idle for quite some time, so keepalive messages may be needed to keep the server from closing it down automatically (ie after short time out). I don't know if this is going to help you though, in view of the SIGSEGV issue.

If your library is indeed faulty (or if there is another fundamental problem), you should see abnormal behaviour in other applications too (the C lib is used very commonly). Any messages in the standard system logs (/var/log) or dmesg output? Any other abnormalities observed?

If you don't, then chances are that the problem lies in proftpd's calls to the library. Upgrading is then one option. Switching to another ftpd is an alternative to consider.

Have you google'd to find other people with the same issue with proftpd?
 
Old 10-26-2006, 12:12 AM   #7
hsupoyang
LQ Newbie
 
Registered: Oct 2006
Posts: 11

Original Poster
Rep: Reputation: 0
[QUOTE=timmeke][QUOTE=hsupoyang]1. no, I am not working under the latest version of proftpd, the version is 1.2.10rc3. I've tried hard to port latest version 1.3.0 to my environment, it alway complain the setpgrp and setgrent error while I'm configuring v1.3.0.
Quote:
Can you please provide the exact error messages? Maybe we can make this work somehow...


This is a long shot, maybe, but does your client send out TCP keepalive messages to keep the connection open? While downloading/uploading, the control connection may be idle for quite some time, so keepalive messages may be needed to keep the server from closing it down automatically (ie after short time out). I don't know if this is going to help you though, in view of the SIGSEGV issue.

If your library is indeed faulty (or if there is another fundamental problem), you should see abnormal behaviour in other applications too (the C lib is used very commonly). Any messages in the standard system logs (/var/log) or dmesg output? Any other abnormalities observed?

If you don't, then chances are that the problem lies in proftpd's calls to the library. Upgrading is then one option. Switching to another ftpd is an alternative to consider.

Have you google'd to find other people with the same issue with proftpd?
1. while in configure, it complains about setpgrp and setgrent: "error: cannot check setpgrp when cross compiling" and then the configure process returns so I didn't get the Makefile generated (this is maybe my compile environment didn't support setpgrp and setgrent). So the only way I can do to make it work is to comment out the setpgrp & setgrent related scripts.
2. no, the whole connection disconnected right after upload/download is done, so I have to reconnect if I want to u/d another file.

I don't see other abnormal behaviour in other applications, so that's the weird thing...the message in the log file points out proftpd got signal 11 which is SIGSEGV, and I can see some core dump in the dmesg, there might be some process segmentation fault or something like that, but just cannot figure out where did it happen. And sure, I have googled for every possible key words that come to me but still not be able to find anything related, that's why I came to here to ask help...>_<

Yes, I have upgrade proftpd from 1.2.10rc3 to 1.3.0, and I'm glad taht everything is fine so far, no disconnect any longer...

Thanks all for your kindly responses...

Last edited by hsupoyang; 10-26-2006 at 12:14 AM.
 
Old 10-26-2006, 01:08 AM   #8
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
Quote:
... when cross compiling
Why are you cross compiling?
Can you provide details on your compilation environment?
 
Old 10-27-2006, 12:33 AM   #9
hsupoyang
LQ Newbie
 
Registered: Oct 2006
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by timmeke
Why are you cross compiling?
Can you provide details on your compilation environment?
my compilation environment is under toolkit of system solution provider, basically is arm archietecture, arm-linux-gcc 2.95.2, I think it should be a tiny library since in our target there will not need large library for doing specific things, so the setpgrp & setgrent are not included in this toolkit.
 
  


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
SIGSEGV on various apps macubo Linux - Software 7 12-29-2006 12:42 PM
proftpd SIGSEGV? hsupoyang Linux - Networking 2 10-25-2006 12:43 AM
SIGSEGV everywhere !!! nolimitz Linux - Software 3 08-12-2005 10:14 AM
SIGSEGV after restart KraftMayo Linux - Software 7 10-06-2004 01:17 PM
What is SIGSEGV? zombie_geek Linux - Newbie 2 02-03-2004 07:33 PM


All times are GMT -5. The time now is 07:14 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration