Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] pycall/pytypeobject_wrapper.rb:24: [BUG] Segmentation fault at 0x0000000000000010 #175

Closed
tevykak opened this issue May 3, 2024 · 8 comments
Labels

Comments

@tevykak
Copy link

tevykak commented May 3, 2024

I have a rails project using pycall and pandas.

I use these gems in a dedicated service. It works on production (heroku) and in a local rails console, I can run some data calculations.

But in a local rails server (I call the service from a controller), it doesn't work anymore: every time pycall is called, the server crashes.

Apparently, the error comes from pytypeobject_wrapper.rb but I have absolutely no idea why and I don't know how to fix it.
Please, help? 🥲

Backtrace:

web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/pycall-1.5.1/lib/pycall/pytypeobject_wrapper.rb:24: [BUG] Segmentation fault at 0x0000000000000010
web.1  | ruby 3.2.3 (2024-01-18 revision 52bb2ac0a6) [arm64-darwin23]
web.1  | 
web.1  | -- Crash Report log information --------------------------------------------
web.1  |    See Crash Report log file in one of the following locations:
web.1  |      * ~/Library/Logs/DiagnosticReports
web.1  |      * /Library/Logs/DiagnosticReports
web.1  |    for more details.
web.1  | Don't forget to include the above Crash Report log file in bug reports.
web.1  | 
web.1  | -- Control frame information -----------------------------------------------
web.1  | c:0091 p:---- s:0656 e:000655 CFUNC  :call_object
web.1  | c:0090 p:0012 s:0650 e:000648 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/pycall-1.5.1/lib/pycall/pytypeobject_wrapper.rb:24
web.1  | c:0089 p:0076 s:0644 e:000642 METHOD /Users/xxx/Work/projectX/app/services/resource/calculation_service.rb:28
web.1  | c:0088 p:0015 s:0631 e:000630 METHOD /Users/xxx/Work/projectX/app/services/resource/application_service.rb:8
web.1  | c:0087 p:0014 s:0624 e:000623 METHOD /Users/xxx/Work/projectX/app/controllers/admin/resources_controller.rb:42
web.1  | c:0086 p:0010 s:0620 e:000619 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_controller/metal/basic_implicit_rende
web.1  | c:0085 p:0011 s:0613 e:000612 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/abstract_controller/base.rb:215
web.1  | c:0084 p:0022 s:0606 e:000605 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_controller/metal/rendering.rb:165
web.1  | c:0083 p:0008 s:0601 e:000600 BLOCK  /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/abstract_controller/callbacks.rb:234
web.1  | c:0082 p:0048 s:0598 e:000596 BLOCK  /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/activesupport-7.0.6/lib/active_support/callbacks.rb:118
web.1  | c:0081 p:0018 s:0588 e:000587 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/turbo-rails-2.0.5/lib/turbo-rails.rb:24
web.1  | c:0080 p:0016 s:0582 e:000581 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/turbo-rails-2.0.5/app/controllers/concerns/turbo/request_id_track
web.1  | c:0079 p:0127 s:0577 e:000576 BLOCK  /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/activesupport-7.0.6/lib/active_support/callbacks.rb:127
web.1  | c:0078 p:0105 s:0568 E:001618 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/activesupport-7.0.6/lib/active_support/callbacks.rb:138
web.1  | c:0077 p:0006 s:0559 E:001488 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/abstract_controller/callbacks.rb:233
web.1  | c:0076 p:0008 s:0552 e:000551 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_controller/metal/rescue.rb:23
web.1  | c:0075 p:0009 s:0546 e:000545 BLOCK  /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_controller/metal/instrumentation.rb:6
web.1  | c:0074 p:0010 s:0540 e:000539 BLOCK  /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/activesupport-7.0.6/lib/active_support/notifications.rb:206
web.1  | c:0073 p:0022 s:0537 e:000536 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/activesupport-7.0.6/lib/active_support/notifications/instrumenter
web.1  | c:0072 p:0023 s:0529 e:000528 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/activesupport-7.0.6/lib/active_support/notifications.rb:206
web.1  | c:0071 p:0084 s:0523 e:000522 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_controller/metal/instrumentation.rb:6
web.1  | c:0070 p:0017 s:0517 e:000516 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_controller/metal/params_wrapper.rb:25
web.1  | c:0069 p:0015 s:0512 e:000511 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/activerecord-7.0.6/lib/active_record/railties/controller_runtime.
web.1  | c:0068 p:0063 s:0506 e:000505 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/abstract_controller/base.rb:151
web.1  | c:0067 p:0035 s:0499 e:000498 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionview-7.0.6/lib/action_view/rendering.rb:39
web.1  | c:0066 p:0017 s:0491 e:000490 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_controller/metal.rb:188
web.1  | c:0065 p:0033 s:0484 e:000483 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_controller/metal.rb:251
web.1  | c:0064 p:0010 s:0477 e:000476 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/routing/route_set.rb:49
web.1  | c:0063 p:0036 s:0469 e:000468 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/routing/route_set.rb:32
web.1  | c:0062 p:0006 s:0461 e:000460 BLOCK  /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/routing/mapper.rb:18
web.1  | c:0061 p:0026 s:0456 e:000455 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/routing/mapper.rb:48
web.1  | c:0060 p:0109 s:0451 e:000450 BLOCK  /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/journey/router.rb:50 [FINISH]
web.1  | c:0059 p:---- s:0438 e:000437 CFUNC  :each
web.1  | c:0058 p:0008 s:0434 e:000433 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/journey/router.rb:32
web.1  | c:0057 p:0027 s:0429 e:000428 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/routing/route_set.rb:852
web.1  | c:0056 p:0026 s:0423 e:000422 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/rack-2.2.9/lib/rack/session/abstract/id.rb:266
web.1  | c:0055 p:0005 s:0412 e:000411 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/rack-2.2.9/lib/rack/session/abstract/id.rb:260
web.1  | c:0054 p:0015 s:0407 e:000406 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/middleware/cookies.rb:704
web.1  | c:0053 p:0016 s:0397 e:000396 BLOCK  /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/warden-1.2.9/lib/warden/manager.rb:36 [FINISH]
web.1  | c:0052 p:---- s:0394 e:000393 CFUNC  :catch
web.1  | c:0051 p:0050 s:0389 e:000388 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/warden-1.2.9/lib/warden/manager.rb:34
web.1  | c:0050 p:0028 s:0383 e:000382 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/rack-2.2.9/lib/rack/tempfile_reaper.rb:15
web.1  | c:0049 p:0007 s:0374 e:000373 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/rack-2.2.9/lib/rack/etag.rb:27
web.1  | c:0048 p:0034 s:0363 e:000362 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/rack-2.2.9/lib/rack/conditional_get.rb:40
web.1  | c:0047 p:0007 s:0354 e:000353 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/rack-2.2.9/lib/rack/head.rb:12
web.1  | c:0046 p:0015 s:0346 e:000345 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/http/permissions_policy.rb:3
web.1  | c:0045 p:0015 s:0336 e:000335 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/http/content_security_policy
web.1  | c:0044 p:0026 s:0322 e:000321 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/rack-2.2.9/lib/rack/session/abstract/id.rb:266
web.1  | c:0043 p:0005 s:0311 e:000310 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/rack-2.2.9/lib/rack/session/abstract/id.rb:260
web.1  | c:0042 p:0015 s:0306 e:000305 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/middleware/cookies.rb:704
web.1  | c:0041 p:0014 s:0296 e:000295 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/activerecord-7.0.6/lib/active_record/migration.rb:603
web.1  | c:0040 p:0008 s:0291 e:000290 BLOCK  /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/middleware/callbacks.rb:27
web.1  | c:0039 p:0024 s:0288 e:000287 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/activesupport-7.0.6/lib/active_support/callbacks.rb:99
web.1  | c:0038 p:0009 s:0279 e:000278 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/middleware/callbacks.rb:26
web.1  | c:0037 p:0016 s:0272 e:000271 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/middleware/executor.rb:14
web.1  | c:0036 p:0022 s:0263 e:000262 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/middleware/actionable_except
web.1  | c:0035 p:0015 s:0257 e:000256 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/middleware/debug_exceptions.
web.1  | c:0034 p:0007 s:0246 e:000245 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/web-console-4.2.0/lib/web_console/middleware.rb:132
web.1  | c:0033 p:0069 s:0240 e:000239 BLOCK  /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/web-console-4.2.0/lib/web_console/middleware.rb:28 [FINISH]
web.1  | c:0032 p:---- s:0230 e:000229 CFUNC  :catch
web.1  | c:0031 p:0006 s:0225 e:000224 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/web-console-4.2.0/lib/web_console/middleware.rb:17
web.1  | c:0030 p:0015 s:0218 e:000217 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/middleware/show_exceptions.r
web.1  | c:0029 p:0037 s:0211 E:0026a0 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/railties-7.0.6/lib/rails/rack/logger.rb:40
web.1  | c:0028 p:0007 s:0199 e:000198 BLOCK  /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/railties-7.0.6/lib/rails/rack/logger.rb:25
web.1  | c:0027 p:0003 s:0196 e:000195 BLOCK  /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/activesupport-7.0.6/lib/active_support/tagged_logging.rb:99
web.1  | c:0026 p:0012 s:0193 e:000192 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/activesupport-7.0.6/lib/active_support/tagged_logging.rb:37
web.1  | c:0025 p:0015 s:0187 e:000186 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/activesupport-7.0.6/lib/active_support/tagged_logging.rb:99
web.1  | c:0024 p:0028 s:0181 e:000180 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/railties-7.0.6/lib/rails/rack/logger.rb:25
web.1  | c:0023 p:0027 s:0175 e:000174 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/sprockets-rails-3.4.2/lib/sprockets/rails/quiet_assets.rb:13
web.1  | c:0022 p:0034 s:0170 e:000169 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/middleware/remote_ip.rb:93
web.1  | c:0021 p:0032 s:0164 e:000163 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/middleware/request_id.rb:26
web.1  | c:0020 p:0057 s:0158 e:000157 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/rack-2.2.9/lib/rack/method_override.rb:24
web.1  | c:0019 p:0013 s:0152 e:000151 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/rack-2.2.9/lib/rack/runtime.rb:22
web.1  | c:0018 p:0019 s:0142 e:000141 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/activesupport-7.0.6/lib/active_support/cache/strategy/local_cache
web.1  | c:0017 p:0007 s:0135 e:000134 BLOCK  /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/middleware/server_timing.rb:
web.1  | c:0016 p:0015 s:0132 e:000131 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/middleware/server_timing.rb:
web.1  | c:0015 p:0009 s:0127 e:000126 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/middleware/server_timing.rb:
web.1  | c:0014 p:0016 s:0118 e:000117 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/middleware/executor.rb:14
web.1  | c:0013 p:0018 s:0109 e:000108 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/middleware/static.rb:23
web.1  | c:0012 p:0007 s:0104 e:000103 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/rack-2.2.9/lib/rack/sendfile.rb:110
web.1  | c:0011 p:0050 s:0092 e:000091 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/middleware/host_authorizatio
web.1  | c:0010 p:0156 s:0086 e:000085 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/rack-cors-2.0.1/lib/rack/cors.rb:102
web.1  | c:0009 p:0016 s:0072 e:000071 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/railties-7.0.6/lib/rails/engine.rb:530
web.1  | c:0008 p:0017 s:0066 e:000065 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/puma-5.6.6/lib/puma/configuration.rb:252
web.1  | c:0007 p:0007 s:0061 e:000060 BLOCK  /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/puma-5.6.6/lib/puma/request.rb:77
web.1  | c:0006 p:0015 s:0058 e:000057 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/puma-5.6.6/lib/puma/thread_pool.rb:340
web.1  | c:0005 p:0187 s:0053 e:000052 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/puma-5.6.6/lib/puma/request.rb:76
web.1  | c:0004 p:0097 s:0032 e:000031 METHOD /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/puma-5.6.6/lib/puma/server.rb:443 [FINISH]
web.1  | c:0003 p:---- s:0020 e:000019 IFUNC 
web.1  | c:0002 p:0083 s:0017 e:000014 BLOCK  /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/puma-5.6.6/lib/puma/thread_pool.rb:147 [FINISH]
web.1  | c:0001 p:---- s:0003 e:000002 DUMMY  [FINISH]
web.1  | 
web.1  | -- Ruby level backtrace information ----------------------------------------
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/puma-5.6.6/lib/puma/thread_pool.rb:147:in `block in spawn_thread'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/puma-5.6.6/lib/puma/server.rb:443:in `process_client'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/puma-5.6.6/lib/puma/request.rb:76:in `handle_request'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/puma-5.6.6/lib/puma/thread_pool.rb:340:in `with_force_shutdown'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/puma-5.6.6/lib/puma/request.rb:77:in `block in handle_request'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/puma-5.6.6/lib/puma/configuration.rb:252:in `call'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/railties-7.0.6/lib/rails/engine.rb:530:in `call'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/rack-cors-2.0.1/lib/rack/cors.rb:102:in `call'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/middleware/host_authorization.rb:137:in `call'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/rack-2.2.9/lib/rack/sendfile.rb:110:in `call'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/middleware/static.rb:23:in `call'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/middleware/executor.rb:14:in `call'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/middleware/server_timing.rb:60:in `call'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/middleware/server_timing.rb:26:in `collect_events'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/middleware/server_timing.rb:61:in `block in call'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/activesupport-7.0.6/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/rack-2.2.9/lib/rack/runtime.rb:22:in `call'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/rack-2.2.9/lib/rack/method_override.rb:24:in `call'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/middleware/request_id.rb:26:in `call'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/middleware/remote_ip.rb:93:in `call'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/sprockets-rails-3.4.2/lib/sprockets/rails/quiet_assets.rb:13:in `call'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/railties-7.0.6/lib/rails/rack/logger.rb:25:in `call'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/activesupport-7.0.6/lib/active_support/tagged_logging.rb:99:in `tagged'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/activesupport-7.0.6/lib/active_support/tagged_logging.rb:37:in `tagged'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/activesupport-7.0.6/lib/active_support/tagged_logging.rb:99:in `block in tagged'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/railties-7.0.6/lib/rails/rack/logger.rb:25:in `block in call'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/railties-7.0.6/lib/rails/rack/logger.rb:40:in `call_app'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/middleware/show_exceptions.rb:29:in `call'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/web-console-4.2.0/lib/web_console/middleware.rb:17:in `call'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/web-console-4.2.0/lib/web_console/middleware.rb:17:in `catch'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/web-console-4.2.0/lib/web_console/middleware.rb:28:in `block in call'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/web-console-4.2.0/lib/web_console/middleware.rb:132:in `call_app'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/middleware/debug_exceptions.rb:28:in `call'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/middleware/actionable_exceptions.rb:17:in `call'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/middleware/executor.rb:14:in `call'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/middleware/callbacks.rb:26:in `call'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/activesupport-7.0.6/lib/active_support/callbacks.rb:99:in `run_callbacks'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/activerecord-7.0.6/lib/active_record/migration.rb:603:in `call'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/middleware/cookies.rb:704:in `call'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/rack-2.2.9/lib/rack/session/abstract/id.rb:260:in `call'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/rack-2.2.9/lib/rack/session/abstract/id.rb:266:in `context'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/http/content_security_policy.rb:36:in `call'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/http/permissions_policy.rb:38:in `call'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/rack-2.2.9/lib/rack/head.rb:12:in `call'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/rack-2.2.9/lib/rack/conditional_get.rb:40:in `call'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/rack-2.2.9/lib/rack/etag.rb:27:in `call'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/rack-2.2.9/lib/rack/tempfile_reaper.rb:15:in `call'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/warden-1.2.9/lib/warden/manager.rb:34:in `call'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/warden-1.2.9/lib/warden/manager.rb:34:in `catch'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/warden-1.2.9/lib/warden/manager.rb:36:in `block in call'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/middleware/cookies.rb:704:in `call'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/rack-2.2.9/lib/rack/session/abstract/id.rb:260:in `call'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/rack-2.2.9/lib/rack/session/abstract/id.rb:266:in `context'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/routing/route_set.rb:852:in `call'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/journey/router.rb:32:in `serve'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/journey/router.rb:32:in `each'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/journey/router.rb:50:in `block in serve'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/routing/mapper.rb:48:in `serve'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/routing/mapper.rb:18:in `block in <class:Constraints>'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/routing/route_set.rb:32:in `serve'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_dispatch/routing/route_set.rb:49:in `dispatch'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_controller/metal.rb:251:in `dispatch'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_controller/metal.rb:188:in `dispatch'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionview-7.0.6/lib/action_view/rendering.rb:39:in `process'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/abstract_controller/base.rb:151:in `process'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/activerecord-7.0.6/lib/active_record/railties/controller_runtime.rb:27:in `process_action'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_controller/metal/params_wrapper.rb:259:in `process_action'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_controller/metal/instrumentation.rb:66:in `process_action'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/activesupport-7.0.6/lib/active_support/notifications.rb:206:in `instrument'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/activesupport-7.0.6/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/activesupport-7.0.6/lib/active_support/notifications.rb:206:in `block in instrument'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_controller/metal/instrumentation.rb:67:in `block in process_action'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_controller/metal/rescue.rb:23:in `process_action'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/abstract_controller/callbacks.rb:233:in `process_action'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/activesupport-7.0.6/lib/active_support/callbacks.rb:138:in `run_callbacks'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/activesupport-7.0.6/lib/active_support/callbacks.rb:127:in `block in run_callbacks'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/turbo-rails-2.0.5/app/controllers/concerns/turbo/request_id_tracking.rb:10:in `turbo_tracking_request_id'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/turbo-rails-2.0.5/lib/turbo-rails.rb:24:in `with_request_id'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/activesupport-7.0.6/lib/active_support/callbacks.rb:118:in `block in run_callbacks'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/abstract_controller/callbacks.rb:234:in `block in process_action'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_controller/metal/rendering.rb:165:in `process_action'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/abstract_controller/base.rb:215:in `process_action'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/actionpack-7.0.6/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
web.1  | /Users/xxx/Work/projectX/app/controllers/admin/resources_controller.rb:42:in `recalculate_result'
web.1  | /Users/xxx/Work/projectX/app/services/resource/application_service.rb:8:in `call'
web.1  | /Users/xxx/Work/projectX/app/services/resource/calculation_service.rb:28:in `perform'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/pycall-1.5.1/lib/pycall/pytypeobject_wrapper.rb:24:in `new'
web.1  | /Users/xxx/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/pycall-1.5.1/lib/pycall/pytypeobject_wrapper.rb:24:in `call_object'
web.1  | 
web.1  | -- Machine register context ------------------------------------------------
web.1  |   x0: 0x000060000551e658  x1: 0x0000000000000001  x2: 0x000000016c6e81b0
web.1  |   x3: 0x000000010852b404  x4: 0x000000000000000d  x5: 0x0000000000002630
web.1  |   x6: 0x000060000551e630  x7: 0x000000016c6e49d0 x18: 0x0000000000000000
web.1  |  x19: 0x0000000108fb8e08 x20: 0x0000000000000001 x21: 0x000060000551e658
web.1  |  x22: 0x0000000000000001 x23: 0x0000000000000001 x24: 0x0000000107f0dc48
web.1  |  x25: 0x000439d100010005 x26: 0x00006000018e13b0 x27: 0x0000000000000000
web.1  |  x28: 0x0000000055550083  lr: 0xc91e000108cd1888  fp: 0x000000016c6e4fe0
web.1  |   sp: 0x000000016c6e4fc0
web.1  | 


App rails config:

  • Ruby 3.2.3
  • Rails 7.0.4
  • Python 3.12.2
  • requirement.txt
    networkx==2.5
    numpy==1.24.0
    pandas==1.5.2
    

I also try to run my server with virtualenv but it doesn't change anything, I have the same error.

@fuck-lukashenko
Copy link

fuck-lukashenko commented May 15, 2024

Reproduced a similar case on a platform with AMD processor. Intel is totally fine.

If I run PyCall.import_module('whatever module name here') inside Thread.new block, it crashes. If I import_module outside Thread.new but then call something inside Thread.new, it also crashes.

@mrkn mrkn added the bug label May 20, 2024
@mrkn
Copy link
Owner

mrkn commented May 20, 2024

@fuck-lukashenko pycall doesn't support multithreading. Please call Python only from the main thread.

@mrkn mrkn removed the bug label May 20, 2024
@mrkn
Copy link
Owner

mrkn commented May 20, 2024

@tevykak Could you please check whether Python was called from non-main threads when SEGV occurred? If so, please prevent calling Python from non-main threads because the current pycall can support only the main thread.

@mrkn mrkn added the wontfix label May 20, 2024
@mrkn
Copy link
Owner

mrkn commented May 20, 2024

@tevykak If this problem isn't related to multithreading, please reopen the issue.

@mrkn mrkn closed this as completed May 20, 2024
@edelkas
Copy link

edelkas commented Jun 26, 2024

I was having the same issue, segfaults on almost every function call. Can confirm putting the code in the main thread fixed the problem.

@snickell
Copy link

snickell commented Aug 6, 2024

@tevykak could you give an example of the pandas code that caused your crash? I believe I have a similar example, but mine is using a more complicated library than pandas. It would help me produce a minimal repro if you could give a pandas snippet that crashes for you.

@snickell
Copy link

snickell commented Aug 6, 2024

I believe the issue is that Puma ALWAYS starts requests in a thread, even if you set threads=1, it will still do requests on a different thread than initialized the code, which is not safe for pycall.

See: #185

@snickell
Copy link

snickell commented Aug 8, 2024

See main tracking issue for thread safety: #96

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants