linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mahavir Jain <mjainp@gmail.com>
To: Fawad Lateef <fawadlateef@gmail.com>
Cc: Andrej Gelenberg <andrej.gelenberg@udo.edu>,
	linux-c-programming@vger.kernel.org
Subject: Re: Hi, Needs suggestions for finding and fixing stack/memory corruption when calling a function
Date: Tue, 24 May 2011 13:59:59 +0530	[thread overview]
Message-ID: <BANLkTimMU-PEop7yJ+U+RsGzft-Y6L4Wcg@mail.gmail.com> (raw)
In-Reply-To: <BANLkTikRoOuKgXC2KpSNGAQkz1_YdTffWA@mail.gmail.com>

On Mon, May 23, 2011 at 8:29 PM, Fawad Lateef <fawadlateef@gmail.com> wrote:
> Hi Andrej,
>
>
> On Mon, May 23, 2011 at 3:45 PM, Andrej Gelenberg
> <andrej.gelenberg@udo.edu> wrote:
>> Hi,
>>
>>
>> heap, stack, buffer overflow? multiple threads? It is bit difficult to
>> suggest something without some code. Have you tried to use gdb or
>> valgrind? (do someone know if valgrind work on arm?)
>>
>
> Thanks for replying.
>
> There is _no_ threading only while(1) loop, we have multiple processes
> communicating through pipes but this problem is happening only in one
> process hence I am assuming that something local to that process is
> corrupting memory.
>
> Our root-filesystem don't have gdb support and I think valgrind is
> _not_ supported on arm :(

Try gdb-server that should fit in small root filesystem.
http://www.delorie.com/gnu/docs/gdb/gdbserver.1.html

>
> Is there any possibility that the problem is related to some compiler
> optimization or something along that line ? We are using gcc-4.2.0
> based tool-chain and Linux kernel 2.6.29.
>
> I can't post the code due to two main reasons: -- Its closed source
> and its too big and I don't think that anyone wants to look at code
> with around 20 cpp files and each file has hundreds of lines of code.
>
> Regards,
>
> Fawad Lateef
>
>> Regards,
>> Andrej Gelenberg
>>
>> On 05/23/2011 04:41 PM, Fawad Lateef wrote:
>>> Hello,
>>>
>>> I need some suggestions about how-to approach, find and fix a memory
>>> corruption issue which is happening in a C/C++ very complex and large
>>> code (code evolved over several years). Code is running on AT91SAM9260
>>> (armv5l architecture; single processor with preemption enabled) and
>>> completely in Linux user-space.
>>>
>>> The problem is:
>>>
>>> -- We are calling a function which has three integer arguments.
>>> With-in that function 2nd and 3rd arguments always gets corrupted
>>> while 1st argument is fine. Just before calling that function printing
>>> arguments is fine.
>>>
>>> Now it will be good if I can get some suggestions about whats
>>> happening and how-to look into this problem. I am thinking that there
>>> is some memory/stack corruption happening somewhere.
>>>
>>> Thanks in advance.
>>>
>>> -- Fawad Lateef
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>



-- 
Thanks,
MJ
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2011-05-24  8:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <BANLkTingN-61wOzWKk7iwxFgo0W2YAzUQQ@mail.gmail.com>
2011-05-23 14:41 ` Hi, Needs suggestions for finding and fixing stack/memory corruption when calling a function Fawad Lateef
2011-05-23 14:45   ` Andrej Gelenberg
2011-05-23 14:59     ` Fawad Lateef
2011-05-24  8:29       ` Mahavir Jain [this message]
2011-05-23 14:59   ` Zhongye Jia
     [not found]   ` <BANLkTimx+=DxYCCqtSKjGWUm63jBAe+iug@mail.gmail.com>
2011-05-24  9:02     ` Fawad Lateef
2011-05-24 12:48       ` Glynn Clements
2011-05-24 15:33         ` Fawad Lateef
2011-05-25 11:07           ` Glynn Clements
2011-06-14 15:25             ` Fawad Lateef

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BANLkTimMU-PEop7yJ+U+RsGzft-Y6L4Wcg@mail.gmail.com \
    --to=mjainp@gmail.com \
    --cc=andrej.gelenberg@udo.edu \
    --cc=fawadlateef@gmail.com \
    --cc=linux-c-programming@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).