All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russell Johnson <russell.johnson@kratosdefense.com>
To: "xenomai@lists.linux.dev" <xenomai@lists.linux.dev>
Subject: Weird debugger behavior with events
Date: Wed, 20 Jul 2022 14:49:01 +0000	[thread overview]
Message-ID: <PH1P110MB1050C461687F096F74A6B1FBE28E9@PH1P110MB1050.NAMP110.PROD.OUTLOOK.COM> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1281 bytes --]

Hello,

 

I have a simple test app with two EVL threads (basics shown below). When I
run the app outside of a debugger, both threads run as expected with no
in-band switches or errors from the EVL core. However, when I run in the
debugger, I am seeing evl_timedwait_event returns -1 when the app is started
and then eventually it finally returns -110 (ETIMEDOUT). It makes it very
hard to debug. I would expect it to run like it does outside of the debugger
- thread 1 should just keep re-calling timedwait as it should keep timing
out. The other weird thing is that if I run thread 1 in the debugger without
thread 2 running, then it will work fine. Any ideas?

 

EVL Thread 1 does the following:

        evl_lock_mutex(&mutex);

        for (size_t i = 0; i < 1000; i++)

        {

            struct timespec tnow;

            evl_read_clock(EVL_CLOCK_MONOTONIC, &tnow);

            tnow.tv_sec += 1;

            int rv = evl_timedwait_event(&event, &mutex, &tnow);

            if ((rv < 0) && (rv != -ETIMEDOUT))

            {

                evl_printf("-1 error ocurred\n");

            }

        }

        evl_unlock_mutex(&mutex);

 

EVL Thread 2 does the following:

    while(true)

    {

        evl_usleep(1000);

    }

 

 

Thanks,

Russell

 

 

 


[-- Attachment #1.2: Type: text/html, Size: 4461 bytes --]

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 6759 bytes --]

             reply	other threads:[~2022-07-20 14:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-20 14:49 Russell Johnson [this message]
2022-07-20 17:33 ` Weird debugger behavior with events Philippe Gerum
2022-07-21 15:40 Russell Johnson
2022-07-23  9:02 ` Philippe Gerum
2022-07-24  8:39   ` Philippe Gerum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=PH1P110MB1050C461687F096F74A6B1FBE28E9@PH1P110MB1050.NAMP110.PROD.OUTLOOK.COM \
    --to=russell.johnson@kratosdefense.com \
    --cc=xenomai@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.