Project

General

Profile

Fix #8286

0.80~rc1: `crushtool` crash

Added by Dmitry Smirnov almost 10 years ago. Updated almost 8 years ago.

Status:
Resolved
Priority:
Low
Assignee:
Category:
ceph cli
Target version:
-
% Done:

0%

Source:
Community (user)
Tags:
Backport:
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

# ceph osd getmap -o osdmap
# crushtool -d osdmap -o osdmap.txt

Produces

terminate called after throwing an instance of 'ceph::buffer::malformed_input'
  what():  buffer::malformed_input: bad magic number
*** Caught signal (Aborted) **
 in thread 7fbea0823780
 ceph version 0.80-rc1 (6769f4dc88425396921f94e1a37a1c90758aa3ea)
 1: (()+0xf60ef) [0x7fbea09770ef]
 2: (()+0xf880) [0x7fbea0451880]
 3: (gsignal()+0x39) [0x7fbe9ed163a9]
 4: (abort()+0x148) [0x7fbe9ed194c8]
 5: (__gnu_cxx::__verbose_terminate_handler()+0x155) [0x7fbe9f6035e5]
 6: (()+0x5e746) [0x7fbe9f601746]
 7: (()+0x5e773) [0x7fbe9f601773]
 8: (()+0x5e9b2) [0x7fbe9f6019b2]
 9: (CrushWrapper::decode(ceph::buffer::list::iterator&)+0x4aa) [0x7fbea09a199a]
 10: (main()+0x2244) [0x7fbea096e454]
 11: (__libc_start_main()+0xf5) [0x7fbe9ed02b45]
 12: (()+0xf04d7) [0x7fbea09714d7]
2014-05-03 12:09:26.526276 7fbea0823780 -1 *** Caught signal (Aborted) **
 in thread 7fbea0823780

 ceph version 0.80-rc1 (6769f4dc88425396921f94e1a37a1c90758aa3ea)
 1: (()+0xf60ef) [0x7fbea09770ef]
 2: (()+0xf880) [0x7fbea0451880]
 3: (gsignal()+0x39) [0x7fbe9ed163a9]
 4: (abort()+0x148) [0x7fbe9ed194c8]
 5: (__gnu_cxx::__verbose_terminate_handler()+0x155) [0x7fbe9f6035e5]
 6: (()+0x5e746) [0x7fbe9f601746]
 7: (()+0x5e773) [0x7fbe9f601773]
 8: (()+0x5e9b2) [0x7fbe9f6019b2]
 9: (CrushWrapper::decode(ceph::buffer::list::iterator&)+0x4aa) [0x7fbea09a199a]
 10: (main()+0x2244) [0x7fbea096e454]
 11: (__libc_start_main()+0xf5) [0x7fbe9ed02b45]
 12: (()+0xf04d7) [0x7fbea09714d7]
 NOTE: a copy of the executable, or `objdump -rdS <executable>` is needed to interpret this.

--- begin dump of recent events ---
   -12> 2014-05-03 12:09:26.447361 7fbea0823780  5 asok(0x7fbea1723b30) register_command perfcounters_dump hook 0x7fbea1725660
   -11> 2014-05-03 12:09:26.447402 7fbea0823780  5 asok(0x7fbea1723b30) register_command 1 hook 0x7fbea1725660
   -10> 2014-05-03 12:09:26.447412 7fbea0823780  5 asok(0x7fbea1723b30) register_command perf dump hook 0x7fbea1725660
    -9> 2014-05-03 12:09:26.447421 7fbea0823780  5 asok(0x7fbea1723b30) register_command perfcounters_schema hook 0x7fbea1725660
    -8> 2014-05-03 12:09:26.447429 7fbea0823780  5 asok(0x7fbea1723b30) register_command 2 hook 0x7fbea1725660
    -7> 2014-05-03 12:09:26.447434 7fbea0823780  5 asok(0x7fbea1723b30) register_command perf schema hook 0x7fbea1725660
    -6> 2014-05-03 12:09:26.447443 7fbea0823780  5 asok(0x7fbea1723b30) register_command config show hook 0x7fbea1725660
    -5> 2014-05-03 12:09:26.447452 7fbea0823780  5 asok(0x7fbea1723b30) register_command config set hook 0x7fbea1725660
    -4> 2014-05-03 12:09:26.447462 7fbea0823780  5 asok(0x7fbea1723b30) register_command config get hook 0x7fbea1725660
    -3> 2014-05-03 12:09:26.447469 7fbea0823780  5 asok(0x7fbea1723b30) register_command log flush hook 0x7fbea1725660
    -2> 2014-05-03 12:09:26.447478 7fbea0823780  5 asok(0x7fbea1723b30) register_command log dump hook 0x7fbea1725660
    -1> 2014-05-03 12:09:26.447486 7fbea0823780  5 asok(0x7fbea1723b30) register_command log reopen hook 0x7fbea1725660
     0> 2014-05-03 12:09:26.526276 7fbea0823780 -1 *** Caught signal (Aborted) **
 in thread 7fbea0823780

 ceph version 0.80-rc1 (6769f4dc88425396921f94e1a37a1c90758aa3ea)
 1: (()+0xf60ef) [0x7fbea09770ef]
 2: (()+0xf880) [0x7fbea0451880]
 3: (gsignal()+0x39) [0x7fbe9ed163a9]
 4: (abort()+0x148) [0x7fbe9ed194c8]
 5: (__gnu_cxx::__verbose_terminate_handler()+0x155) [0x7fbe9f6035e5]
 6: (()+0x5e746) [0x7fbe9f601746]
 7: (()+0x5e773) [0x7fbe9f601773]
 8: (()+0x5e9b2) [0x7fbe9f6019b2]
 9: (CrushWrapper::decode(ceph::buffer::list::iterator&)+0x4aa) [0x7fbea09a199a]
 10: (main()+0x2244) [0x7fbea096e454]
 11: (__libc_start_main()+0xf5) [0x7fbe9ed02b45]
 12: (()+0xf04d7) [0x7fbea09714d7]
 NOTE: a copy of the executable, or `objdump -rdS <executable>` is needed to interpret this.

--- logging levels ---
   0/ 5 none
   0/ 1 lockdep
   0/ 1 context
   1/ 1 crush
   1/ 5 mds
   1/ 5 mds_balancer
   1/ 5 mds_locker
   1/ 5 mds_log
   1/ 5 mds_log_expire
   1/ 5 mds_migrator
   0/ 1 buffer
   0/ 1 timer
   0/ 1 filer
   0/ 1 striper
   0/ 1 objecter
   0/ 5 rados
   0/ 5 rbd
   0/ 5 journaler
   0/ 5 objectcacher
   0/ 5 client
   0/ 5 osd
   0/ 5 optracker
   0/ 5 objclass
   1/ 3 filestore
   1/ 3 keyvaluestore
   1/ 3 journal
   0/ 5 ms
   1/ 5 mon
   0/10 monc
   1/ 5 paxos
   0/ 5 tp
   1/ 5 auth
   1/ 5 crypto
   1/ 1 finisher
   1/ 5 heartbeatmap
   1/ 5 perfcounter
   1/ 5 rgw
   1/ 5 javaclient
   1/ 5 asok
   1/ 1 throttle
  -2/-2 (syslog threshold)
  99/99 (stderr threshold)
  max_recent       500
  max_new         1000
  log_file 
--- end dump of recent events ---

Crashes are not user-friendly even if command line tool incorrectly invoked.

Associated revisions

Revision 7663b9f0 (diff)
Added by Brad Hubbard about 8 years ago

crushtool: Don't crash when called on a file that isn't a crushmap

Fixes: #8286
Signed-off-by: Brad Hubbard <>

History

#1 Updated by Loïc Dachary over 9 years ago

  • Tracker changed from Bug to Fix

#2 Updated by Brad Hubbard about 8 years ago

  • Status changed from New to 12
  • Assignee set to Brad Hubbard

#3 Updated by Brad Hubbard about 8 years ago

  • Status changed from 12 to In Progress

https://github.com/ceph/ceph/pull/8038

Before:

$ ./crushtool -d /etc/hosts|& head -2
terminate called after throwing an instance of 'ceph::buffer::malformed_input'
what(): buffer::malformed_input: bad magic number

After:

$ ./crushtool -d /etc/hosts
./crushtool: unable to decode /etc/hosts

#4 Updated by Brad Hubbard almost 8 years ago

  • Status changed from In Progress to Resolved

Also available in: Atom PDF