Subject: Seeking help: Segmentation fault in homomorphic PageRank with patched OpenFHE v1.2.3 for large graphs

Hello OpenFHE community,

I’m working on implementing a homomorphic PageRank algorithm using OpenFHE and encountering an issue that I hope some of you might have insights into.
Context:

  • I’ve implemented PageRank using OpenFHE’s CKKS scheme for privacy-preserving graph analysis.

  • My program works perfectly with the OpenFHE library from the main development branch (https://github.com/openfheorg/openfhe-development.git).

  • However, when I switch to a patched version of OpenFHE v1.2.3 (used by the FIDESlib project), I’m running into segmentation faults specifically for large graphs (>10,000 nodes).

The patched version details:
The patched OpenFHE v1.2.3 comes from FIDESlib and includes two main patches:

  1. Base patch: https://github.com/CAPS-UMU/FIDESlib/blob/main/cmake/openfhe-base.patch

    • Modifies access permissions of internal classes (private→public)

    • Adds new bootstrapping methods (EvalBootstrapNoStC, EvalBootstrapDensePartial, etc.)

    • Various algorithm optimizations and code improvements

  2. Hook patch:

    • Adds debugging hooks and changes default build to Debug with -O0

    • Creates a new hook library for runtime debugging

      The problem:
      With the patched version, my PageRank implementation:

      • Works fine for small to medium graphs (up to ~1,000 nodes)

      • Crashes with segmentation fault for large graphs (10,000+ nodes)

What I’ve tried:

  • Verified the same code works with vanilla OpenFHE for all graph sizes

  • Ensured sufficient levels/modulus for the computation

  • Run with Valgrind (shows invalid reads/writes in the patched library)

  • Tried different bootstrapping parameters

My questions:

  1. Has anyone else worked with this patched OpenFHE version from FIDESlib?

  2. Are there known issues with memory management or large allocations in these patches?

  3. The base patch makes many internal members public - could this affect object lifecycle or memory layout?

  4. Any suggestions for debugging this specific issue?

Additional info I can provide:
Specific error messages/backtraces

Configuration parameters used
The fact that it works with OpenFHE but not the patched version suggests something specific to the modifications. I’m particularly curious if the access permission changes (private→public) or the new bootstrapping methods might have subtle side effects for large-scale computations.

Any guidance, suggestions, or shared experiences would be greatly appreciated!

Thank you in advance for your help.

Hi @XuetaoCHEN,

I pinged the developers of FIDESLIB. One question I have: have you tried running it using the unpatched version of OpenFHE v1.2.3, which is available at GitHub - openfheorg/openfhe-development at v1.2.3?

1 Like

Hello!

I find this bug strange aswell, and with the data you shared I can’t begin to suspect what might be causing the segfault.

Does the code break within a stack trace containing FIDESlib functions, or are you just rerunning a CPU only program with and without the patch?

A full stack trace could be useful, but the fact that only large graphs fail seem to indicate the error might be related to system memory usage.

As a tangent note, maybe multi-threading is causing the error? OpenMP libraries can be fiddley with compilation changes and break otherwise correct code.

I’d be happy to comment on any additional findings from your side

1 Like

Thank you soooo much!! However I have not run it yet (using the unpatched version of OpenFHE v1.2.)Because the installation of patched version is not that easy on the sever I use(which I must contact the sudo user for installing and uninstalling the patches) If I have chance I will try to run a test based on the environment you suggested. Again, thank you very much! :woman_bowing:

Hello, thank you for your help, I could provide more information.

The bug still exists when I rerun a cpu program with the patch. I havn’t tried what will happen without the patch. I have also tried to use a sever with more powerful cpu, however the problem existed. I also contacted with my collaborators, they tried rerun the experiment using the newest-unpatched openfhe, and the program ran well. the params of the cpu of the sever is shown here. I shall think about what if the OPENMP is causing trouble, I shall check the code. If you have any other questions feel free to contact me any time , I will be happy to provide more information.:woman_bowing: :woman_bowing:

I assume you are using the GPU backend from FIDESLIB. Try running your code with compute-sanitizer and report any errors you encounter. Also, make sure you build your code in debug mode to get more useful information.

You might just be running out of VRAM when your graphs get larger.

1 Like

Let me try, In fact I did tried to compile my program(only cpp version) with only linking to the patched openfhe, and it failed. I shall try the debug mode and return with more useful information,thank you very much :woman_bowing:

Hello,

As a heads up, we realeased a new version of the library which also works with a minimal patch for the 1.4.2 OpenFHE version