Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault with aes.cpp in Examples_Rpi #30

Open
jaggarwal96 opened this issue Nov 11, 2018 · 12 comments
Open

Segmentation fault with aes.cpp in Examples_Rpi #30

jaggarwal96 opened this issue Nov 11, 2018 · 12 comments
Assignees
Labels

Comments

@jaggarwal96
Copy link

jaggarwal96 commented Nov 11, 2018

So I followed the steps you have in the readme to install the library and run it on a raspberry pi. However when I try to run the aes.cpp (with no modifications) I get a seg fault.

I am using Raspberry pi 3 which is running Raspbian OS. I know that the libraries are installed fine because when I run test_vectors.cpp it produces the expected output. One thing is notice is that the makefile generates a .so file for aes.cpp but for test_vectors is only creates an executable which makes me wonder if something in the makefile is not working.

Would you have any ideas as to why this would be happening?

@spaniakos
Copy link
Owner

spaniakos commented Nov 12, 2018 via email

@spaniakos spaniakos self-assigned this Nov 12, 2018
@jaggarwal96
Copy link
Author

jaggarwal96 commented Nov 12, 2018

Hello thanks for getting back to me.

I see. So I do have a printf in the main as the first line but even that is not printed which makes me wonder if the error could be because of faulty linking of the libraries from the makefile. Do you think that would be an issue?

@spaniakos
Copy link
Owner

spaniakos commented Nov 12, 2018

can you try :

sudo make clean
sudo make install
cd examples_Rpi
make clean
make
sudo ./sketch name

I remember when I was initially building the library I had soem segmentation faults, cant recall the reason, but i think it was something with the install or the sudo.

other than that, I or you since i yet not own a V3 have to check the CFLAGS
and g++ handlers in the makefiles (the library and the example make file)

I assume they are correct else the make install would fail.
BTW is there any error message while the make install and or make?

We will manage to solve the problem.

@spaniakos
Copy link
Owner

do we have an update from the segmentation fault from your side ?

@jaggarwal96
Copy link
Author

Not yet, I have not been able to go to work on it. From what I remember though there wasn't any error on installing but I'll get back to you once I reinstall.

@jaggarwal96
Copy link
Author

2018-11-14-132252_1824x984_scrot
So I did not get any errors in the install. I have attached a screenshot of the above said commands for you.

@jaggarwal96
Copy link
Author

So I was looking further into the architecture type of my pi and this is what I found when I did a cpuinfo. I think I'll have to change the flags for the compiler accordingly. What are your thoughts?
2018-11-14-144630_1824x984_scrot

@spaniakos
Copy link
Owner

spaniakos commented Nov 15, 2018 via email

@spaniakos
Copy link
Owner

can you run cpp -dM ./dummy.hxx |\grep -i -e linux -e arm -e ARDUINO_X86
and show me the results ?

@spaniakos
Copy link
Owner

@jaggarwal96 can you please try with the changes pointed our at #32 issue, and report back? the file change is : AES_config.h at line 8
from
#if (defined(__linux) || defined(linux)) && !(defined(__ARDUINO_X86__) || defined(__arm__))
to
#if (defined(__linux) || defined(linux) || defined(__arm__)) && !(defined(__ARDUINO_X86__))

@spaniakos spaniakos added bug and removed question labels Nov 22, 2018
@PabloGN
Copy link

PabloGN commented Nov 22, 2018

can you run cpp -dM ./dummy.hxx |\grep -i -e linux -e arm -e ARDUINO_X86
and show me the results ?

In order to use this command you have to do touch dummy.hxx ( taken from https://stackoverflow.com/questions/2565979/macros-for-gcc-g-to-differentiate-linux-and-mac-osx#2567848 )

@jaggarwal96
Copy link
Author

Here is the output
2018-11-25-164742_1824x984_scrot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants