minionn icon indicating copy to clipboard operation
minionn copied to clipboard

Segmentation fault (core dumped) when running server.py

Open Cestlaviez opened this issue 5 years ago • 10 comments

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)


Cestlaviez avatar Aug 28 '18 02:08 Cestlaviez

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?

fritzalder avatar Aug 28 '18 18:08 fritzalder

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

Cestlaviez avatar Aug 28 '18 19:08 Cestlaviez

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

manel1874 avatar Aug 29 '18 17:08 manel1874

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,

Cestlaviez avatar Aug 29 '18 17:08 Cestlaviez

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

fritzalder avatar Aug 30 '18 09:08 fritzalder

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.

Cestlaviez avatar Sep 03 '18 17:09 Cestlaviez

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.

fritzalder avatar Sep 06 '18 17:09 fritzalder

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

Ye-D avatar Mar 08 '19 10:03 Ye-D

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

oahcnauygnid avatar Mar 14 '22 02:03 oahcnauygnid

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!

Ye-D avatar Mar 14 '22 02:03 Ye-D