DPDK usage discussions
 help / color / mirror / Atom feed
* [dpdk-users] segmentation fault in lthread_run() on ARM64 processor - regarding
@ 2020-02-11 10:16 hema sai chandra
  0 siblings, 0 replies; only message in thread
From: hema sai chandra @ 2020-02-11 10:16 UTC (permalink / raw)
  To: tomaszx.kulasek, ian.betts; +Cc: users, dev

Hi,
    I am trying to launch a function called lthread_init(), on a logical
core using rte_eal_remote_launch from main (), then creating an lthread
which has only lthread_exit() in the thread body and lthread_run() in the
lthread_init() and then calling a function lthread_main_spawner() from
main(), which creates an lthread (lthread_spawner ) and a scheduler
lthread_run (), this lthread_spawner() creates three more lthreads, you can
see the code below

main ()
{

      /** rte_eal_init () and other necessary initialisations */
      ....
      rte_eal_remote_launch ( lthread_init, NULL, 2);
      lthread_main_spawner(NULL);
}
static int lthread_init ( void *arg )
{
     struct lthread *lt;
     lthread_create ( &lt, -1, lthread_start, NULL );
     lthread_run();
     return 0;
}
static void *lthread_start ( void *args )
{
      ....
      lthread_exit( NULL );
      return NULL;
}
static int lthread_main_spawner ( void *arg )
{
     struct lthread *lt;
     lthread_create ( &lt, -1, lthread_spawner, NULL );
     lthread_run();
     return 0;
}
static void *lthread_spawner ( void )
{
      struct lthread *lt1, *lt2, *lt3;
      lthread_create ( &lt1, -1, fun1, NULL );
      lthread_create ( &lt2, -1, fun2, NULL );
      lthread_create ( &lt3, -1, fun3, NULL );
      lthread_sleep ( 1000 );
      lthread_join ( lt1, NULL );
      lthread_join ( lt2, NULL );
      lthread_join ( lt3, NULL );
      return NULL;
}
void fun1 ()
{
   while ( 1)
  {
      printf (" in lthread 1 \n");
      lthread_yield();
   }
}
void fun2 ()
{
   while ( 1)
   {
     printf (" in lthread 2 \n");
     lthread_yield();
   }
}
void fun3 ()
{
  while ( 1)
  {
     printf (" in lthread 3 \n");
     lthread_yield();
  }
}

the code is working fine in x86 systems but it is getting segmentation
fault on ARM64 processor with 4 logical cores at ctx_switch () function in
_lthread_resume() which is called from lthread_run() function.
I even tried just creating an lthread in a function called from
rte_eal_remote_launch(), but i am getting the same issue

Can you please help me in debugging the issue, is there any implementation
changes need to be done ?

Thanks and Regards,
Hemasai.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-02-12 18:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-11 10:16 [dpdk-users] segmentation fault in lthread_run() on ARM64 processor - regarding hema sai chandra

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).