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

Psi_Rs_multiThrd_test failed #75

Open
nhysteric opened this issue Aug 27, 2024 · 7 comments
Open

Psi_Rs_multiThrd_test failed #75

nhysteric opened this issue Aug 27, 2024 · 7 comments

Comments

@nhysteric
Copy link

./frontend -u 38
38 - Psi_Rs_multiThrd_test       frontend: /home/nhy/test/extern/volePSI/volePSI/SimpleIndex.cpp:276: static volePSI::u64 volePSI::SimpleIndex::get_bin_size(volePSI::u64, volePSI::u64, volePSI::u64, bool): Assertion `B2 <= B' failed.
[2]    131216 abort (core dumped)  ./frontend -u 38

This is the gdb backtrace:

(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ffff79d1859 in __GI_abort () at abort.c:79
#2  0x00007ffff79d1729 in __assert_fail_base (fmt=0x7ffff7b67588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n",
    assertion=0x555555cefb26 "B2 <= B",
    file=0x555555cefaf0 "/home/nhy/test/extern/volePSI/volePSI/SimpleIndex.cpp", line=276, function=<optimized out>)
    at assert.c:92
#3  0x00007ffff79e2fd6 in __GI___assert_fail (assertion=0x555555cefb26 "B2 <= B",
    file=0x555555cefaf0 "/home/nhy/test/extern/volePSI/volePSI/SimpleIndex.cpp", line=276,
    function=0x555555cefa88 "static volePSI::u64 volePSI::SimpleIndex::get_bin_size(volePSI::u64, volePSI::u64, volePSI::u64, bool)") at assert.c:101
#4  0x00005555559a7def in volePSI::SimpleIndex::get_bin_size (numBins=8, numBalls=13243, statSecParam=40,
    approx=true) at /home/nhy/test/extern/volePSI/volePSI/SimpleIndex.cpp:276
#5  0x000055555567fcf3 in volePSI::Baxos::getBinSize (numBins=8, numBalls=13243, statSecParam=40)
    at /home/nhy/test/extern/volePSI/volePSI/../volePSI/PaxosImpl.h:2559
#6  0x000055555599a9da in volePSI::RsPsiReceiver::run(volePSI::RsPsiReceiver::_ZN7volePSI13RsPsiReceiver3runESt4spanIN9osuCrypto5blockELm18446744073709551615EERN7coproto6SocketE.Frame *) (frame_ptr=0x555555fd5800)
    at /home/nhy/test/extern/volePSI/volePSI/RsPsi.cpp:234
#7  0x0000555555926331 in volePSI::RsOprfReceiver::receive(volePSI::RsOprfReceiver::_ZN7volePSI14RsOprfReceiver7receiveESt4spanIKN9osuCrypto5blockELm18446744073709551615EES1_IS3_Lm18446744073709551615EERNS2_4PRNGERN7coproto6SocketEmb.Frame *) (frame_ptr=0x555555fd6db0) at /home/nhy/test/extern/volePSI/volePSI/RsOprf.cpp:266
#8  0x0000555555926331 in volePSI::RsOprfReceiver::receive(volePSI::RsOprfReceiver::_ZN7volePSI14RsOprfReceiver7receiveESt4spanIKN9osuCrypto5blockELm18446744073709551615EES1_IS3_Lm18446744073709551615EERNS2_4PRNGERN7coproto6SocketEmb.Frame *) (frame_ptr=0x555555fd6db0) at /home/nhy/test/extern/volePSI/volePSI/RsOprf.cpp:266
#9  0x0000555555580bd2 in macoro::make_eager(macoro::_ZN6macoro10make_eagerINS_4taskIvLb1EEEEENS1_INSt11conditionalIXsrSt19is_rvalue_referenceINS_16awaitable_traitsIT_vE12await_resultEE5valueENSt16remove_referenceIS8_E4typeES8_E4typeELb0EEES6_.Frame *) (frame_ptr=0x555555fd8c20)
    at /home/nhy/test/extern/volePSI/out/install/linux/include/macoro/task.h:707
#10 0x0000555555929880 in osuCrypto::SilentVoleReceiver<osuCrypto::block, osuCrypto::block, osuCrypto::CoeffCtxGF128>::silentReceiveInplace(osuCrypto::SilentVoleReceiver<osuCrypto::block, osuCrypto::block, osuCrypto::CoeffCtxGF128>::_ZN9osuCrypto18SilentVoleReceiverINS_5blockES1_NS_13CoeffCtxGF128EE20silentReceiveInplaceEmRNS_4PRNGERN7coproto6Socket

And this assertion is also appeared in other test, like test 47:

./frontend -u 47
47 - filebase_psi_csv_Test       frontend: /home/nhy/test/extern/volePSI/volePSI/SimpleIndex.cpp:276: static volePSI::u64 volePSI::SimpleIndex::get_bin_size(volePSI::u64, volePSI::u64, volePSI::u64, bool): Assertion `B2 <= B' failed.
[2]    136147 abort (core dumped)  ./frontend -u 47
@nhysteric
Copy link
Author

nhysteric commented Aug 27, 2024

I also have a question about the max size of RsOpprf:

# receiver
oc::span<const block> keyspan(key.data() + offset, binSize);
oc::MatrixView<block> outputspan(outputs.data() + offset * outputs.cols(), binSize, outputs.cols());
auto p = receiver.receive(binSize * context.max_in_bin, keyspan, outputspan, prng, context.threads, chl);

# sender
oc::span<const block> keyspan(key.data() + offset, binSize * context.max_in_bin);
oc::MatrixView<block> valuespan(value.data() + offset * value.cols(), binSize * context.max_in_bin, value.cols());
auto p = sender.send(binSize, keyspan, valuespan, prng, context.threads, chl);

In this situation, the size of (valuespan+keyspan) is 4288042880 bytes, which is lower than u32 max 4294967295 bytes. However it still failed in extern/volePSI/out/install/linux/include/coproto/Socket/SocketScheduler.h:1016

COPROTO_ASSERT(data.size() < std::numeric_limits<u32>::max());

where data.size is 5771200000.

So my question is, how many additional information will be attached to the payloads?

@ladnir
Copy link
Contributor

ladnir commented Aug 27, 2024

You could modify the code to use u64. I believe the size is n*1.24 or something like that.

I'll try to look at the multi threading at some point. Might not be soon.

@nhysteric
Copy link
Author

Thank you for your reply.
Modification code looks a bit complicated and I couldn't find a starting point. I'm now using subpackages to transfer data.

@ladnir
Copy link
Contributor

ladnir commented Aug 28, 2024

OK. So apart from the multi thread thing your are good?

Also, you likely don't want to do a psi with more than a million items. If you do have that many, you can shard your dataset and process each shard independently.

https://eprint.iacr.org/2022/294

@nhysteric
Copy link
Author

Yes, and this assertion `B2 <= B' will aslo failed in RsOPPRF with some specific input size.

@ladnir
Copy link
Contributor

ladnir commented Aug 28, 2024

what sizes

@nhysteric
Copy link
Author

Well, here is some tests I made:

X val values
sender 26840 26840*5000 receiver 2684
20180 20180*3000 2018
18216 18216*5268 2024

Where X and values are oc::span<block>, val is oc::MatrixView<block>. All sizes are in blocks.

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

No branches or pull requests

2 participants