LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-14-2012, 08:04 PM   #1
5883
Member
 
Registered: Aug 2004
Posts: 173

Rep: Reputation: 0
segmentation fault as soon as entering 1 function in the arm processor board


Hi everyone,

i'm lost on this one, can someone give me some hints ?

1. downloaded latest stunnel package from web
2. build in the host linux and runs fine
3. build for arm target (am using the same settings from before,
my task is to upgrade to latest stunnel)
4. builds ok, when run in arm board, seg fault.
5. from gdb core,

[New LWP 867]
Cannot access memory at address 0x70797263
(gdb) bt
#0 parse_commandline (name=0xbefdce29 "/opt/ultra/config/stunnel.conf",
parameter=0xbefdce48 "-version") at options.c:1940
#1 0x0003ba04 in main_configure (
arg1=0xbefdce29 "/opt/ultra/config/stunnel.conf",
arg2=0xbefdce48 "-version") at stunnel.c:199
#2 0x0003bd44 in main_unix (argv=<optimized out>, argc=<optimized out>)
at stunnel.c:135
#3 main (argc=3, argv=0xbefdcd24) at stunnel.c:110


my question is, it crashed when just entering parse_commandline( ),
the 2 arguments look fine to me.
How could this happen ?

Many thanks !
 
Old 12-14-2012, 08:17 PM   #2
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
I know zero about ARM, so forgive me if I'm wildly off track here but ...

That sure looks like a calling convention error. Each architecture has rules on how parameters are passed (on the stack or in which registers, etc.). But there are compiler options and various incantations in the source code that can select alternate rules for passing parameters.

The functions seems to have been compiled with different rules for how parameters are passed than the caller was compiled with.

My best estimate is that the caller has some text on its stack and the called function looks in that place on the caller's stack to find its a parameter (which is a pointer to text) so it ends up trying to use text as if it were a pointer to text.

If I'm on the right track at all, then gdb is in agreement with the caller regarding the way parameters are passed.

Last edited by johnsfine; 12-14-2012 at 08:26 PM.
 
  


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
Compiled OpenVPN returns a Segmentation Fault when runned on an ARM Board Berris.Oliver Linux - Networking 7 02-23-2012 10:06 AM
segmentation fault in arm edb9315a for helloworld.c application boopathisivakumar Linux - Software 3 03-09-2011 09:10 AM
segmentation fault on arm linux golden_boy615 Programming 0 03-10-2009 01:56 PM
Cross-compiled wireless_tools_v29 caused segmentation fault on arm-platform mailerlee Linux - Wireless Networking 0 02-26-2008 04:01 AM
segmentation fault w/ c++ function call wsimmons Programming 3 10-16-2001 02:06 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:41 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