LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 05-26-2007, 06:13 AM   #1
sekhar
LQ Newbie
 
Registered: May 2007
Posts: 8

Rep: Reputation: 0
memory issue with MPC8xx PPC .


Hi Guys !!!!!!
I m working on MPC8XX . i wrote a simple program, of allocating memory,memset to 0 , free the memory.

memset to any other ASCII character works fine.but to 0 fails

when i allocate to 100, 1000 bytes i don't have any issue. when i do for 10,000 bytes i receive a segfault. I m strugling for a long time . is there any problem of memset with my toolchain . need any more data i can provide . This is my first thread and new to linux. so plea try to help me.

bye
sekhar

Last edited by sekhar; 05-26-2007 at 06:15 AM.
 
Old 05-26-2007, 08:22 AM   #2
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 78
Perhaps you could show us some code? (Enclose any code in [code] and [/code].)
 
Old 05-27-2007, 10:36 PM   #3
sekhar
LQ Newbie
 
Registered: May 2007
Posts: 8

Original Poster
Rep: Reputation: 0
This is the main part of the code where i m allocating and deallocating :

In this piece of code :
l_iCount is the no of times i want to allocate and deallocate
l_iSize is the chunk of bytes
both of them are command line arguments .


/* Allocating and Deallocating l_iSize bytes l_iCount times */
for(l_iIndex = 0; l_iIndex < l_iCount ; l_iIndex++)
{
l_pcTemp = (char *)malloc(l_iSize);
if(NULL == l_pcTemp)
{
printf("Memory allocation failed \n");
exit(1);
}
memset(l_pcTemp,0,l_iSize);
free(l_pcTemp);
}


memset to any ASCII works fine when i run the binary of the cross compiled one on the board.


thanks for the reply . waiting for the same ...

bye
sekhar
 
  


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
[('package xvidcore-1.1.2-1.lvn6 is intended for a ppc architecture', (0, 'ppc', 0L)) kmaimon Linux - Software 2 03-27-2007 12:14 PM
pmac_zilog: irda_setup issue on boot (2.6.8 PPC) RavenOfOdin Debian 0 07-22-2006 05:01 PM
Memory issue jax79sg Programming 7 09-30-2004 12:14 AM
memory issue sachin_keluskar Linux - Hardware 1 07-27-2004 10:58 AM
mandrake 8.2 on PPC --keyboard issue randomx Linux - Distributions 1 04-04-2003 11:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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