Skip to content
This repository has been archived by the owner on May 9, 2020. It is now read-only.

Empty Chef Key #28

Open
cjoelrun opened this issue Jan 7, 2014 · 0 comments
Open

Empty Chef Key #28

cjoelrun opened this issue Jan 7, 2014 · 0 comments

Comments

@cjoelrun
Copy link

cjoelrun commented Jan 7, 2014

Hit a bug trying to create and ChefAPI with and empty string as the RSA key.

This was a bug in our code for even trying to do such a thing, but the
resulting segmenation fault was not very helpful.

gdb:

Starting program: /home/cameron/.venvs/monster/bin/python ./compute.py destroy -n qa-gate-precise-nova-net
warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7ffff7ffa000
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff4087654 in RSA_size () from /usr/lib/libcrypto.so.1.0.0

backtrace:

#0  0x00007ffff4087654 in RSA_size () from /usr/lib/libcrypto.so.1.0.0
#1  0x00007ffff2b2cd8c in ffi_call_unix64 () from /usr/lib/libffi.so.6
#2  0x00007ffff2b2c6bc in ffi_call () from /usr/lib/libffi.so.6
#3  0x00007ffff2d3f9fb in _ctypes_callproc () from /home/cameron/.venvs/monster/lib/python2.7/lib-dynload/_ctypes.so
#4  0x00007ffff2d39a65 in ?? () from /home/cameron/.venvs/monster/lib/python2.7/lib-dynload/_ctypes.so
#5  0x00007ffff7a65c43 in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#6  0x00007ffff7af59f1 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#7  0x00007ffff7afa2a0 in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#8  0x00007ffff7af9499 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#9  0x00007ffff7afa2a0 in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#10 0x00007ffff7af9499 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#11 0x00007ffff7afa2a0 in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#12 0x00007ffff7af9499 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#13 0x00007ffff7afa2a0 in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#14 0x00007ffff7af9499 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#15 0x00007ffff7afa2a0 in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#16 0x00007ffff7a89b30 in function_call () from /usr/lib/libpython2.7.so.1.0
#17 0x00007ffff7a65c43 in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#18 0x00007ffff7a7444d in instancemethod_call () from /usr/lib/libpython2.7.so.1.0
#19 0x00007ffff7a65c43 in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#20 0x00007ffff7ab9333 in call_method () from /usr/lib/libpython2.7.so.1.0
#21 0x00007ffff7af56a7 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#22 0x00007ffff7afa2a0 in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#23 0x00007ffff7a89c0d in function_call () from /usr/lib/libpython2.7.so.1.0
#24 0x00007ffff7a65c43 in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#25 0x00007ffff7a7444d in instancemethod_call () from /usr/lib/libpython2.7.so.1.0
#26 0x00007ffff7a65c43 in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#27 0x00007ffff7ab9e57 in slot_tp_init () from /usr/lib/libpython2.7.so.1.0
#28 0x00007ffff7ab8bcf in type_call () from /usr/lib/libpython2.7.so.1.0
#29 0x00007ffff7a65c43 in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#30 0x00007ffff7af59f1 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#31 0x00007ffff7afa2a0 in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#32 0x00007ffff7af9499 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#33 0x00007ffff7afa2a0 in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#34 0x00007ffff7af9499 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#35 0x00007ffff7afa2a0 in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#36 0x00007ffff7a89c0d in function_call () from /usr/lib/libpython2.7.so.1.0
#37 0x00007ffff7a65c43 in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#38 0x00007ffff7af5d70 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#39 0x00007ffff7a7f8d8 in gen_send_ex.isra.0 () from /usr/lib/libpython2.7.so.1.0
#40 0x00007ffff7af65c6 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#41 0x00007ffff7a7f8d8 in gen_send_ex.isra.0 () from /usr/lib/libpython2.7.so.1.0
#42 0x00007ffff7af65c6 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#43 0x00007ffff7afa2a0 in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#44 0x00007ffff7a89c0d in function_call () from /usr/lib/libpython2.7.so.1.0
#45 0x00007ffff7a65c43 in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#46 0x00007ffff7af5d70 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#47 0x00007ffff7afa2a0 in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#48 0x00007ffff7af9499 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#49 0x00007ffff7afa2a0 in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#50 0x00007ffff7afa3a2 in PyEval_EvalCode () from /usr/lib/libpython2.7.so.1.0
#51 0x00007ffff7b1309f in run_mod () from /usr/lib/libpython2.7.so.1.0
#52 0x00007ffff7b141be in PyRun_FileExFlags () from /usr/lib/libpython2.7.so.1.0
#53 0x00007ffff7b15329 in PyRun_SimpleFileExFlags () from /usr/lib/libpython2.7.so.1.0
#54 0x00007ffff7b25ccf in Py_Main () from /usr/lib/libpython2.7.so.1.0
#55 0x00007ffff7476b05 in __libc_start_main () from /usr/lib/libc.so.6
#56 0x0000000000400741 in _start ()

strace:

open("/home/cameron/work/monster/monster/../config.yaml", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=13309, ...}) = 0
fstat(3, {st_mode=S_IFREG|0644, st_size=13309, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f16aeed7000
read(3, "chef:\n  server:\n    install_scri"..., 4096) = 4096
brk(0x1a7e000)                          = 0x1a7e000
brk(0x1a9f000)                          = 0x1a9f000
brk(0x1ac0000)                          = 0x1ac0000
brk(0x1ae1000)                          = 0x1ae1000
brk(0x1b27000)                          = 0x1b27000
read(3, "101.133.0/24\n        nova: 198.1"..., 4096) = 4096
brk(0x1b48000)                          = 0x1b48000
brk(0x1b69000)                          = 0x1b69000
brk(0x1b8a000)                          = 0x1b8a000
brk(0x1bab000)                          = 0x1bab000
brk(0x1bcc000)                          = 0x1bcc000
read(3, "198.101.133.159\n            hori"..., 4096) = 4096
brk(0x1bed000)                          = 0x1bed000
brk(0x1c0e000)                          = 0x1c0e000
brk(0x1c2f000)                          = 0x1c2f000
brk(0x1c50000)                          = 0x1c50000
brk(0x1c71000)                          = 0x1c71000
read(3, ":\n    precise: Ubuntu 12.04 LTS "..., 4096) = 1021
read(3, "", 4096)                       = 0
brk(0x1c92000)                          = 0x1c92000
read(3, "", 4096)                       = 0
brk(0x1cb3000)                          = 0x1cb3000
open("/home/cameron/work/monster/monster/../secret.yaml", O_RDONLY) = 4
fstat(4, {st_mode=S_IFREG|0644, st_size=228, ...}) = 0
fstat(4, {st_mode=S_IFREG|0644, st_size=228, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f16aeed6000
read(4, "cloudfiles:\n  user: cameron.lope"..., 4096) = 228
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
close(3)                                = 0
munmap(0x7f16aeed7000, 4096)            = 0
close(4)                                = 0
munmap(0x7f16aeed6000, 4096)            = 0
getcwd("/home/cameron/work/monster", 1024) = 27
stat("/home/cameron/work/monster/.chef/knife.rb", 0x7fff3b500310) = -1 ENOENT (No such file or directory)
stat("/home/cameron/work/.chef/knife.rb", 0x7fff3b500310) = -1 ENOENT (No such file or directory)
stat("/home/cameron/.chef/knife.rb", {st_mode=S_IFREG|0644, st_size=384, ...}) = 0
access("/home/cameron/.chef/knife.rb", R_OK) = 0
open("/home/cameron/.chef/knife.rb", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=384, ...}) = 0
fstat(3, {st_mode=S_IFREG|0644, st_size=384, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f16aeed7000
read(3, "log_level                :info\nl"..., 8192) = 384
read(3, "", 4096)                       = 0
read(3, "", 8192)                       = 0
close(3)                                = 0
munmap(0x7f16aeed7000, 4096)            = 0
stat("/home/cameron/.chef/cameron.pem", {st_mode=S_IFREG|0644, st_size=1675, ...}) = 0
access("/home/cameron/.chef/cameron.pem", R_OK) = 0
open("/home/cameron/.chef/cameron.pem", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=1675, ...}) = 0
fstat(3, {st_mode=S_IFREG|0644, st_size=1675, ...}) = 0
lseek(3, 0, SEEK_CUR)                   = 0
fstat(3, {st_mode=S_IFREG|0644, st_size=1675, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f16aeed7000
lseek(3, 0, SEEK_CUR)                   = 0
read(3, "-----BEGIN RSA PRIVATE KEY-----\n"..., 4096) = 1675
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0x7f16aeed7000, 4096)            = 0
open("/dev/urandom", O_RDONLY|O_NOCTTY|O_NONBLOCK) = 3
fstat(3, {st_mode=S_IFCHR|0666, st_rdev=makedev(1, 9), ...}) = 0
poll([{fd=3, events=POLLIN}], 1, 10)    = 1 ([{fd=3, revents=POLLIN}])
read(3, "\2623\261\376\314\350\32\372\221o\2252L)\7\373,~\206c\336\241>\231\21\215~Lq\305V4", 32) = 32
close(3)                                = 0
getuid()                                = 1000
socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 3
connect(3, {sa_family=AF_INET, sin_port=htons(443), sin_addr=inet_addr("198.101.133.3")}, 16) = 0
getpeername(3, {sa_family=AF_INET, sin_port=htons(443), sin_addr=inet_addr("198.101.133.3")}, [16]) = 0
write(3, "\26\3\1\1-\1\0\1)\3\3R\3148}\rzf\334]\300\207\343%\\\25\272\343\1\3331\240"..., 306) = 306
read(3, "\26\3\1\0:\2\0", 7)            = 7
read(3, "\0006\3\1R\3148\372\314\234E0\234*\250z\36\260X{\215\236\332\231\371ZkX\276\246\f\4"..., 56) = 56
read(3, "\26\3\1\3\316", 5)             = 5
read(3, "\v\0\3\312\0\3\307\0\3\3040\202\3\3000\202\2\250\2\t\0\213\213:\303\33\224\273\3330\r\6"..., 974) = 974
read(3, "\26\3\1\0\4", 5)               = 5
read(3, "\16\0\0\0", 4)                 = 4
write(3, "\26\3\1\1\6\20\0\1\2\1\0\26c\236(V\317v\260\34\355\237\230\26x\363\355\2533%s\311"..., 314) = 314
read(3, "\26\3\1\0\252", 5)             = 5
read(3, "\4\0\0\246\0\0\1,\0\240\360\303v\323\362\354\252\223\310\237\271\373\254\320T\362\264\345\3311;\t"..., 170) = 170
read(3, "\24\3\1\0\1", 5)               = 5
read(3, "\1", 1)                        = 1
read(3, "\26\3\1\0$", 5)                = 5
read(3, "\374\336\177\267\26\265\16\375eU\312\3217\366%/v\37\203>SLK\32$\245\271<Y\233A\337"..., 36) = 36
write(3, "\27\3\1\3Z\2\357x\357\242\311HI\352\26\234\343\307\226\310n\270\23B\322\211\6i\363G\254\360"..., 863) = 863
read(3, "\27\3\1\10\222", 5)            = 5
read(3, ":\245\34\3517\251\32\225P\321\233\216\237\t~\n\360#\257\275S\227\257E\344\236\27E\320\27\363\324"..., 2194) = 2194
close(3)                                = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x20} ---
+++ killed by SIGSEGV (core dumped) +++
zsh: segmentation fault (core dumped)  strace python ./compute.py destroy -n qa-gate-precise-nova-net
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant