baml icon indicating copy to clipboard operation
baml copied to clipboard

Segmentation fault when using multiprocessing

Open arshsingh opened this issue 7 months ago • 2 comments

Example:

from multiprocessing import Process
from baml_client import b


def run():
    b.ExtractResume("test")


if __name__ == "__main__":
    current = Process(target=run)
    current.start()
    current.join()

This exits with a seg fault.

lazy import works though

from multiprocessing import Process

def run():
    from baml_client import b
    b.ExtractResume("test")


if __name__ == "__main__":
    current = Process(target=run)
    current.start()
    current.join()

I can reproduce this with 0.82.0 on the following platforms:

  • python:3.12 arm64 docker image
  • python:3.10 arm64 docker image
  • python:3.12 amd64 docker image
  • amazon linux 2023 with python 3.9

Seems to be working without any issues on my M2 mac though (python 3.10).

arshsingh avatar Apr 04 '25 22:04 arshsingh

If you would like me to solve this issue, either tag me in a comment or check this box:

  • [ ] Solve Issue

You can disable automatic comments on my settings page

mentatbot[bot] avatar Apr 04 '25 22:04 mentatbot[bot]

Has this issue been resolved? I'm encountering the same error.

  • baml 0.89.0
  • python:3.12 amd64 docker image

w0r1dhe110 avatar May 23 '25 02:05 w0r1dhe110

follow this for the resolution: https://github.com/BoundaryML/baml/issues/1821 We are looking into it now

aaronvg avatar May 23 '25 02:05 aaronvg

#1990 fixes this

ba11b0y avatar Jun 30 '25 21:06 ba11b0y