Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-210

src/tcmalloc.cc:353] Attempt to free invalid pointer: 0x2253d0

    • Type: Icon: Task Task
    • Resolution: Done
    • 12_01_17
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Odd issue that has taken me forever to figure out what's causing it. Here is a little outline what happens.
      p = Product.first #valid product
      u = User.first #valid user
      pu = Purchaser.from_user(u) #generates a valid purchaser object
      #=> #<Purchaser _id: 4c49eba6b57f988f32000001, name: "Timmy Zuza", created_at: nil, quantity: 1, updated_at: nil, user_id: "4c43cc48b57f983010000001">
      p.purchasers << pu
      #=> [#<Purchaser _id: 4c49eba6b57f988f32000001, name: "Timmy Zuza", created_at: nil, quantity: 1, updated_at: nil, user_id: "4c43cc48b57f983010000001">]
      p.save
      src/tcmalloc.cc:353] Attempt to free invalid pointer: 0x2253d0

      The error actually kills the ruby process
      Here is a gist of my setup and more details: http://gist.github.com/487924
      (I simplified the product.rb quite a bit)

      The way to avoid this issue is to take out "embedded_in :product, :inverse_of => :purchasers" from purchaser file. I'm hoping this will help you track down the issue.

            Assignee:
            Unassigned Unassigned
            Reporter:
            andrew.kalek@anlek.com Andrew Kalek
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              None
              None
              None
              None