# Segfault and crash embedding when julia runs multithreaded gc

**URL:** https://discourse.julialang.org/t/segfault-and-crash-embedding-when-julia-runs-multithreaded-gc/75221
**Category:** General Usage
**Tags:** embedding
**Created:** [January 26, 2022, 10:37am UTC](https://discourse.julialang.org/t/segfault-and-crash-embedding-when-julia-runs-multithreaded-gc/75221 "2022-01-26T10:37:27Z")
**Posts on this page:** 1
**Showing post:** 36

<div class="post-metadata">

### Author: ![xapkohheh](https://avatars.discourse-cdn.com/v4/letter/x/dbc845/32.png) [@xapkohheh](https://discourse.julialang.org/u/xapkohheh)
#### Post date: [January 30, 2022, 10:36am UTC](https://discourse.julialang.org/t/segfault-and-crash-embedding-when-julia-runs-multithreaded-gc/75221/36 "2022-01-30T10:36:51Z")

</div>

I would really love to hear @yuyichao 's comment on this

For now what i’ve noticed is that when it crashes with the latest code - the sigsegv is always sent from the houdini’s cooking thread, where julia was initialized. My wild guess is that houdini manages it’s threads itself and catches all important signals without the ability for me to override that behaviour.  
So maybe it worth a shot to start a completely new pthread on plugin initialization and run all julia code there - that way houdini should not be able to manage that thread. so then all julia commands should be queued from houdini’s cooking thread to julia’s “main” thread.  
haven’t used pthreads directly, but I will give it a try when i get some free time, unless someone says it’s a stupid idea  
Edit: maybe [this](https://discourse.julialang.org/t/embedding-julia-into-multithreading-apps/20122/8) will help

---

_[View the full topic](https://discourse.julialang.org/t/segfault-and-crash-embedding-when-julia-runs-multithreaded-gc/75221)._
