ruby - Rails 服务器启动时 malloc_zone_unregister 失败

标签 ruby ruby-on-rails-4 malloc macos-sierra

为我正在处理的项目启动 Rails 服务器时,我收到以下错误:

malloc: *** malloc_zone_unregister() failed for <memory address>

周末发生的变化是我升级到了 OS Sierra。

迄今为止的研究: 我遇到了这个 github issue 这看起来很有希望,我试图修改我的 jemalloc gem 的 zone.c 文件以尝试 fix PR 中的代码更改。 .这没有做任何改变错误的事情

退一步说,jemalloc 不在我的 Gemfile 中,所以我不知道是什么导致了这个问题,除了尝试从我的计算机中删除 Sierra 之外,我不知道如何解决它。

更新:

我在我的 Gemfile 中重新引入了组中的 gems,这导致使用了不同版本的 gems - 这似乎神秘地解决了这个问题。我很好奇是否有人知道为什么会发生这种情况 - 下面的 git diff:

     adamantium (0.2.0)
        ice_nine (~> 0.11.0)
        memoizable (~> 0.4.0)
 -    addressable (2.3.7)
 +    addressable (2.4.0)
      annotate (2.6.8)
        activerecord (>= 3.2, <= 4.3)
        rake (~> 10.4)
 @@ -122,7 +122,7 @@ GEM
      capistrano-deploy-strategy-archive (0.1.2)
        capistrano (>= 2.1.0)
      chronic (0.10.2)
 -    chunky_png (1.3.4)
 +    chunky_png (1.3.7)
      climate_control (0.0.3)
        activesupport (>= 3.0)
      cocaine (0.5.7)
 @@ -145,10 +145,10 @@ GEM
        sass (>= 3.3.0, < 3.5)
      compass-import-once (1.0.5)
        sass (>= 3.2, < 3.5)
 -    compass-rails (2.0.4)
 +    compass-rails (3.0.2)
        compass (~> 1.0.0)
 -      sass-rails (<= 5.0.1)
 -      sprockets (< 2.13)
 +      sass-rails (< 5.1)
 +      sprockets (< 4.0)
      concord (0.1.5)
        adamantium (~> 0.2.0)
        equalizer (~> 0.0.9)
 @@ -180,7 +180,7 @@ GEM
      descendants_tracker (0.0.4)
        thread_safe (~> 0.3, >= 0.3.1)
      diff-lcs (1.2.5)
 -    domain_name (0.5.23)
 +    domain_name (0.5.24)
        unf (>= 0.0.5, < 1.0.0)
      dotenv (2.0.1)
      dotenv-rails (2.0.1)
 @@ -197,17 +197,17 @@ GEM
      eventmachine (1.0.7)
      eventmachine (1.0.7-java)
      excon (0.51.0)
 -    execjs (2.4.0)
 +    execjs (2.7.0)
      ezcrypto (0.7.2)
      faker (1.4.3)
        i18n (~> 0.5)
 -    faraday (0.9.1)
 +    faraday (0.9.2)
        multipart-post (>= 1.2, < 3)
      fast_stack (0.1.0)
        rake
        rake-compiler
 -    ffi (1.2.1)
 -    ffi (1.2.1-java)
 +    ffi (1.9.14)
 +    ffi (1.9.14-java)
      fission (0.5.0)
        CFPropertyList (~> 2.2)
      fixture_builder (0.3.6)
 @@ -389,7 +389,7 @@ GEM
        nokogiri (~> 1.6.0)
        ruby_parser (~> 3.5)
      htmltokenizer (1.0)
 -    http (0.6.3)
 +    http (0.6.4)
        http_parser.rb (~> 0.6.0)
      http-cookie (1.0.2)
        domain_name (~> 0.5)
 @@ -404,10 +404,10 @@ GEM
        RubyInline (~> 3.9)
      inflecto (0.0.2)
      ipaddress (0.8.3)
 -    jbuilder (2.2.11)
 +    jbuilder (2.3.2)
        activesupport (>= 3.0.0, < 5)
        multi_json (~> 1.2)
 -    jquery-rails (4.0.3)
 +    jquery-rails (4.0.5)
        rails-dom-testing (~> 1.0)
        railties (>= 4.2.0)
        thor (>= 0.14, < 2.0)
 @@ -454,7 +454,7 @@ GEM
      multi_json (1.12.1)
      multi_xml (0.5.5)
      multipart-post (2.0.0)
 -    naught (1.0.0)
 +    naught (1.1.0)
      net-http-digest_auth (1.4)
      net-http-persistent (2.9.4)
      net-scp (1.2.1)
 @@ -565,14 +565,15 @@ GEM
        rake
      rakismet (1.5.3)
      raspell (1.3)
 -    rb-fsevent (0.9.4)
 -    rb-inotify (0.9.5)
 +    rb-fsevent (0.9.7)
 +    rb-inotify (0.9.7)
        ffi (>= 0.5.0)
      rbvmomi (1.8.2)
        builder
        nokogiri (>= 1.4.1)
        trollop
 -    rdoc (4.2.0)
 +    rdoc (4.2.2)
 +      json (~> 1.4)
      redis (3.2.1)
      redis-actionpack (4.0.1)
        actionpack (~> 4)
 @@ -604,7 +605,8 @@ GEM
      right_aws (3.1.0)
        right_http_connection (>= 1.2.5)
      right_http_connection (1.5.0)
 -    rollbar (2.0.1)
 +    rollbar (2.13.1)
 +      multi_json
      rspec (3.2.0)
        rspec-core (~> 3.2.0)
        rspec-expectations (~> 3.2.0)
 @@ -646,33 +648,33 @@ GEM
        parser (>= 2.2.0, < 3.0)
        reek (= 1.6.5)
        virtus (~> 1.0)
 -    rubyzip (1.1.7)
 +    rubyzip (1.2.0)
      rvm-capistrano (1.5.6)
        capistrano (~> 2.15.4)
      safe_yaml (1.0.4)
      sass (3.4.22)
 -    sass-rails (5.0.1)
 +    sass-rails (5.0.4)
        railties (>= 4.0.0, < 5.0)
        sass (~> 3.1)
        sprockets (>= 2.8, < 4.0)
        sprockets-rails (>= 2.0, < 4.0)
 -      tilt (~> 1.1)
 +      tilt (>= 1.1, < 3)
      sdoc (0.4.1)
        json (~> 1.7, >= 1.7.7)
        rdoc (~> 4.0)
      sexp_processor (4.7.0)
 -    simple_form (3.1.0)
 -      actionpack (~> 4.0)
 -      activemodel (~> 4.0)
 +    simple_form (3.3.1)
 +      actionpack (> 4, < 5.1)
 +      activemodel (> 4, < 5.1)
      simple_oauth (0.3.1)
      sinatra (1.4.5)
        rack (~> 1.4)
        rack-protection (~> 1.4)
        tilt (~> 1.3, >= 1.3.4)
 -    skylight (0.8.1)
 +    skylight (0.10.6)
        activesupport (>= 3.0.0)
      slop (3.6.0)
 -    spoon (0.0.4)
 +    spoon (0.0.6)
        ffi
      sprockets (2.12.4)
        hike (~> 1.2)
 @@ -683,20 +685,20 @@ GEM
        actionpack (>= 3.0)
        activesupport (>= 3.0)
        sprockets (>= 2.8, < 4.0)
 -    stackprof (0.2.7)
 +    stackprof (0.2.9)
      stripe (1.36.0)
        json (~> 1.8.1)
        rest-client (~> 1.4)
 -    stripe_event (1.5.0)
 +    stripe_event (1.5.1)
        activesupport (>= 3.1)
        stripe (~> 1.6)
      test-unit (3.0.9)
        power_assert
      thor (0.19.1)
      thread_safe (0.3.5)
      thread_safe (0.3.5-java)
 -    tidy_ffi (0.1.5)
 -      ffi (~> 1.2.0)
 +    tidy_ffi (0.1.6)
 +      ffi (~> 1.2)
      tilt (1.4.1)
      trollop (2.1.2)
      truncate_html (0.9.3)
 @@ -713,13 +715,12 @@ GEM
        simple_oauth (~> 0.3.0)
      tzinfo (1.2.2)
        thread_safe (~> 0.1)
 -    uglifier (2.7.1)
 -      execjs (>= 0.3.0)
 -      json (>= 1.8.0)
 +    uglifier (3.0.2)
 +      execjs (>= 0.3.0, < 3)
      unf (0.1.4)
        unf_ext
      unf (0.1.4-java)
 -    unf_ext (0.0.6)
 +    unf_ext (0.0.7.1)
      uniform_notifier (1.9.0)
      unparser (0.2.2)
        abstract_type (~> 0.0.7)
 @@ -734,19 +735,19 @@ GEM
        coercible (~> 1.0)
        descendants_tracker (~> 0.0, >= 0.0.3)
        equalizer (~> 0.0, >= 0.0.9)
 -    visual_captcha (0.0.1)
 +    visual_captcha (0.0.2)
        json
      web-console (2.1.2)
        activemodel (>= 4.0)
        binding_of_caller (>= 0.7.2)
        railties (>= 4.0)
        sprockets-rails (>= 2.0, < 4.0)
      webrobots (0.1.1)
 -    whenever (0.9.4)
 +    whenever (0.9.7)
        chronic (>= 0.6.3)
 -    wicked (1.1.1)
 -      rails (>= 3.0.7)
 -    will_paginate (3.0.7)
 +    wicked (1.3.1)
 +      railties (>= 3.0.7)
 +    will_paginate (3.1.3)
      woo (0.2.0)
        bourbon
        decent_exposure
 @@ -887,4 +888,4 @@ DEPENDENCIES
    zaru

  BUNDLED WITH
 -   1.12.5
 +   1.13.1

最佳答案

我也遇到过。在谷歌搜索后,我将你的 Gemfile.lock 与我的进行了最后的比较,发现我使用的是相同版本的 skylight

对于看到这篇文章的任何人,将 skylight 升级到 0.10.6 可能也会为您解决问题。

除此之外,可能值得选择性地删除依赖项,如 sqlite3mysql,它们在应用程序启动之前也可能是罪魁祸首。

关于ruby - Rails 服务器启动时 malloc_zone_unregister 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39710719/

相关文章:

c - C应用程序中的内存分配

ruby - 了解 Ruby 继承

c - Ruby sqlite3 gem 无法在 WSL 上编译

javascript - 如何在不刷新的情况下在 Rails 4 中提交表单和更新页面元素

ruby-on-rails - 匹配和分离 Rails 序列化数组

c - 使用 malloc 创建的结构体设置值的段错误

c - realloc 似乎没有重新分配内存

ruby - 如何访问 sinatra 错误处理程序中响应的 HTTP 代码?

ruby - 通过管道执行 ruby​​ 脚本时 $stdin.gets 不起作用

javascript - 在 Rails 助手中生成唯一标识符