snwagh/securenn-public

Standalone (make mnistSA) segfaults on full parsed MNIST dataset

Opened this issue · 1 comments

Hello!

First off big fan of your work!

I am having some issues with running the standalone (make mnistSA, where I edit mnist to true in globals) I always get a segfault.

GDB gives me the following

Program received signal SIGSEGV, Segmentation fault.
0x000055555555ea06 in CNNLayer::updateEquationsSA (this=0x5555557fc260, prevActivations=std::vector of length 100352, capacity 100352 = {...}) at src/CNNLayer.cpp:357
357							temp[i] += deltaRelu[loc];
(gdb) backtrace
-0  0x000055555555ea06 in CNNLayer::updateEquationsSA (this=0x5555557fc260, prevActivations=std::vector of length 100352, capacity 100352 = {...}) at src/CNNLayer.cpp:357

0x000055555555d62a in CNNLayer::updateEquations (this=0x5555557fc260, prevActivations=std::vector of length 100352, capacity 100352 = {...}) at src/CNNLayer.cpp:187

0x00005555555981a9 in NeuralNetwork::updateEquations (this=0x5555557fe0b0) at src/NeuralNetwork.cpp:125

0x00005555555979d5 in NeuralNetwork::backward (this=0x5555557fe0b0) at src/NeuralNetwork.cpp:54

0x000055555555965c in train (net=0x5555557fe0b0, config=0x5555557fe140) at src/secondary.cpp:177

0x00005555555abe40 in main (argc=10, argv=0x7fffffffdfc8) at src/main.cpp:139

Do you have any idea on what to do from here? I can run the 'make standalone' with mnist false.

Thank you in advance!

*edit, this is with batch size = 128, if I set the batch size to 64 then I don't get a segfault. Likewise it works with batch size 256

Someone else had this segfault issue. I am overcommitted right now and might not have time to look into this, I can only give you some pointers to debug this (if you manage to fix it, I can pull in your commit)

  1. Based on the function trace, CNNLayer::updateEquationsSA seems to be the source of the error. In this codebase, I would suspect segfaults occurring because of wrong memory access in a vector.
  2. I checked the MPC code more thoroughly and possibly did not fix bugs in the SA code. Maybe compare the for loop sizes of the corresponding MPC code with the SA code and check for discrepancies.
  3. Its definitely bizarre that it works for batch size 64 and 256 but not 128. Would like to debug this but can't commit to it anytime soon.