VS Code problem with running an application

Hi

I work on two identical sets: VS Code on Ubuntu + Colibri imx6.dl.

On one of these sets I open a new c/c++ project. The project compiles and starts without any problems.

I then copy the project directory to the other set.
There I open it by executing the “Torizon: Rebuild SDK and reload in container” command,
compile it, and when I run it I get the following message from TERMINAL:

gdbserver: Error disabling address space randomization: Success
/bin/sh: 1: exec: /Test_app/Test_app: Permission denied
During startup program exited with code 126.
Exiting

Application code:

#include <stdio.h>
#include "Test_app.h"
int main(int argc, char const *argv[])
{
    printf("Hello World!\n");
    return 0;
}

OUTPUT log:

[08-16 09:03:02.410] Image not found on target device.
[08-16 09:03:02.411] Exporting local image.
[08-16 09:03:04.135] Image exported, deploying to the target.
[08-16 09:03:13.970] Loading layer - 9aba9eda42e3
[08-16 09:03:14.048] Loading layer - 9aba9eda42e3
[08-16 09:03:14.390] Loaded image ID: sha256:ed9baf6593cf94d5726c09fe2252f63ebe599a0e5a4be53a85a5e48715bec7bd
[08-16 09:03:14.539] Image deployed.
[08-16 09:03:14.544] Deploying application to device...
[08-16 09:03:14.954] sending incremental file list
[08-16 09:03:14.963] created directory /home/torizon/Test_app
[08-16 09:03:14.964] ./
[08-16 09:03:14.964] Test_app
[08-16 09:03:14.980] Restarting application container...
[08-16 09:03:15.317] running startup script...
[08-16 09:03:15.319] Starting new instance...
[08-16 09:03:17.743] Retrieving container information...
[08-16 09:03:17.993] Ready to start debug session.

Please help me to solve the problem.
Greetings
maciej

Hi @maciej ,

Thank you for using the Toradex community.

First of all, I would have some questions about your setup.

From what I understand, you are using two identical setups. So this means you’re using two PCs each one running Ubuntu. Connected to each of the machines is one of our modules, in your case Colibri iMX6DL.

Now, you are trying to run your test script on one of these setups, and then copy the project to the other machine to run it there as well. Am I understanding this right?
Instead of copying, did you try to create the project from scratch on the second machine?`
Do you use GIT for this?

The messages you get in the Terminal, are you talking about the Terminal inside VS Code? And you are running this application inside a container as the user “torizon” is that correct?

Furthermore, I would need some information about the setup you’re using. Information like:

  • HW version of the modules
  • Torizon version
  • Version of Torizon extension for VS code

Additionally, it might be helpful to attach the project folder. So that we could reproduce the same setup here.

Thank you

Best Regards
Kevin

Hi @kevin

Thank you for your reply.

From what I understand, you are using two identical setups.
So this means you’re using two PCs each one running Ubuntu.
Connected to each of the machines is one of our modules, in your case Colibri iMX6DL.

Exactly.

Now, you are trying to run your test script on one of these setups, and then copy the project to the other machine to run it there as well.
Am I understanding this right?

Yes.

Instead of copying, did you try to create the project from scratch on the second machine?`
I don’t know what you mean by scratch…
In VS Code, I open the project with either “Open Folder” and “Torizon: Reload SDK and reopen in container” commands
or “Torizon: Import existing c/c++ application”.
In both cases, the end result is the same.

Do you use GIT for this?
No, I don’t use.

The messages you get in the Terminal, are you talking about the Terminal inside VS Code?
Yes.

And you are running this application inside a container as the user “torizon” is that correct?
Yes.

HW version of the modules: V1.1A
Torizon version: Linux colibri-imx6-10694529 5.4.77-5.3.0+git.a2e5dc80229e #1-TorizonCore SMP Mon Jun 21 11:19:26 UTC 2021 armv7l armv7l armv7l GNU/Linux
Version of Torizon extension for VS code: 1.3.0

Additionally.
When the program executes correctly, the file has the executable attribute:
drwx------ 2 torizon torizon 4096 Sep 16 08:42 .
drwxr-xr-x 18 torizon torizon 4096 Sep 16 14:10 …
-rwxr-xr-x 1 torizon torizon 9356 Sep 17 07:23 Test_app

In the event of an error, do not:

-rw-rw-r– 1 torizon torizon 9356 Sep 16 17:31 Test_app

Best Regards
Maciej

test.zip (19.5 KB)

Hi @maciej ,

Thanks for clarifying and sending the corresponding data.

We will have a look and return to you as soon as possible.

Best Regards
Kevin

Hi @maciej !

I could use your project (build, deploy, run on module) after deleting the old Test_app binary and rebuilding it all. As you correctly noticed, the binary - also inside the project - was not marked as executable.

Could you try it?

I deleted the files:

  • test_app/Test_app
  • test_app/appconfig_0/Test_app/Test_app

Let us know the outcome :slight_smile:

Best regards!