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

**URL:** <https://openfhe.discourse.group/t/subject-seeking-help-segmentation-fault-in-homomorphic-pagerank-with-patched-openfhe-v1-2-3-for-large-graphs/2263>\
**Category:** OpenFHE Hardware Acceleration\
**Created:** [January 20, 2026, 2:57am UTC](https://openfhe.discourse.group/t/subject-seeking-help-segmentation-fault-in-homomorphic-pagerank-with-patched-openfhe-v1-2-3-for-large-graphs/2263 "2026-01-20T02:57:00Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![XuetaoCHEN](https://avatars.discourse-cdn.com/v4/letter/x/a88e57/32.png) [@XuetaoCHEN](https://openfhe.discourse.group/u/XuetaoCHEN)\
**Post date:** [January 20, 2026, 2:57am UTC](https://openfhe.discourse.group/t/subject-seeking-help-segmentation-fault-in-homomorphic-pagerank-with-patched-openfhe-v1-2-3-for-large-graphs/2263/1 "2026-01-20T02:57:00Z")

</div>

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](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](https://github.com/CAPS-UMU/FIDESlib/blob/main/cmake/openfhe-base.patch)

2. **Hook patch** :

**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.

 ![屏幕截图 2026-01-05 135753](https://canada1.discourse-cdn.com/flex031/uploads/openfhe/original/1X/ef12999982c386e386c481de23f0e32f1bb28a22.png)

---

<div class="post-metadata">

**Author:** ![ypolyakov](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/ypolyakov/32/47_2.png) [@ypolyakov](https://openfhe.discourse.group/u/ypolyakov)\
**Post date:** [January 25, 2026, 12:09am UTC](https://openfhe.discourse.group/t/subject-seeking-help-segmentation-fault-in-homomorphic-pagerank-with-patched-openfhe-v1-2-3-for-large-graphs/2263/2 "2026-01-25T00:09:40Z")

</div>

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](https://github.com/openfheorg/openfhe-development/tree/v1.2.3)?

---

<div class="post-metadata">

**Author:** ![carlosad](https://avatars.discourse-cdn.com/v4/letter/c/ecae2f/32.png) [@carlosad](https://openfhe.discourse.group/u/carlosad)\
**Post date:** [January 25, 2026, 6:28pm UTC](https://openfhe.discourse.group/t/subject-seeking-help-segmentation-fault-in-homomorphic-pagerank-with-patched-openfhe-v1-2-3-for-large-graphs/2263/3 "2026-01-25T18:28:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![XuetaoCHEN](https://avatars.discourse-cdn.com/v4/letter/x/a88e57/32.png) [@XuetaoCHEN](https://openfhe.discourse.group/u/XuetaoCHEN)\
**Post date:** [January 26, 2026, 5:36am UTC](https://openfhe.discourse.group/t/subject-seeking-help-segmentation-fault-in-homomorphic-pagerank-with-patched-openfhe-v1-2-3-for-large-graphs/2263/4 "2026-01-26T05:36:27Z")

</div>

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! 🙇‍♀️

---

<div class="post-metadata">

**Author:** ![XuetaoCHEN](https://avatars.discourse-cdn.com/v4/letter/x/a88e57/32.png) [@XuetaoCHEN](https://openfhe.discourse.group/u/XuetaoCHEN)\
**Post date:** [January 26, 2026, 5:53am UTC](https://openfhe.discourse.group/t/subject-seeking-help-segmentation-fault-in-homomorphic-pagerank-with-patched-openfhe-v1-2-3-for-large-graphs/2263/5 "2026-01-26T05:53:58Z")

</div>

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.🙇‍♀️ 🙇‍♀️

 ![屏幕截图 2025-12-31 150033](https://canada1.discourse-cdn.com/flex031/uploads/openfhe/original/1X/b7f0ba851b71e97705c9f011dafbaf23865c82fc.png)

---

<div class="post-metadata">

**Author:** ![Caesar](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/caesar/32/63_2.png) [@Caesar](https://openfhe.discourse.group/u/Caesar)\
**Post date:** [January 26, 2026, 1:54pm UTC](https://openfhe.discourse.group/t/subject-seeking-help-segmentation-fault-in-homomorphic-pagerank-with-patched-openfhe-v1-2-3-for-large-graphs/2263/6 "2026-01-26T13:54:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![XuetaoCHEN](https://avatars.discourse-cdn.com/v4/letter/x/a88e57/32.png) [@XuetaoCHEN](https://openfhe.discourse.group/u/XuetaoCHEN)\
**Post date:** [January 28, 2026, 2:27am UTC](https://openfhe.discourse.group/t/subject-seeking-help-segmentation-fault-in-homomorphic-pagerank-with-patched-openfhe-v1-2-3-for-large-graphs/2263/7 "2026-01-28T02:27:25Z")

</div>

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 🙇‍♀️

---

<div class="post-metadata">

**Author:** ![carlosad](https://avatars.discourse-cdn.com/v4/letter/c/ecae2f/32.png) [@carlosad](https://openfhe.discourse.group/u/carlosad)\
**Post date:** [February 7, 2026, 11:55pm UTC](https://openfhe.discourse.group/t/subject-seeking-help-segmentation-fault-in-homomorphic-pagerank-with-patched-openfhe-v1-2-3-for-large-graphs/2263/8 "2026-02-07T23:55:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![XuetaoCHEN](https://avatars.discourse-cdn.com/v4/letter/x/a88e57/32.png) [@XuetaoCHEN](https://openfhe.discourse.group/u/XuetaoCHEN)\
**Post date:** [May 11, 2026, 6:00am UTC](https://openfhe.discourse.group/t/subject-seeking-help-segmentation-fault-in-homomorphic-pagerank-with-patched-openfhe-v1-2-3-for-large-graphs/2263/9 "2026-05-11T06:00:50Z")

</div>

It been a long time, and I am now back to this project again. Thank you sooo much for your updates, we have also changed our pagerank-under-CKKS project to use your FIDESlib2.0 based on 1.4.2 patched OPFHE version too. Thank you again for your generous contribution!🙇‍♀️ However we found the actual same problem in the same position and the same experiment setup… We are also trying to locate the specific problem. Have you experienced similar problems using large, frequently ckks-operations? We think we got this segmentation when we are performing CKKS-based matrix multiplication… Thank you again for reading this 🙇‍♀️

---

<div class="post-metadata">

**Author:** ![carlosad](https://avatars.discourse-cdn.com/v4/letter/c/ecae2f/32.png) [@carlosad](https://openfhe.discourse.group/u/carlosad)\
**Post date:** [May 15, 2026, 11:15am UTC](https://openfhe.discourse.group/t/subject-seeking-help-segmentation-fault-in-homomorphic-pagerank-with-patched-openfhe-v1-2-3-for-large-graphs/2263/10 "2026-05-15T11:15:14Z")

</div>

Hello again,

we have not experienced unexpected segmentation fault when running heavy workloads,

it would be ideal to find a more specific scenario where this happens, a.k.a. minimum reproducible code that generates the error, which in itself can be hard to achieve. Right now, I can’t think of anything else. An stack trace of the segmentation fault location might give some initial hints though.
