{"record":{"id":"230f2c532c46772d","repo":"ruby/rubygems","slug":"unexpected-sign-for-bignum-b-sign-chr-inspect","errorCode":null,"errorMessage":"Unexpected sign for Bignum #{b.sign.chr.inspect} (#{b.sign})","messagePattern":"Unexpected sign for Bignum #(.+?) \\(#(.+?)\\)","errorType":"exception","errorClass":"Gem::SafeMarshal::Visitors::ToRuby::FormatError","httpStatus":null,"severity":"error","filePath":"lib/rubygems/safe_marshal/visitors/to_ruby.rb","lineNumber":260,"sourceCode":"          else\n            f.string.to_f\n          end\n        )\n      end\n\n      def visit_Gem_SafeMarshal_Elements_Bignum(b)\n        result = 0\n        b.data.each_byte.with_index do |byte, exp|\n          result += (byte * 2**(exp * 8))\n        end\n\n        case b.sign\n        when 43 # ?+\n          result\n        when 45 # ?-\n          -result\n        else\n          raise FormatError, \"Unexpected sign for Bignum #{b.sign.chr.inspect} (#{b.sign})\"\n        end\n      end\n\n      def visit_Gem_SafeMarshal_Elements_UserClass(r)\n        if resolve_class(r.name) == ::Hash && r.wrapped_object.is_a?(Elements::Hash)\n\n          hash = register_object({}.compare_by_identity)\n\n          o = r.wrapped_object\n          o.pairs.each_with_index do |(k, v), i|\n            push_stack i\n            k = visit(k)\n            push_stack k\n            hash[k] = visit(v)\n          end\n\n          if o.is_a?(Elements::HashWithDefaultValue)\n            push_stack :default","sourceCodeStart":242,"sourceCodeEnd":278,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/rubygems/safe_marshal/visitors/to_ruby.rb#L242-L278","documentation":"Error \"Unexpected sign for Bignum #{b.sign.chr.inspect} (#{b.sign})\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/rubygems/safe_marshal/visitors/to_ruby.rb:260 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The metadata bignum is malformed; the file is corrupt — re-download the gem"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"86cbb817a38ce8477b181c17467a703ded3f2be8","analyzedAt":"2026-08-23T06:27:48.159Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}