Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8499493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:40:59+00:00 2026-06-11T00:40:59+00:00

I would like to run the Matlab engine (using the gem matlab-ruby) inside a

  • 0

I would like to run the Matlab engine (using the gem matlab-ruby) inside a ruby thread. The idea is to use ruby to distribute my Matlab processes onto different cores. However when I try to start a new engine from inside a thread I get a Trace/BPT trap: 5 error.

I’m new to ruby so not that strong on threads and so forth. Is what I’m trying to do possible or is it just one of those things that can’t be done?

require ‘matlab’

t1=Thread.new do
  engine = Matlab::Engine.new
  engine.put_variable "x", 10
  engine.put_variable "y", 22
  engine.eval "z = x * y"
  puts engine.get_variable "z"
end
t1.join
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T00:41:00+00:00Added an answer on June 11, 2026 at 12:41 am

    I wonder what happens if you instantiate a Matlab::Engine in the main thread, then later run your code as-is:

    Matlab::Engine.new  # side effect of loading the dynamic lib
    t1=Thread.new do
      engine = Matlab::Engine.new
      engine.put_variable "x", 10
      engine.put_variable "y", 22
      engine.eval "z = x * y"
      puts engine.get_variable "z"
    end
    t1.join
    

    I ask because I’ve had trouble with Trace/BPT with different libraries (Sinatra/ActiveRecord/pg/etc.), and when running Ruby in GBD, it crashed with the following backtrace:

    #0  0x00007fff89308590 in __CFInitialize ()
    #1  0x00007fff5fc0d5ce in __dyld__ZN16ImageLoaderMachO11doImageInitERKN11ImageLoader11LinkContextE ()
    #2  0x00007fff5fc0d607 in __dyld__ZN16ImageLoaderMachO16doInitializationERKN11ImageLoader11LinkContextE ()
    #3  0x00007fff5fc0bcec in __dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEj ()
    #4  0x00007fff5fc0bc9d in __dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEj ()
    #5  0x00007fff5fc0bc9d in __dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEj ()
    #6  0x00007fff5fc0bc9d in __dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEj ()
    #7  0x00007fff5fc0bda6 in __dyld__ZN11ImageLoader15runInitializersERKNS_11LinkContextE ()
    #8  0x00007fff5fc08fbb in __dyld_dlopen ()
    #9  0x00007fff888a7e40 in dlopen ()
    #10 0x0000000100001419 in dln_load ()
    #11 0x000000010016ad19 in rb_vm_call_cfunc ()
    #12 0x0000000100044d22 in rb_require_safe ()
    

    Searching around lead me to this bug report for SBCL which suggests that dynamic libraries may only be loaded by the main thread.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to run a python function using the command line in Eclipse
I would like to run some Matlab scripts. Nevertheless we don't have the Matlab
I would like to use questdlg within a Matlab application to prompt user feedback.
I would like to run action http://site.com/rss/rss_import which downloads many large files. I use:
I've got some heavyweight process, which does some video processing. I would like run
I would like to run a jar file extracted from my java project to
I would like to run this script (embed drive list in a site) that
I would like to run a script in production. This script generates a record
I would like to run my node.js application without the automatic logs it prints
I would like to run a script indefinitely. It look likes my current script,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.