2010-09-06 21:58:36     process was killed when writing the hardisk

Document created by Aaronwu Employee on Aug 23, 2013
Version 1Show Document
  • View in full screen mode

2010-09-06 21:58:36     process was killed when writing the hardisk

steven O (AFGHANISTAN)

Message: 93198   

 

hi :

 

     when i writed files into the harddisk , my process was killed.  it  seen that there was no enough memory to be used.  my test code as following :

 

#define PTH_NUM  32

 

static unsigned int pth_para[PTH_NUM];

static unsigned int file_num[PTH_NUM];

 

void * pthread_fun (void * para)

{

FILE * fd;

int count;

int len;

char buf[128];

unsigned int id;

 

if (! para) return NULL;

 

id = * (unsigned int *) para;

 

printf("pthread id : %02d\n", id);

 

if(id >= PTH_NUM) return NULL;

 

file_num[id] = 0;

 

while(1) {

  snprintf(buf, 128, "/mnt/%02d_test%06d", id, file_num[id]);

  file_num[id]++;

  fd = fopen(buf, "wb");

  if (! fd) {

   perror("open file");

   return NULL;

  }

 

  count = 0;

  snprintf(buf, 128, "test data | ");

  len = strlen(buf);

  rewind(fd);

 

  while (1) {

   fwrite(buf, 1, len, fd);

   count += len;

   if((count % 120) == 0) {

    fprintf(fd, "\n");

   }

   if (count >= 64 * 1024 * 1024) {

    break;

   }

  }

 

  fclose(fd);

}

 

return 0;

}

 

int main (int argc, char **argv)

{

int i;

pthread_t tid[PTH_NUM];

 

for (i = 0; i < PTH_NUM; i++) {

  pth_para[i] = i;

  pthread_create (&tid[i], NULL, pthread_fun, &pth_para[i]);

}

 

while(1) {

  sleep(5);

}

 

return 0;

}

 

 

i don't  use the dynamic memory  , why the memory was lost too much?  is it writing data too fast here????

QuoteReplyEditDelete

 

 

2010-09-07 00:18:36     Re: process was killed when writing the hardisk

Sonic Zhang (CHINA)

Message: 93199   

 

Which blackfin board do you use? What is the error log when the process is killed?

QuoteReplyEditDelete

 

 

2010-09-07 01:05:44     Re: process was killed when writing the hardisk

steven O (AFGHANISTAN)

Message: 93201   

 

BF533-EZKIT, 2008R1, no error information was printed.  the hard disk indicator is always in the light 。so i think the hardisk not work well except reseting. and all the command in shell can't run any more, they were killed at once.

QuoteReplyEditDelete

 

 

2010-09-07 01:52:15     Re: process was killed when writing the hardisk

Sonic Zhang (CHINA)

Message: 93202   

 

Could you update to 2009R1.1? 2008R1 is out of date.

 

If you run all thread in sequence, you may avoid the out of memory issue. Otherwise, 64M bytes * 32 files * 32 threads consume too much VFS buffers concurrently.

QuoteReplyEditDelete

 

 

2010-09-08 00:22:23     Re: process was killed when writing the hardisk

steven O (AFGHANISTAN)

Message: 93229   

 

i test it last night again,  and printing following message now.

 

EXT2-fs error (device hda1): read_block_bitmap: Cannot read block bitmap - block_group = 0, block_bitmap = 11

EXT2-fs error (device hda1): read_block_bitmap: Cannot read block bitmap - block_group = 0, block_bitmap = 11

EXT2-fs error (device hda1): read_block_bitmap: Cannot read block bitmap - block_group = 0, block_bitmap = 11

EXT2-fs error (device hda1): read_block_bitmap: Cannot read block bitmap - block_group = 0, block_bitmap = 11

EXT2-fs error (device hda1): read_block_bitmap: Cannot read block bitmap - block_group = 0, block_bitmap = 11

EXT2-fs error (device hda1): read_block_bitmap: Cannot read block bitmap - block_group = 0, block_bitmap = 11

end_request: I/O error, dev hda, sector 151

end_request: I/O error, dev hda, sector 63

end_request: I/O error, dev hda, sector 63

EXT2-fs error (device hda1): read_block_bitmap: Cannot read block bitmap - block_group = 0, block_bitmap = 11

end_request: I/O error, dev hda, sector 63

end_request: I/O error, dev hda, sector 63

EXT2-fs error (device hda1): read_block_bitmap: Cannot read block bitmap - block_group = 0, block_bitmap = 11

EXT2-fs error (device hda1): read_block_bitmap: Cannot read block bitmap - block_group = 0, block_bitmap = 11

end_request: I/O error, dev hda, sector 63

EXT2-fs error (device hda1): read_block_bitmap: Cannot read block bitmap - block_group = 0, block_bitmap = 11

EXT2-fs error (device hda1): read_block_bitmap: Cannot read block bitmap - block_group = 0, block_bitmap = 11

EXT2-fs error (device hda1): read_block_bitmap: Cannot read block bitmap - block_group = 0, block_bitmap = 11

EXT2-fs error (device hda1): read_block_bitmap: Cannot read block bitmap - block_group = 0, block_bitmap = 11

end_request: I/O error, dev hda, sector 63

 

it seens that the hardware had something wrong,  is it right?? can you give me some advice?

QuoteReplyEditDelete

 

 

2010-09-08 02:10:38     Re: process was killed when writing the hardisk

Sonic Zhang (CHINA)

Message: 93234   

 

This doesn't look like a out of memory issue. Check your disk driver.

QuoteReplyEditDelete

 

 

2010-09-08 07:56:37     Re: process was killed when writing the hardisk

steven O (AFGHANISTAN)

Message: 93260   

 

where can download the latest driver ?

 

by the way , why my browser can't display the post button?????

QuoteReplyEditDelete

 

 

2010-09-09 00:09:41     Re: process was killed when writing the hardisk

Sonic Zhang (CHINA)

Message: 93276   

 

Use firefox other than IE

QuoteReplyEditDelete

 

 

2010-09-09 10:13:49     Re: process was killed when writing the hardisk

steven O (AFGHANISTAN)

Message: 93302   

 

the ide driver doesn't support the samsung hardisk, the other hardisk works well.  i don't know the difference between them.

 

can you give me some information ?

QuoteReplyEditDelete

 

 

2010-09-13 09:38:10     Re: process was killed when writing the hardisk

steven O (AFGHANISTAN)

Message: 93383   

 

now, if  i do nothing,  the process writing the hadisk runs well.  but  if there are many documents in de harddisk and i do the "ls" command,  the writing process was killed sometimes. i know the "ls" command needs a lots of memory and the memory is very nervous,  so the system will invoke the swap process . i just have a question, this case is normal? if not,  what should i do? thanks.

QuoteReplyEditDelete

 

 

2010-09-14 00:32:07     Re: process was killed when writing the hardisk

Sonic Zhang (CHINA)

Message: 93396   

 

Don't write so many files concurrently or don't run ls at the same time.

QuoteReplyEditDelete

 

 

2010-09-15 23:26:00     Re: process was killed when writing the hardisk

steven O (AFGHANISTAN)

Message: 93479   

 

does 2008r1-8 toolchain support  the large file option in default ??

QuoteReplyEditDelete

 

 

2010-09-16 00:17:48     Re: process was killed when writing the hardisk

Sonic Zhang (CHINA)

Message: 93481   

 

large file support is included in uClibc full rpm package. Which uClibc rpm did you install?

 

In addition, 2008R1 is not supported any more. Please upgrade to 2009R1.1.

QuoteReplyEditDelete

 

 

2010-09-16 00:28:04     Re: process was killed when writing the hardisk

steven O (AFGHANISTAN)

Message: 93482   

 

i am using blackfin-toolchain-uclibc-full-08rl-8 now ,  i just want to upgrade the toolchain to 2009R1.1,  the kernel also use the 2008R1, is it OK?

QuoteReplyEditDelete

 

 

2010-09-16 01:31:05     Re: process was killed when writing the hardisk

Sonic Zhang (CHINA)

Message: 93483   

 

No. See   docs.blackfin.uclinux.org/doku.php?id=faq

QuoteReplyEditDelete

 

 

2010-09-16 21:44:45     Re: process was killed when writing the hardisk

steven O (AFGHANISTAN)

Message: 93517   

 

i can't open the link. i need your help, please give me some advice.

QuoteReplyEditDelete

 

 

2010-09-17 00:20:11     Re: process was killed when writing the hardisk

Sonic Zhang (CHINA)

Message: 93521   

 

The link says you should use the same toolchain and Linux distribution release. Such as 2009R1.1.

QuoteReplyEditDelete

 

 

2010-09-17 22:17:03     Re: process was killed when writing the hardisk

steven O (AFGHANISTAN)

Message: 93568   

 

Hi , sonic

 

      i catched the following message by using "dmesg" command :

 

EXT2-fs error (device hda1): read_block_bitmap: Cannot read block bitmap - block_group = 419, block_bitmap = 13729803

end_request: I/O error, dev hda, sector 109838487

end_request: I/O error, dev hda, sector 63

EXT2-fs error (device hda1): read_block_bitmap: Cannot read block bitmap - block_group = 419, block_bitmap = 13729803

end_request: I/O error, dev hda, sector 109838487

end_request: I/O error, dev hda, sector 63

EXT2-fs error (device hda1): read_block_bitmap: Cannot read block bitmap - block_group = 419, block_bitmap = 13729803

end_request: I/O error, dev hda, sector 109838487

end_request: I/O error, dev hda, sector 63

EXT2-fs error (device hda1): read_block_bitmap: Cannot read block bitmap - block_group = 419, block_bitmap = 13729803

Out of memory: kill process 213 (sport_test) score 45 or a child

Killed process 213 (sport_test)

Out of memory: kill process 208 (sh) score 13 or a child

Killed process 208 (sh)

end_request: I/O error, dev hda, sector 109576367

end_request: I/O error, dev hda, sector 63

 

      which case will lead to invoke breath function failed ?  the problem puzzle me long time, please help me, thanks

QuoteReplyEditDelete

 

 

2010-09-17 22:20:15     Re: process was killed when writing the hardisk

steven O (AFGHANISTAN)

Message: 93569   

 

Sorry, thar is bread function.

QuoteReplyEditDelete

 

 

2010-09-17 22:24:57     Re: process was killed when writing the hardisk

steven O (AFGHANISTAN)

Message: 93570   

 

read_block_bitmap  sb_bread function

QuoteReplyEditDelete

 

 

2010-09-20 02:18:18     Re: process was killed when writing the hardisk

Sonic Zhang (CHINA)

Message: 93624   

 

May be problem in your disk driver. Try the same operation on a USB storage device first.

QuoteReplyEditDelete

 

 

2010-09-21 03:34:06     Re: process was killed when writing the hardisk

steven O (AFGHANISTAN)

Message: 93693   

 

i use the mke2fs to format the /dev/hda1,  if the space of hda1 less than 2G. the operation run successfully.  if not,  the operation failed.  it seems that the uClibc don't support the LFS option.  but the uClibc spportted LFS option in default.  why ?

Attachments

    Outcomes