LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-10-2011, 09:35 AM   #1
tsg
Member
 
Registered: Mar 2008
Posts: 155

Rep: Reputation: 30
Upgrade to 13.1 causes segfault in program that ran under 13.0


I have a custom program that has been running on Slackware since about 2004. It was running fine on Slackware 13.0, but an upgrade (following the procedure in UPGRADE.TXT) to 13.1 causes the program to segfault on a read/write op to the serial port (details here).

Can someone give me an idea what might have changed between 13.0 and 13.1 that might affect serial port programming? I've been through CHANGES_AND_HINTS but nothing is jumping out at me.
 
Old 03-10-2011, 02:04 PM   #2
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,897

Rep: Reputation: 578Reputation: 578Reputation: 578Reputation: 578Reputation: 578Reputation: 578
Have you tried re-compiling the program?
 
Old 03-10-2011, 02:09 PM   #3
tsg
Member
 
Registered: Mar 2008
Posts: 155

Original Poster
Rep: Reputation: 30
Yes, it was the first thing I did. I've gone through this before where a re-compile was necessary to get it going again after an upgrade. This is the first time I've not been able to get it going again. Downgrading the machine back to 13.0 got it working again until I can find out what's causing it to crash. I have a suspicion that the upgrade process hosed or failed to update a shared library somewhere. My next step is to try a clean install of 13.1 on another machine that it also crashes on (upgraded the same way) to see if it works.
 
Old 03-10-2011, 03:15 PM   #4
guanx
Senior Member
 
Registered: Dec 2008
Posts: 1,044

Rep: Reputation: 150Reputation: 150
If it's your own program, why not gdb/valgrind it?
 
Old 03-10-2011, 03:45 PM   #5
tsg
Member
 
Registered: Mar 2008
Posts: 155

Original Poster
Rep: Reputation: 30
I have been using gdb, but my libraries were compiled without debug symbols and, to tell the truth, I'm not very good at using gdb. I have a hunch I'm going to have to get a lot better really quickly, though.
 
Old 03-10-2011, 03:50 PM   #6
guanx
Senior Member
 
Registered: Dec 2008
Posts: 1,044

Rep: Reputation: 150Reputation: 150
I use only the bt command of gdb in this case. It that's not enough, then try valgrind, which should always point out exactly where the original error is.
 
Old 03-10-2011, 03:57 PM   #7
tsg
Member
 
Registered: Mar 2008
Posts: 155

Original Poster
Rep: Reputation: 30
gdb on a core dump is telling me the segfault is occurring in a shared library, but since I don't have debugging symbols for it, it isn't very helpful. At least, not to me. I'll check out valgrind. Thanks.
 
Old 03-11-2011, 03:07 AM   #8
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,897

Rep: Reputation: 578Reputation: 578Reputation: 578Reputation: 578Reputation: 578Reputation: 578
Run ldd on the old binary to see what it's looking for.
 
Old 03-11-2011, 03:29 AM   #9
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 3,988

Rep: Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236
I'm thinking of an incompatible toolchain. 13.0 -> 13.1 will have a different basic toolchain used to compile your applications.
 
Old 03-11-2011, 08:28 AM   #10
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,897

Rep: Reputation: 578Reputation: 578Reputation: 578Reputation: 578Reputation: 578Reputation: 578
Yes, if the source code is old, it's quite likely that the newer gcc is choking on some old code syntax.
 
Old 03-11-2011, 09:45 AM   #11
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 3,988

Rep: Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236
yep, GCC is quite advanced. In fact, sometimes way too advanced so it breaks compatibility with older applications
 
Old 03-11-2011, 03:18 PM   #12
tsg
Member
 
Registered: Mar 2008
Posts: 155

Original Poster
Rep: Reputation: 30
Is there someplace I can find out what those changes to the syntax are?
 
Old 03-11-2011, 05:45 PM   #13
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 3,988

Rep: Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236Reputation: 1236
you should be looking at GCC CHANGELOG or Release Notes for that
but that would be painful
 
Old 03-12-2011, 01:29 AM   #14
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,897

Rep: Reputation: 578Reputation: 578Reputation: 578Reputation: 578Reputation: 578Reputation: 578
What errors do you get when trying to compile it?
 
Old 03-14-2011, 07:57 AM   #15
tsg
Member
 
Registered: Mar 2008
Posts: 155

Original Poster
Rep: Reputation: 30
I don't get any errors. It compiles just fine on both 13.0 and 13.1, and runs fine on 13.0, but it segfaults on 13.1.
 
  


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
[SOLVED] Just ran 'slackpkg upgrade-all'..... Now X windows doesn't work. v.segfault wolf2600 Slackware 14 01-23-2011 06:47 AM
Segfault in a program using pthreads rmsrox Programming 6 03-20-2010 07:52 AM
just ran upgrade-system and... xucaen Debian 10 10-09-2006 03:21 PM
Segfault in C++ Program Klesk1337 Programming 8 09-15-2006 11:57 PM
Ran yum upgrade, now cannot boot billquinn Linux - General 1 12-03-2005 12:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:17 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration