Hello.

 I'm using RT-Linux Release9J.
 And, I found some bugs(?) in this distribution.

 At first:

 In x86_init_stack in schedulers/x86/switch.h, (taks->stack) must be assigned
 more than sizeof(int)*4 bytes memory.
 But in rt_task_init in schedulers/rtl_sched.c, there is no guarantee that
 (task->stack) has more than sizeof(int)*4 bytes.
 I think it is better to add this code.

   --- in rt_task_init
   int *st;
   long interrupt_state;

   if( (task->magic == RT_TASK_MAGIC) || (stack_size <= 0) ){
                                      ^^^^^^^^^^^^^^^^^^^^
     return -EINVAL;
   }

   stack_size += sizeof(int)*4;  /* for x86_init_stack */
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
   st = (int*)kmalloc(stack_size, GFP_KERNEL);

   ... omit :-)

 Ordinaly old code will run successfully, but if (stack_size) is smaller than
 sizeof(int)*4 then it makes a (segmentation fault) error.


 Second:

 In rtf_put in fifos/rtl_fifo.c & rtl_nfifo.c, (count) value is not returned
 correctly. Because at the end of those functions,

 --> return count;
            ^^^^^
 But, (count) is zero if this process is done successfully.
 Because there is such a code in rtf_put.

    count -= chars;
    ^^^^^^^^^^^^^^
 I think this code is more suitable here ....

 --> return written;
            ^^^^^^^

 Third:

 In rt_task_ipc_delete in semaphores/rt_ipc.c

  -- rt_taks_ipc_delete
  int ret = 0;
  if( task->magic != RT_TASK_IPC_MAGIC )
    ret = EINVAL;
          ^^^^^^
  ... omit :-)

 I feel that (ret = EINVAL) is (ret = -EINVAL).
                                      ^^^^^^^

 Fourth:

 In rt_task_delay in semaphores/rt_ipc.h, (rt_schedule) is called but now it is
 (rtl_schedule).


 That's all.

 good-bye.

//----------------------------------------
//   Saida Takao (Kyoto Univ. in Japan)
//   e-mail: [EMAIL PROTECTED]
//----------------------------------------
--- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
----
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/

Reply via email to