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 (core dumped) when running server.py #4

Open
Cestlaviez opened this issue Aug 28, 2018 · 10 comments
Open

Segmentation fault (core dumped) when running server.py #4

Cestlaviez opened this issue Aug 28, 2018 · 10 comments

Comments

@Cestlaviez
Copy link

Hi,
After successfully testing python3 test.py, test_mpc_server.py and test_mpc_client.py, I got an error on running server.py. What's going on?

Thanks!

ww@ww-VirtualBox:~/minionn_1/lib$ python3 test.py
Matching checksum for /home/ww/minionn_1/lib/minionn.cpp --> not compiling

Successfuly imported c++ code

### Basic maths tests
Testing vector operations
Testing matrix multiplication
Normal matmul (b broadcasted)
Row wise matmul (b.T broadcasted)
Testing extract sum
### Homomorphic + precomputation tests
Created directory assets/
Running simple encrypt/decrypt example
Running homomorphic test with random r and v
Testing for correctness
Testing done.
Cleanup
### All tests passed
ww@ww-VirtualBox:~/minionn_1/lib$ cd ..
ww@ww-VirtualBox:~/minionn_1$ python3 server.py -i models/S.onnx
Segmentation fault (core dumped)
ww@ww-VirtualBox:~/minionn_1$ python3 client.py -i models/S.tensor -o models.out.txt
Segmentation fault (core dumped)


@fritzalder
Copy link
Contributor

Hi,
set the -v flag to enable verbose output (see -h for other parameters you can set). Can you send the output of the server and client again with verbose output enabled?

@Cestlaviez
Copy link
Author

Hi,
When I use -v or -h, there is no other detail information coming out.
It is still Segmentation fault (core dumped)

@manel1874
Copy link

manel1874 commented Aug 29, 2018

When I first tried to run python3 test.py I received the same error:

"SEAL requires GNUC >= 6" #error "SEAL requires GNUC >= 6"

I don't know why, but GNUC command is using the x86_64-linux-gnu-gcc files instead the simple gcc. Although in my machine, gcc is running gcc-6, x86_64-linux-gnu-gcc is running its corresponding 5th version.

So, in order to solve this, on the command line, I went to /usr/bin/ and then:

sudo rm x86_64-linux-gnu-gcc
sudo ln -s x86_64-linux-gnu-gcc-6 x86_64-linux-gnu-gcc

I did the above for the following files:
x86_64-linux-gnu-gcc (already done)
x86_64-linux-gnu-gcc-ar
x86_64-linux-gnu-gcc-nm
x86_64-linux-gnu-gcc-ranlib

@Cestlaviez
Copy link
Author

Cestlaviez commented Aug 29, 2018

Great, I think this is the mean reason. Thanks!

But when I test python3 server.py -i models/S.onnx, the error comes,

~/minionn$ python3 server.py -i models/S.onnx -v
Traceback (most recent call last):
  File "server.py", line 29, in <module>
    from common import minionn_onnx_pb2_grpc as minionn_grpc
  File "/home/ww/minionn/common/minionn_onnx_pb2_grpc.py", line 4, in <module>
    from common import minionn_onnx_pb2 as minionn__onnx__pb2
  File "/home/ww/minionn/common/minionn_onnx_pb2.py", line 25, in <module>
    dependencies=[onnx__pb2.DESCRIPTOR,])
  File "/home/ww/.local/lib/python3.6/site-packages/google/protobuf/descriptor.py", line 878, in __new__
    return _message.default_pool.AddSerializedFile(serialized_pb)
TypeError: Couldn't build proto file into descriptor pool!
Invalid proto descriptor for file "minionn-onnx.proto":
  minionn-onnx.proto: Import "onnx.proto" has not been loaded.
  minionn.PrecomputationResponse.model: ".onnx.ModelProto" is not defined.

I think it is related to protobuf, but I don't know what to do. Have you ever received the same errors?
Thanks,

@fritzalder
Copy link
Contributor

Good catch on the gcc version @manel1874 ! Sadly this is one of these things that we can not really test with our capabilities here :)

@Cestlaviez : Actually this looks like you do not have onnx installed. That goes on me as I forgot to add it to the Installation notice. Try pip install onnx and I hope that should fix your problem. I will add it to the Readme

@Cestlaviez
Copy link
Author

Hi @fritzalder ,
I have installed onnx, but it still has this issue. I think it probably failed to import "onnx.proto" to minionn-onnx.proto.
When I using grpc generation,
python3 -m grpc_tools.protoc -I./ --python_out=../common/ --grpc_python_out=../common/ minionn-onnx.proto onnx.proto,
it generated minionn_onnx_pd2.py, minionn_onnx_pd2_grpc.py, onnx_pd2.py and onnx_pd2_grpc.py. And I didn't find _TENSORPROTO in minionn_onnx_pd2.py.

@fritzalder
Copy link
Contributor

You do not need to generate your own GRPC sources. They already exist in the common folder. If you really want to regenerate them, read the Readme in the proto subfolder. You will need to manually edit the generated grpc files so that they use the installed onnx library instead of a library that GRPC assumes. I think I have all necessary steps in the proto folder Readme. But as I said, the default grpc files from the common folder should work just fine.

@Ye-D
Copy link

Ye-D commented Mar 8, 2019

Hi @Cestlaviez
I have the same problem as you when run
~/minionn$ python3 server.py -i models/S.onnx -v
Traceback (most recent call last):
File "server.py", line 29, in
from common import minionn_onnx_pb2_grpc as minionn_grpc
File "/home/ww/minionn/common/minionn_onnx_pb2_grpc.py", line 4, in
from common import minionn_onnx_pb2 as minionn__onnx__pb2
File "/home/ww/minionn/common/minionn_onnx_pb2.py", line 25, in
dependencies=[onnx__pb2.DESCRIPTOR,])
File "/home/ww/.local/lib/python3.6/site-packages/google/protobuf/descriptor.py", line 878, in new
return _message.default_pool.AddSerializedFile(serialized_pb)
TypeError: Couldn't build proto file into descriptor pool!
Invalid proto descriptor for file "minionn-onnx.proto":
minionn-onnx.proto: Import "onnx.proto" has not been loaded.
minionn.PrecomputationResponse.model: ".onnx.ModelProto" is not defined.
Have you solved it ? Thank you very much

@oahcnauygnid
Copy link

Hi @Cestlaviez @Ye-D
i meet the same error. Have you either solved it? Thanks a lot.

@Ye-D
Copy link

Ye-D commented Mar 14, 2022

Hi @Cestlaviez @Ye-D i meet the same error. Have you either solved it? Thanks a lot.

My problem lies in the grpc. I re-generated the .proto files to fix the bug. Hope this helps you!

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

No branches or pull requests

5 participants