kayws426 / embox

Automatically exported from code.google.com/p/embox
0 stars 1 forks source link

Memory corruption in file tests or at lower level #523

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Steps to reproduce:

1. On current trunk version (at revision 8249)
2. Execute several times (5-10): test -n 15
3. Result:

ASSERTION FAILED at src/util/tree.c : 24,
        in function tree_add_link:   

link->par == NULL
kernel debug panic

Backtrace:

     sp        pc         func + offset
     --------  --------  --------------------------
 36  00b34f78  0017cf6d  <__assertion_handle_failure+0x73>
 35  00b34fb8  0017bf74  <tree_add_link+0x75>
 34  00b34fd8  0013c0da  <vfs_add_leaf+0x1e>
 33  00b34ff8  0013c107  <vfs_add_new_path+0x26>
 32  00b35028  0013c1bd  <vfs_add_path+0x5c>
 31  00b35078  0013cda0  <create_new_node+0x1e>
 30  00b350b8  0013d1cf  <kmkdir+0x15b>
 29  00b35318  0013d009  <kcreat+0x1ec>
 28  00b35578  0013c8d2  <kopen+0x92>
 27  00b355c8  001784b0  <open+0x18>
 26  00b355f8  00114c6c  <__test_case_at_line_41+0x20>
 25  00b35628  00177f31  <test_run+0x47>
 24  00b35688  00177e89  <test_case_run+0x52>
 23  00b356b8  00177daf  <test_suite_run+0xa9>
 22  00b356f8  00123e5b  <exec+0x195>
 21  00b35788  001771ba  <cmd_exec+0x27>
 20  00b357a8  0011e997  <run_cmd+0x62>
 19  00b357d8  0011eacb  <shell_line_input+0xed>
 18  00b358f8  0011eb76  <shell_run+0xa9>
 17  00b35cb8  0011eeac  <run_script+0xc7>
 16  00b35ce8  001783cf  <unit_mod_enable+0x53>
 15  00b35d18  00177840  <invoke_mod_enable+0x3d>
 14  00b35d48  00177942  <do_enable+0x53>
 13  00b35d78  00177752  <mod_traverse_rec_safe+0x142>
 12  00b35dc8  00177432  <mod_enable_rec_safe+0x34>
 11  00b35df8  0017744d  <mod_enable+0x19>
 10  00b35e18  00178197  <rl_mod_enable+0x43>
  9  00b35e58  00177840  <invoke_mod_enable+0x3d>
  8  00b35e88  00177942  <do_enable+0x53>
  7  00b35eb8  00177752  <mod_traverse_rec_safe+0x142>
  6  00b35f08  00177432  <mod_enable_rec_safe+0x34>
  5  00b35f38  0017744d  <mod_enable+0x19>
  4  00b35f58  0017830a  <runlevel_enter+0x35>
  3  00b35f88  0017829a  <runlevel_set+0x24>
  2  00b35fb8  001000ea  <init+0x2b> 
  1  00b35fe8  001000a1  <kernel_start+0x10>

Looks like the problem with tree traversal.
In krename when I use tree_foreach_children I also have a problem. It returns 
to me one not first element twice. Maybe this problems related, maybe not.

Original issue reported on code.google.com by ivan.v.t...@gmail.com on 22 Jan 2013 at 7:31

GoogleCodeExporter commented 9 years ago
Didn't try, but I guess that the problem is memory leaks when using node_alloc. 
I recently noticed that neither piece of code, which uses node_alloc, calls 
node_free then.

Does changing fnode_quantity option of embox.fs.node module makes it to crash 
early or later?

Original comment by Eldar.Abusalimov on 22 Jan 2013 at 8:20

GoogleCodeExporter commented 9 years ago
Yes, Eldar right. With fnode_quantity = 32 it crashes on boot. And with 
fnode_quantity = 512 it not crashes at all, but print following error:

embox>test -n 15
        test: running file_test 
        suite fixture setup failed with code -1: Unknown error code. PLEASE REPORT ISSUE 519!
test: Command returned with code -4: Operation interrupted

Original comment by ivan.v.t...@gmail.com on 22 Jan 2013 at 9:01

GoogleCodeExporter commented 9 years ago
Feel free to report issue 519 =)

Original comment by Eldar.Abusalimov on 22 Jan 2013 at 9:19

GoogleCodeExporter commented 9 years ago
i fixed assert() in tree, but poll_alloc after pool_free  works not correctly

Original comment by Gazukin....@gmail.com on 28 Jan 2013 at 6:14

GoogleCodeExporter commented 9 years ago
In current trunk branch:

Welcome to Embox and have a lot of fun!

embox>test -n 15
    test: running embox.test.fs.file_test ... done
embox>test -n 15
    test: running embox.test.fs.file_test ... done
embox>test -n 15
    test: running embox.test.fs.file_test 
    suite fixture setup failed with code -12: Out of memory
test: Command returned with code -4: Operation interrupted
embox>test -n 15
    test: running embox.test.fs.file_test 
    suite fixture setup failed with code -1: Unknown error code. PLEASE REPORT ISSUE 519!
test: Command returned with code -4: Operation interrupted
embox>test -n 15
    test: running embox.test.fs.file_test 
    suite fixture setup failed with code -1: Unknown error code. PLEASE REPORT ISSUE 519!
test: Command returned with code -4: Operation interrupted
embox>

Also, I've tried to change fnode_quantity and it doesn't matter as I could see.

Original comment by ivan.v.t...@gmail.com on 23 Feb 2013 at 6:17

GoogleCodeExporter commented 9 years ago
>> Also, I've tried to change fnode_quantity and it doesn't matter as I could 
see.

Problem is in the embox.fs.filesystem.fs_quantity. I added umount in fat and it 
was fixed. I will commit it soon.

Original comment by Gazukin....@gmail.com on 25 Feb 2013 at 1:00

GoogleCodeExporter commented 9 years ago

Original comment by Anton.Bo...@gmail.com on 10 Jun 2014 at 2:36