I'm running msys2 mingw64 bit (installed from msys2-x86_64-20161025.exe) and trying to compile and run some C++ code which will connect to a local mysql instance. I have managed to compile but get a segfault on run. Details below: What have I missed?
./test.exe
Segmentation fault
My code:
#include <stdlib.h>
#include <iostream>
#include <mysql_connection.h>
#include <driver.h>
#include <exception.h>
#include <resultset.h>
#include <statement.h>
using namespace sql;
int main(void){
sql::Driver *driver;
sql::Connection *con;
driver = get_driver_instance();
con = driver->connect("tcp://127.0.0.1:3306","root","coolpasswd");
return 0;
}
Compile
g++ -Wall -I /c/Program\ Files/MySQL/Connector\ C++\ 1.1/include/ -I /c/Program\ Files/MySQL/Connector\ C++\ 1.1/include/cppconn -I /c/msys64/mingw32/include/ -L /c/Program\ Files/MySQL/Connector\ C++\ 1.1/lib/opt -o test test.cpp -lmysqlcppconn --verbose
My Path
export PATH=/c/Program\ Files/MySQL/Connector\ C++\ 1.1/lib/opt:$PATH
strace test.exe
[SNIP]
create_child: test.exe
45 12365 [main] test 21024 posify_maybe: env var converted to PATH=/c/Program Files/MySQL/Connector C++ 1.1/lib/opt:/c/php-7.0.27-Win32-VC14-x64:/mingw64/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/usr/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
108 12473 [main] test 21024 win32env_to_cygenv: 0x600039170: PATH=/c/Program Files/MySQL/Connector C++ 1.1/lib/opt:/c/php-7.0.27-Win32-VC14-x64:/mingw64/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/usr/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
78 12551 [main] test 21024 win32env_to_cygenv: 0x600028D30: PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
75 12626 [main] test 21024 win32env_to_cygenv: 0x600028D80: PKG_CONFIG_PATH=/mingw64/lib/pkgconfig:/mingw64/share/pkgconfig
75 12701 [main] test 21024 win32env_to_cygenv: 0x600028DD0: PRINTER=Adobe PDF
72 12773 [main] test 21024 win32env_to_cygenv: 0x600028DF0: PROCESSOR_ARCHITECTURE=AMD64
72 12845 [main] test 21024 win32env_to_cygenv: 0x600028E20: PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 45 Stepping 6, GenuineIntel
74 12919 [main] test 21024 win32env_to_cygenv: 0x600028E70: PROCESSOR_LEVEL=6
71 12990 [main] test 21024 win32env_to_cygenv: 0x600028E90: PROCESSOR_REVISION=2d06
72 13062 [main] test 21024 win32env_to_cygenv: 0x6000392B0: PROGRAMFILES=C:\Program Files
71 13133 [main] test 21024 win32env_to_cygenv: 0x6000392E0: PROMPT=$P$G
76 13209 [main] test 21024 win32env_to_cygenv: 0x600039300: PS1=\[\e]0;\w\a\]\n\[\e[32m\]\u#\h \[\e[35m\]$MSYSTEM\[\e[0m\] \[\e[33m\]\w\[\e[0m\]\n\$
73 13282 [main] test 21024 win32env_to_cygenv: 0x600039370: PSModulePath=C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
75 13357 [main] test 21024 win32env_to_cygenv: 0x6000393F0: PUBLIC=C:\Users\Public
72 13429 [main] test 21024 win32env_to_cygenv: 0x600039410: PWD=/c/Users/tomk/Documents/of_v0.9.8_msys2_release/examples/video/videoPlayerTomek
71 13500 [main] test 21024 win32env_to_cygenv: 0x600039470: ProgramData=C:\ProgramData
72 13572 [main] test 21024 win32env_to_cygenv: 0x6000394A0: ProgramFiles(x86)=C:\Program Files (x86)
73 13645 [main] test 21024 win32env_to_cygenv: 0x6000394E0: ProgramW6432=C:\Program Files
82 13727 [main] test 21024 win32env_to_cygenv: 0x600039510: SESSIONNAME=Console
72 13799 [main] test 21024 win32env_to_cygenv: 0x600039530: SHELL=/usr/bin/bash
70 13869 [main] test 21024 win32env_to_cygenv: 0x600039550: SHLVL=1
70 13939 [main] test 21024 win32env_to_cygenv: 0x600039570: SYSTEMDRIVE=C:
72 14011 [main] test 21024 win32env_to_cygenv: 0x600039590: SYSTEMROOT=C:\WINDOWS
71 14082 [main] test 21024 getwinenv: can't set native for TEMP= since no environ yet
39 14121 [main] test 21024 mount_info::conv_to_posix_path: conv_to_posix_path (C:\msys64\tmp, 0x10000000, no-add-slash)
45 14166 [main] test 21024 normalize_win32_path: C:\msys64\tmp = normalize_win32_path (C:\msys64\tmp)
40 14206 [main] test 21024 mount_info::conv_to_posix_path: mount[0] .. checking / -> C:\msys64
40 14246 [main] test 21024 mount_info::conv_to_posix_path: /tmp = conv_to_posix_path (C:\msys64\tmp)
102 14348 [main] test 21024 win_env::add_cache: posix /tmp
40 14388 [main] test 21024 win_env::add_cache: native TEMP=C:\msys64\tmp
41 14429 [main] test 21024 posify_maybe: env var converted to TEMP=/tmp
102 14531 [main] test 21024 win32env_to_cygenv: 0x600039610: TEMP=/tmp
74 14605 [main] test 21024 win32env_to_cygenv: 0x6000395B0: TERM=xterm
71 14676 [main] test 21024 getwinenv: can't set native for TMP= since no environ yet
40 14716 [main] test 21024 mount_info::conv_to_posix_path: conv_to_posix_path (C:\msys64\tmp, 0x10000000, no-add-slash)
42 14758 [main] test 21024 normalize_win32_path: C:\msys64\tmp = normalize_win32_path (C:\msys64\tmp)
40 14798 [main] test 21024 mount_info::conv_to_posix_path: mount[0] .. checking / -> C:\msys64
41 14839 [main] test 21024 mount_info::conv_to_posix_path: /tmp = conv_to_posix_path (C:\msys64\tmp)
101 14940 [main] test 21024 win_env::add_cache: posix /tmp
39 14979 [main] test 21024 win_env::add_cache: native TMP=C:\msys64\tmp
41 15020 [main] test 21024 posify_maybe: env var converted to TMP=/tmp
102 15122 [main] test 21024 win32env_to_cygenv: 0x600039690: TMP=/tmp
71 15193 [main] test 21024 win32env_to_cygenv: 0x600039630: TZ=Europe/London
71 15264 [main] test 21024 win32env_to_cygenv: 0x6000396B0: USER=tomk
70 15334 [main] test 21024 win32env_to_cygenv: 0x6000396D0: USERDOMAIN=DESKTOP-HBTHS30
71 15405 [main] test 21024 win32env_to_cygenv: 0x600039700: USERDOMAIN_ROAMINGPROFILE=DESKTOP-HBTHS30
74 15479 [main] test 21024 win32env_to_cygenv: 0x600039740: USERNAME=tomk
70 15549 [main] test 21024 win32env_to_cygenv: 0x600039760: USERPROFILE=C:\Users\tomk
71 15620 [main] test 21024 win32env_to_cygenv: 0x600039790: WD=C:\msys64\usr\bin\
75 15695 [main] test 21024 win32env_to_cygenv: 0x6000397B0: WINDIR=C:\WINDOWS
70 15765 [main] test 21024 win32env_to_cygenv: 0x6000397D0: _=/usr/bin/strace
71 15836 [main] test 21024 getwinenv: can't set native for TEMP= since no environ yet
39 15875 [main] test 21024 mount_info::conv_to_posix_path: conv_to_posix_path (C:\Users\tomk\AppData\Local\Temp, 0x10000000, no-add-slash)
41 15916 [main] test 21024 normalize_win32_path: C:\Users\tomk\AppData\Local\Temp = normalize_win32_path (C:\Users\tomk\AppData\Local\Temp)
40 15956 [main] test 21024 mount_info::conv_to_posix_path: mount[0] .. checking / -> C:\msys64
41 15997 [main] test 21024 mount_info::conv_to_posix_path: mount[1] .. checking /bin -> C:\msys64\usr\bin
41 16038 [main] test 21024 mount_info::conv_to_posix_path: /c/Users/tomk/AppData/Local/Temp = conv_to_posix_path (C:\Users\tomk\AppData\Local\Temp)
105 16143 [main] test 21024 win_env::add_cache: posix /c/Users/tomk/AppData/Local/Temp
39 16182 [main] test 21024 win_env::add_cache: native TEMP=C:\Users\tomk\AppData\Local\Temp
40 16222 [main] test 21024 posify_maybe: env var converted to TEMP=/c/Users/tomk/AppData/Local/Temp
104 16326 [main] test 21024 win32env_to_cygenv: 0x6000395D0: TEMP=/c/Users/tomk/AppData/Local/Temp
73 16399 [main] test 21024 getwinenv: can't set native for TMP= since no environ yet
38 16437 [main] test 21024 mount_info::conv_to_posix_path: conv_to_posix_path (C:\Users\tomk\AppData\Local\Temp, 0x10000000, no-add-slash)
40 16477 [main] test 21024 normalize_win32_path: C:\Users\tomk\AppData\Local\Temp = normalize_win32_path (C:\Users\tomk\AppData\Local\Temp)
41 16518 [main] test 21024 mount_info::conv_to_posix_path: mount[0] .. checking / -> C:\msys64
42 16560 [main] test 21024 mount_info::conv_to_posix_path: mount[1] .. checking /bin -> C:\msys64\usr\bin
41 16601 [main] test 21024 mount_info::conv_to_posix_path: /c/Users/tomk/AppData/Local/Temp = conv_to_posix_path (C:\Users\tomk\AppData\Local\Temp)
108 16709 [main] test 21024 win_env::add_cache: posix /c/Users/tomk/AppData/Local/Temp
40 16749 [main] test 21024 win_env::add_cache: native TMP=C:\Users\tomk\AppData\Local\Temp
39 16788 [main] test 21024 posify_maybe: env var converted to TMP=/c/Users/tomk/AppData/Local/Temp
104 16892 [main] test 21024 win32env_to_cygenv: 0x600039650: TMP=/c/Users/tomk/AppData/Local/Temp
46 16938 [main] test 21024 pinfo_init: Set nice to 0
40 16978 [main] test 21024 pinfo_init: pid 21024, pgid 21024, process_state 0x41
40 17018 [main] test 21024 App version: 2009.0, api: 0.318
41 17059 [main] test 21024 DLL version: 2010.0, api: 0.325
40 17099 [main] test 21024 DLL build: 2018-02-09 15:25
55 17154 [main] test 21024 dtable::extend: size 32, fds 0x180306130
130 17284 [main] test 21024 __get_lcid_from_locale: LCID=0x0809
410 17694 [main] test 21024 transport_layer_pipes::connect: Try to connect to named pipe: \\.\pipe\msys-dd50a72ab4668b33-lpc
68 17762 [main] test 21024 transport_layer_pipes::connect: Error opening the pipe (2)
74 17836 [main] test 21024 client_request::make_request: cygserver un-available
1009 18845 [main] test 21024 reg_key::build_reg: failed to create key ServicesForNFS in the registry
--- Process 21024 loaded C:\Windows\System32\netapi32.dll at 00007ff940e40000
--- Process 21024 loaded C:\Windows\System32\samcli.dll at 00007ff93f600000
--- Process 21024 loaded C:\Windows\System32\ucrtbase.dll at 00007ff9470f0000
--- Process 21024 loaded C:\Windows\System32\samlib.dll at 00007ff93cc30000
--- Process 21024 loaded C:\Windows\System32\netutils.dll at 00007ff946760000
4345 23190 [main] test 21024 pwdgrp::fetch_account_from_windows: line:
810 24000 [main] test 21024 pwdgrp::fetch_account_from_windows: NetLocalGroupGetInfo(None) 1376
54 24054 [main] test 21024 pwdgrp::fetch_account_from_windows: line:
751 24805 [main] test 21024 pwdgrp::fetch_account_from_windows: line:
50 24855 [main] test 21024 pwdgrp::fetch_account_from_windows: line:
42 24897 [main] test 21024 pwdgrp::fetch_account_from_windows: line:
43 24940 [main] test 21024 pwdgrp::fetch_account_from_windows: line:
44 24984 [main] test 21024 pwdgrp::fetch_account_from_windows: line:
42 25026 [main] test 21024 pwdgrp::fetch_account_from_windows: line:
43 25069 [main] test 21024 pwdgrp::fetch_account_from_windows: line:
43 25112 [main] test 21024 pwdgrp::fetch_account_from_windows: line:
42 25154 [main] test 21024 pwdgrp::fetch_account_from_windows: line:
46 25200 [main] test 21024 cygheap_user::ontherange: what 2, pw 0x180306480
41 25241 [main] test 21024 cygheap_user::ontherange: HOME is already in the environment /home/tomk
86 25327 [main] test 21024 build_argv: cmd = 'test.exe', winshell = 1, glob = 1
140 25467 [main] test 21024 build_argv: argv[0] = 'test.exe'
74 25541 [main] test 21024 build_argv: argc 1
213 25754 [main] test 21024 build_fh_pc: created an archetype (0x1803077A0) for /dev/pty4(136/4)
75 25829 [main] test 21024 build_fh_pc: fh 0x180307430, dev 00880004
83 25912 [main] test 21024 fhandler_pipe::create: name \\.\pipe\msys-dd50a72ab4668b33-pty4-from-master, size 131072, mode PIPE_TYPE_MESSAGE
82 25994 [main] test 21024 fhandler_pipe::create: pipe busy
48 26042 [main] test 21024 tty::exists: exists 1
184 26226 [main] test 21024 set_posix_access: ACL-Size: 124
93 26319 [main] test 21024 set_posix_access: Created SD-Size: 200
40 26359 [main] test 21024 fhandler_pty_slave::open: (393): pty output_mutex (0x144): waiting -1 ms
46 26405 [main] test 21024 fhandler_pty_slave::open: (393): pty output_mutex: acquired
51 26456 [main] test 21024 tty::create_inuse: cygtty.slave_alive.4 0x154
42 26498 [main] test 21024 fhandler_pty_slave::open: (396): pty output_mutex(0x144) released
91 26589 [main] test 21024 open_shared: name cygpid.19840, n 19840, shared 0x150000 (wanted 0x0), h 0x158, *m 6
52 26641 [main] test 21024 fhandler_pty_slave::open: dup handles directly since I'm the owner
64 26705 [main] test 21024 fhandler_pty_slave::open: duplicated from_master 0x3C8->0x158 from pty_owner
45 26750 [main] test 21024 fhandler_pty_slave::open: duplicated to_master 0x3D4->0x160 from pty_owner
41 26791 [main] test 21024 fhandler_pty_slave::open: duplicated to_master_cyg 0x3DC->0x164 from pty_owner
73 26864 [main] test 21024 fhandler_console::need_invisible: invisible_console 0
48 26912 [main] test 21024 fhandler_base::open_with_arch: line 458: /dev/pty4 usecount + 1 = 1
43 26955 [main] test 21024 fhandler_base::set_flags: flags 0x10002, supplied_bin 0x0
43 26998 [main] test 21024 fhandler_base::set_flags: O_TEXT/O_BINARY set in flags 0x10000
59 27057 [main] test 21024 fhandler_base::set_flags: filemode set to binary
60 27117 [main] test 21024 _pinfo::set_ctty: old no ctty, ctty device number 0xFFFFFFFF, tc.ntty device number 0x880004 flags & O_NOCTTY 0x0
45 27162 [main] test 21024 _pinfo::set_ctty: cygheap->ctty 0x0, archetype 0x1803077A0
41 27203 [main] test 21024 _pinfo::set_ctty: ctty was NULL
41 27244 [main] test 21024 _pinfo::set_ctty: line 497: /dev/pty4 usecount + 1 = 2
43 27287 [main] test 21024 _pinfo::set_ctty: /dev/pty4 ctty, usecount 2
59 27346 [main] test 21024 _pinfo::set_ctty: attaching ctty /dev/pty4 sid 21024, pid 21024, pgid 21024, tty->pgid 20196, tty->sid 19636
55 27401 [main] test 21024 _pinfo::set_ctty: cygheap->ctty now 0x1803077A0, archetype 0x1803077A0
45 27446 [main] test 21024 fhandler_pty_slave::open_setup: /dev/pty4 opened, usecount 2
44 27490 [main] test 21024 fhandler_base::set_flags: flags 0x10002, supplied_bin 0x0
40 27530 [main] test 21024 fhandler_base::set_flags: O_TEXT/O_BINARY set in flags 0x10000
40 27570 [main] test 21024 fhandler_base::set_flags: filemode set to binary
41 27611 [main] test 21024 _pinfo::set_ctty: old ctty /dev/pty4, ctty device number 0x880004, tc.ntty device number 0x880004 flags & O_NOCTTY 0x0
43 27654 [main] test 21024 _pinfo::set_ctty: attaching ctty /dev/pty4 sid 19636, pid 21024, pgid 20196, tty->pgid 20196, tty->sid 19636
43 27697 [main] test 21024 _pinfo::set_ctty: cygheap->ctty now 0x1803077A0, archetype 0x1803077A0
41 27738 [main] test 21024 fhandler_pty_slave::open_setup: /dev/pty4 opened, usecount 2
99 27837 [main] test 21024 build_fh_pc: found an archetype for (null)(136/4) io_handle 0x158
42 27879 [main] test 21024 build_fh_pc: fh 0x180307B80, dev 00880004
44 27923 [main] test 21024 fhandler_base::open_with_arch: line 478: /dev/pty4 usecount + 1 = 3
42 27965 [main] test 21024 fhandler_base::set_flags: flags 0x10002, supplied_bin 0x0
39 28004 [main] test 21024 fhandler_base::set_flags: O_TEXT/O_BINARY set in flags 0x10000
40 28044 [main] test 21024 fhandler_base::set_flags: filemode set to binary
40 28084 [main] test 21024 _pinfo::set_ctty: old ctty /dev/pty4, ctty device number 0x880004, tc.ntty device number 0x880004 flags & O_NOCTTY 0x0
43 28127 [main] test 21024 _pinfo::set_ctty: attaching ctty /dev/pty4 sid 19636, pid 21024, pgid 20196, tty->pgid 20196, tty->sid 19636
43 28170 [main] test 21024 _pinfo::set_ctty: cygheap->ctty now 0x1803077A0, archetype 0x1803077A0
41 28211 [main] test 21024 fhandler_pty_slave::open_setup: /dev/pty4 opened, usecount 3
41 28252 [main] test 21024 fhandler_base::set_flags: flags 0x10002, supplied_bin 0x0
41 28293 [main] test 21024 fhandler_base::set_flags: O_TEXT/O_BINARY set in flags 0x10000
40 28333 [main] test 21024 fhandler_base::set_flags: filemode set to binary
41 28374 [main] test 21024 _pinfo::set_ctty: old ctty /dev/pty4, ctty device number 0x880004, tc.ntty device number 0x880004 flags & O_NOCTTY 0x0
42 28416 [main] test 21024 _pinfo::set_ctty: attaching ctty /dev/pty4 sid 19636, pid 21024, pgid 20196, tty->pgid 20196, tty->sid 19636
40 28456 [main] test 21024 _pinfo::set_ctty: cygheap->ctty now 0x1803077A0, archetype 0x1803077A0
41 28497 [main] test 21024 fhandler_pty_slave::open_setup: /dev/pty4 opened, usecount 3
96 28593 [main] test 21024 build_fh_pc: found an archetype for (null)(136/4) io_handle 0x158
42 28635 [main] test 21024 build_fh_pc: fh 0x180307EF0, dev 00880004
44 28679 [main] test 21024 fhandler_base::open_with_arch: line 478: /dev/pty4 usecount + 1 = 4
42 28721 [main] test 21024 fhandler_base::set_flags: flags 0x10002, supplied_bin 0x0
38 28759 [main] test 21024 fhandler_base::set_flags: O_TEXT/O_BINARY set in flags 0x10000
40 28799 [main] test 21024 fhandler_base::set_flags: filemode set to binary
40 28839 [main] test 21024 _pinfo::set_ctty: old ctty /dev/pty4, ctty device number 0x880004, tc.ntty device number 0x880004 flags & O_NOCTTY 0x0
42 28881 [main] test 21024 _pinfo::set_ctty: attaching ctty /dev/pty4 sid 19636, pid 21024, pgid 20196, tty->pgid 20196, tty->sid 19636
41 28922 [main] test 21024 _pinfo::set_ctty: cygheap->ctty now 0x1803077A0, archetype 0x1803077A0
41 28963 [main] test 21024 fhandler_pty_slave::open_setup: /dev/pty4 opened, usecount 4
42 29005 [main] test 21024 fhandler_base::set_flags: flags 0x10002, supplied_bin 0x0
40 29045 [main] test 21024 fhandler_base::set_flags: O_TEXT/O_BINARY set in flags 0x10000
40 29085 [main] test 21024 fhandler_base::set_flags: filemode set to binary
40 29125 [main] test 21024 _pinfo::set_ctty: old ctty /dev/pty4, ctty device number 0x880004, tc.ntty device number 0x880004 flags & O_NOCTTY 0x0
44 29169 [main] test 21024 _pinfo::set_ctty: attaching ctty /dev/pty4 sid 19636, pid 21024, pgid 20196, tty->pgid 20196, tty->sid 19636
43 29212 [main] test 21024 _pinfo::set_ctty: cygheap->ctty now 0x1803077A0, archetype 0x1803077A0
43 29255 [main] test 21024 fhandler_pty_slave::open_setup: /dev/pty4 opened, usecount 4
498 29753 [main] test 21024 __set_errno: void dll_crt0_1(void*):992 setting errno 0
552 30305 [main] test 21024 __get_lcid_from_locale: LCID=0x0809
106 30411 [main] test 21024 __get_lcid_from_locale: LCID=0x0809
141 30552 [main] test 21024 __get_lcid_from_locale: LCID=0x0809
157 30709 [main] test 21024 __get_lcid_from_locale: LCID=0x0809
145 30854 [main] test 21024 __get_lcid_from_locale: LCID=0x0809
157 31011 [main] test 21024 __get_lcid_from_locale: LCID=0x0809
953 31964 [main] test 21024 close: close(1)
42 32006 [main] test 21024 fhandler_base::close_with_arch: line 1129: /dev/pty4 usecount + -1 = 3
41 32047 [main] test 21024 fhandler_base::close_with_arch: not closing archetype
41 32088 [main] test 21024 close: 0 = close(1)
466 32554 [main] test 21024 close: close(2)
43 32597 [main] test 21024 fhandler_base::close_with_arch: line 1129: /dev/pty4 usecount + -1 = 2
41 32638 [main] test 21024 fhandler_base::close_with_arch: not closing archetype
40 32678 [main] test 21024 close: 0 = close(2)
324 33002 [main] test 21024 do_exit: do_exit (256), exit_state 1
40 33042 [main] test 21024 void: 0x0 = signal (20, 0x1)
41 33083 [main] test 21024 void: 0x0 = signal (1, 0x1)
41 33124 [main] test 21024 void: 0x0 = signal (2, 0x1)
40 33164 [main] test 21024 void: 0x0 = signal (3, 0x1)
42 33206 [main] test 21024 fhandler_base::close_with_arch: line 1129: /dev/pty4 usecount + -1 = 1
41 33247 [main] test 21024 fhandler_base::close_with_arch: not closing archetype
40 33287 [main] test 21024 init_cygheap::close_ctty: closing cygheap->ctty 0x1803077A0
40 33327 [main] test 21024 fhandler_base::close_with_arch: closing passed in archetype 0x0, usecount 0
42 33369 [main] test 21024 fhandler_pty_slave::cleanup: /dev/pty4 closed, usecount 0
40 33409 [main] test 21024 fhandler_pty_slave::close: closing last open /dev/pty4 handle
56 33465 [main] test 21024 fhandler_console::free_console: freed console, res 1
43 33508 [main] test 21024 fhandler_pty_common::close: pty4 closing
43 33551 [main] test 21024 dtable::delete_archetype: deleting element 0 for /dev/pty4(136/4)
46 33597 [main] test 21024 getpid: 21024 = getpid()
42 33639 [main] test 21024 proc_terminate: nprocs 0
40 33679 [main] test 21024 proc_terminate: leaving
51 33730 [main] test 21024 pinfo::exit: Calling ExitProcess n 0x100, exitcode 0x1
--- Process 21024 thread 15896 exited with status 0x1
--- Process 21024 thread 5380 exited with status 0x1
--- Process 21024 thread 21328 exited with status 0x1
--- Process 21024 thread 21296 exited with status 0x1
--- Process 21024 exited with status 0x1
Related
I'm new to using windbg. I'm trying to determine root cause of why an application throws abnormal program termination. It's a updater app that downloads password protected zip files and unpacks them to make an update.
Typically, these errors are caused a network device blocking the download. But I want to know for sure if its the download or the unzip causing this. I created a dump file using Windows Task Manager when the error was shown on the screen.
I've gotten as far as the output below in windbg. I'm not sure where to go from here. I think the error happened on thread 2 because it has Unhandled Exception Filter. I tried dumping out the dwords for the return addresses but I'm not sure what that output means; just a bunch of bytes to me.
Any advice on how to continue investigating this would be appreciated.
Symbol search path is: srv*https://msdl.microsoft.com/download/symbols
Executable search path is:
Windows 8.1 Version 9600 MP (4 procs) Free x64
Product: Server, suite: TerminalServer DataCenter
Edition build lab: 6.3.9600.18217 (winblue_ltsb.160124-0053)
Machine Name:
Debug session time: Wed Jan 19 13:52:46.000 2022 (UTC - 8:00)
System Uptime: 5 days 1:09:46.245
Process Uptime: 0 days 0:01:10.000
................................................................
......
For analysis of this file, run !analyze -v
wow64win!NtUserGetMessage+0xa:
00000000`77775a2a c3 ret
0:000:x86> !pcr
Unable to read processor block array
Cannot get PCR address
0:000:x86> ~*k
. 0 Id: 3c2c.3e28 Suspend: 0 Teb: 7ffdb000 Unfrozen
# ChildEBP RetAddr
00 0018f970 77225dac user32!NtUserGetMessage+0xc
01 0018f998 0046e8b6 user32!GetMessageA+0x4c
WARNING: Stack unwind information not available. Following frames may be wrong.
02 004a4ed0 00000000 UPDATER+0x6e8b6
1 Id: 3c2c.4bc4 Suspend: 0 Teb: 7ffd8000 Unfrozen
# ChildEBP RetAddr
00 0280ff3c 742dc150 ntdll_777d0000!NtRemoveIoCompletion+0xc
01 0280ff80 77037c04 mswsock!SockAsyncThread+0x7d
02 0280ff94 7782ad8f kernel32!BaseThreadInitThunk+0x24
03 0280ffdc 7782ad5a ntdll_777d0000!__RtlUserThreadStart+0x2f
04 0280ffec 00000000 ntdll_777d0000!_RtlUserThreadStart+0x1b
2 Id: 3c2c.3dd0 Suspend: 0 Teb: 7ffd5000 Unfrozen
# ChildEBP RetAddr
00 03c9ea90 77224371 user32!NtUserWaitMessage+0xc
01 03c9ead8 77214fcd user32!DialogBox2+0x13f
02 03c9eb08 7721f907 user32!InternalDialogBox+0x107
03 03c9ebd4 7721f06d user32!SoftModalMessageBox+0xe2c
04 03c9ed38 7726786b user32!MessageBoxWorker+0x293
05 03c9edb8 772677cb user32!MessageBoxTimeoutW+0x6b
06 03c9edec 7726760b user32!MessageBoxTimeoutA+0x7b
07 03c9ee0c 772675d8 user32!MessageBoxExA+0x1b
08 03c9ee28 00464854 user32!MessageBoxA+0x18
WARNING: Stack unwind information not available. Following frames may be wrong.
09 03c9f028 0046347c UPDATER+0x64854
0a 03c9f060 767ef445 UPDATER+0x6347c
0b 03c9f0e8 00462b1c KERNELBASE!UnhandledExceptionFilter+0x165
0c 03c9f100 0045a33d UPDATER+0x62b1c
0d 03c9ff80 77037c04 UPDATER+0x5a33d
0e 03c9ff94 7782ad8f kernel32!BaseThreadInitThunk+0x24
0f 03c9ffdc 7782ad5a ntdll_777d0000!__RtlUserThreadStart+0x2f
10 03c9ffec 00000000 ntdll_777d0000!_RtlUserThreadStart+0x1b
0:000:x86> dc 00462b1c
00462b1c c3c95b5e 0824548b 3ab40d8b 8b56004a ^[...T$....:J.V.
00462b2c 39082474 c28b5732 3c8d1174 ba3c8d49 t$.92W..t.."u.F.. dc 0045a33d
0045a33d 8bc35959 75ffe865 e5bee8e0 d0a1ffff YY..e..u........
0045a34d 85004a0b ff0274c0 f7e856d0 8b000013 .J...t...V......
0045a35d 75f685f0 e8106a08 fffff1ae 4ae85659 ...u.j......YV.J
0045a36d 59000014 082474ff 113c15ff c35e0048 ...Y.t$... ~2 s
user32!NtUserWaitMessage+0xc:
7720bfbc c3 ret
0:002:x86> !teb
Wow64 TEB32 at 7ffd7000
ExceptionList: 03c9f04c
StackBase: 03ca0000
StackLimit: 03c9c000
SubSystemTib: 00000000
FiberData: 00001e00
ArbitraryUserPointer: 00000000
Self: 7ffd7000
EnvironmentPointer: 00000000
ClientId: 00003c2c . 00003dd0
RpcHandle: 00000000
Tls Storage: 00332810
PEB Address: 7ffde000
LastErrorValue: 0
LastStatusValue: c0000034
Count Owned Locks: 0
HardErrorMode: 0
Wow64 TEB at 7ffd5000
ExceptionList: 7ffd7000
StackBase: 023ffd30
StackLimit: 023f8000
SubSystemTib: 00000000
FiberData: 00001e00
ArbitraryUserPointer: 00000000
Self: 7ffd5000
EnvironmentPointer: 00000000
ClientId: 00003c2c . 00003dd0
RpcHandle: 00000000
Tls Storage: 00000000
PEB Address: 7ffdf000
LastErrorValue: 0
LastStatusValue: 0
Count Owned Locks: 0
HardErrorMode: 0
0:002:x86> dc 03c9f04c
03c9f04c 03c9f0d8 0045ba3c 00489530 ffffffff .... dc 7ffd7000
7ffd7000 03c9f04c 03ca0000 03c9c000 00000000 L...............
7ffd7010 00001e00 00000000 7ffd7000 00000000 .........p......
7ffd7020 00003c2c 00003dd0 00000000 00332810 ,
I'm trying to set up a crashdump system to better be able to debug errors that I can't replicate easily on my own system
Here's my test program (Compiled with Release x64 Configuration with Visual Studio 2017):
#include "pch.h"
#include <iostream>
#include <Windows.h>
#include <DbgHelp.h>
#pragma comment(lib,"Dbghelp.lib")
BOOL MiniDumpWriteDump(
HANDLE hProcess,
DWORD ProcessId,
HANDLE hFile,
MINIDUMP_TYPE DumpType,
PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam,
PMINIDUMP_USER_STREAM_INFORMATION UserStreamParam,
PMINIDUMP_CALLBACK_INFORMATION CallbackParam
);
LONG CreateMiniDump( struct _EXCEPTION_POINTERS *pExceptionInfo )//EXCEPTION_POINTERS* pep )
{
// Open the file
HANDLE hFile = CreateFile( "MiniDump.dmp", GENERIC_READ | GENERIC_WRITE,
0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL );
if( ( hFile != NULL ) && ( hFile != INVALID_HANDLE_VALUE ) )
{
// Create the minidump
MINIDUMP_EXCEPTION_INFORMATION mdei;
mdei.ThreadId = GetCurrentThreadId();
mdei.ExceptionPointers = pExceptionInfo;
mdei.ClientPointers = FALSE;
MINIDUMP_TYPE mdt = MiniDumpNormal;
BOOL rv = MiniDumpWriteDump( GetCurrentProcess(), GetCurrentProcessId(),
hFile, mdt, (pExceptionInfo != 0) ? &mdei : 0, 0, 0 );
if( !rv )
std::cout<<"MiniDumpWriteDump failed. Error: "<<GetLastError()<<std::endl;
else
std::cout<<"Minidump created."<<std::endl;
// Close the file
CloseHandle( hFile );
}
else
{
std::cout<<"CreateFile failed. Error: "<<GetLastError()<<std::endl;
}
return EXCEPTION_EXECUTE_HANDLER;
}
static void ftest3()
{
throw std::runtime_error("Error");
}
static void ftest2()
{
ftest3();
}
static void ftest1()
{
ftest2();
}
int main()
{
SetUnhandledExceptionFilter(&CreateMiniDump);
ftest1();
}
(Source: http://www.debuginfo.com/articles/effminidumps2.html)
If I run it on my primary system (on which I compiled the program), and then load the .dmp-file in Visual Studio or WinDbg, the full stack trace is displayed correctly and I can see where the error has occurred:
*** Stack trace for last set context - .thread/.cxr resets it
# Child-SP RetAddr Call Site
00 000000fd`3bbbf6f0 00007ff8`a72142cd KERNELBASE!RaiseException+0x68
01 000000fd`3bbbf7d0 00007ff7`7b4f130f VCRUNTIME140!_CxxThrowException+0xad [f:\dd\vctools\crt\vcruntime\src\eh\throw.cpp # 133]
02 000000fd`3bbbf840 00007ff7`7b4f1319 test_minidump!ftest3+0x1f [c:\users\florian\documents\projects\test_minidump\test_minidump\test_minidump.cpp # 63]
03 000000fd`3bbbf890 00007ff7`7b4f1329 test_minidump!ftest2+0x9 [c:\users\florian\documents\projects\test_minidump\test_minidump\test_minidump.cpp # 68]
04 000000fd`3bbbf8c0 00007ff7`7b4f1346 test_minidump!ftest1+0x9 [c:\users\florian\documents\projects\test_minidump\test_minidump\test_minidump.cpp # 73]
05 000000fd`3bbbf8f0 00007ff7`7b4f1838 test_minidump!main+0x16 [c:\users\florian\documents\projects\test_minidump\test_minidump\test_minidump.cpp # 79]
06 (Inline Function) --------`-------- test_minidump!invoke_main+0x22 [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl # 78]
07 000000fd`3bbbf920 00007ff8`b45d3034 test_minidump!__scrt_common_main_seh+0x10c [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl # 288]
08 000000fd`3bbbf960 00007ff8`b71a1461 kernel32!BaseThreadInitThunk+0x14
09 000000fd`3bbbf990 00000000`00000000 ntdll!RtlUserThreadStart+0x21
However, if I run the program on a different system, and then try to analyze the dump on my own system, all I get is this:
*** Stack trace for last set context - .thread/.cxr resets it
# Child-SP RetAddr Call Site
00 00000021`ccbef870 00007ffe`8cfd4722 KERNELBASE!RaiseException+0x68
01 00000021`ccbef950 00000021`ccbef9f0 VCRUNTIME140!_CxxThrowException+0xc2 [f:\dd\vctools\crt\vcruntime\src\eh\throw.cpp # 136]
02 00000021`ccbef958 00007ffe`00000000 0x00000021`ccbef9f0
03 00000021`ccbef960 000001ee`2e25ff30 0x00007ffe`00000000
04 00000021`ccbef968 00000000`00000000 0x000001ee`2e25ff30
Which isn't exactly helpful. I've loaded the dump-file in WinDbg and then used the following commands:
.symfix
.sympath+ C:\Users\Florian\Documents\Projects\test_minidump\x64\Release
.srcpath C:\Users\Florian\Documents\Projects\test_minidump\test_minidump
!analyze -v
.ecxr
k
Here's the full output from WinDbg:
Microsoft (R) Windows Debugger Version 10.0.17134.12 AMD64
Copyright (c) Microsoft Corporation. All rights reserved.
Loading Dump File [C:\Users\Florian\Desktop\tmp\MiniDump.dmp]
User Mini Dump File: Only registers, stack and portions of memory are available
Symbol search path is: srv*
Executable search path is:
Windows 10 Version 17134 MP (4 procs) Free x64
Product: WinNt, suite: SingleUserTS
17134.1.amd64fre.rs4_release.180410-1804
Machine Name:
Debug session time: Sun Sep 23 11:56:45.000 2018 (UTC + 2:00)
System Uptime: not available
Process Uptime: not available
..............
This dump file has an exception of interest stored in it.
The stored exception information can be accessed via .ecxr.
(169c.1b78): C++ EH exception - code e06d7363 (first/second chance not available)
ntdll!NtGetContextThread+0x14:
00007ffe`9abfbc44 c3 ret
0:000> .symfix
0:000> .sympath+ C:\Users\Florian\Documents\Projects\test_minidump\x64\Release
Symbol search path is: srv*;C:\Users\Florian\Documents\Projects\test_minidump\x64\Release
Expanded Symbol search path is: cache*;SRV*https://msdl.microsoft.com/download/symbols;c:\users\florian\documents\projects\test_minidump\x64\release
************* Path validation summary **************
Response Time (ms) Location
Deferred srv*
OK C:\Users\Florian\Documents\Projects\test_minidump\x64\Release
0:000> .srcpath C:\Users\Florian\Documents\Projects\test_minidump\test_minidump
Source search path is: C:\Users\Florian\Documents\Projects\test_minidump\test_minidump
************* Path validation summary **************
Response Time (ms) Location
OK C:\Users\Florian\Documents\Projects\test_minidump\test_minidump
0:000> !analyze -v
*******************************************************************************
* *
* Exception Analysis *
* *
*******************************************************************************
KEY_VALUES_STRING: 1
TIMELINE_ANALYSIS: 1
Timeline: !analyze.Start
Name: <blank>
Time: 2018-09-24T10:08:32.944Z
Diff: 87107944 mSec
Timeline: Dump.Current
Name: <blank>
Time: 2018-09-23T09:56:45.0Z
Diff: 0 mSec
DUMP_CLASS: 2
DUMP_QUALIFIER: 400
CONTEXT: (.ecxr)
rax=0000000000000000 rbx=00007ffe973da570 rcx=0000000000000000
rdx=0000000000000030 rsi=00007ff798203cd0 rdi=000001ee2e25c750
rip=00007ffe97bba388 rsp=00000021ccbef870 rbp=00000021ccbef9b0
r8=0000000000000000 r9=0000000000000000 r10=000001ee2e0f0000
r11=0000000000000000 r12=0000000000000000 r13=0000000000000000
r14=00000021ccbef9f0 r15=0000000000000000
iopl=0 nv up ei pl nz na po nc
cs=0033 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00000206
KERNELBASE!RaiseException+0x68:
00007ffe`97bba388 488b8c24c0000000 mov rcx,qword ptr [rsp+0C0h] ss:00000021`ccbef930=000052660787015b
Resetting default scope
FAULTING_IP:
KERNELBASE!RaiseException+68
00007ffe`97bba388 488b8c24c0000000 mov rcx,qword ptr [rsp+0C0h]
EXCEPTION_RECORD: (.exr -1)
ExceptionAddress: 00007ffe97bba388 (KERNELBASE!RaiseException+0x0000000000000068)
ExceptionCode: e06d7363 (C++ EH exception)
ExceptionFlags: 00000001
NumberParameters: 4
Parameter[0]: 0000000019930520
Parameter[1]: 00000021ccbef9f0
Parameter[2]: 00007ff798203cd0
Parameter[3]: 00007ff798200000
BUGCHECK_STR: CPP_EXCEPTION
DEFAULT_BUCKET_ID: CPP_EXCEPTION
PROCESS_NAME: test_minidump.exe
ERROR_CODE: (NTSTATUS) 0xe06d7363 - <Unable to get error code text>
EXCEPTION_CODE: (NTSTATUS) 0xe06d7363 - <Unable to get error code text>
EXCEPTION_CODE_STR: e06d7363
EXCEPTION_PARAMETER1: 0000000019930520
EXCEPTION_PARAMETER2: 00000021ccbef9f0
EXCEPTION_PARAMETER3: 00007ff798203cd0
EXCEPTION_PARAMETER4: 7ff798200000
WATSON_BKT_PROCSTAMP: 5ba8b478
WATSON_BKT_MODULE: KERNELBASE.dll
WATSON_BKT_MODSTAMP: b0bb231d
WATSON_BKT_MODOFFSET: 3a388
WATSON_BKT_MODVER: 6.2.17134.165
MODULE_VER_PRODUCT: Microsoft® Windows® Operating System
BUILD_VERSION_STRING: 17134.1.amd64fre.rs4_release.180410-1804
MODLIST_WITH_TSCHKSUM_HASH: 636d437315fdc5447e163e64094b1f6a26123a83
MODLIST_SHA1_HASH: 74dec0c40d229cd1e109927f1f5e794fa53165ac
DUMP_FLAGS: 0
DUMP_TYPE: 2
ANALYSIS_SESSION_HOST: DESKTOP-VFOALG8
ANALYSIS_SESSION_TIME: 09-24-2018 12:08:32.0944
ANALYSIS_VERSION: 10.0.17134.12 amd64fre
THREAD_ATTRIBUTES:
PROBLEM_CLASSES:
ID: [0n317]
Type: [#APPLICATION_FAULT_STRING]
Class: Primary
Scope: DEFAULT_BUCKET_ID (Failure Bucket ID prefix)
BUCKET_ID
Name: Omit
Data: Add
String: [CPP_EXCEPTION]
PID: [Unspecified]
TID: [Unspecified]
Frame: [0]
PRIMARY_PROBLEM_CLASS: CPP_EXCEPTION
LAST_CONTROL_TRANSFER: from 00007ffe8cfd4722 to 00007ffe97bba388
STACK_TEXT:
00000021`ccbef870 00007ffe`8cfd4722 : 00000021`ccbef9f0 00007ffe`00000000 000001ee`2e25ff30 00000000`00000000 : KERNELBASE!RaiseException+0x68
00000021`ccbef950 00000021`ccbef9f0 : 00007ffe`00000000 000001ee`2e25ff30 00000000`00000000 00000001`e06d7363 : VCRUNTIME140!_CxxThrowException+0xc2
00000021`ccbef958 00007ffe`00000000 : 000001ee`2e25ff30 00000000`00000000 00000001`e06d7363 00000000`00000000 : 0x00000021`ccbef9f0
00000021`ccbef960 000001ee`2e25ff30 : 00000000`00000000 00000001`e06d7363 00000000`00000000 00000000`00000000 : 0x00007ffe`00000000
00000021`ccbef968 00000000`00000000 : 00000001`e06d7363 00000000`00000000 00000000`00000000 00000000`00000004 : 0x000001ee`2e25ff30
THREAD_SHA1_HASH_MOD_FUNC: 74c55fd19222dcb5ad415427110811b213f4c078
THREAD_SHA1_HASH_MOD_FUNC_OFFSET: 7592380e0f749a34b2d654a7c3b829a033ee79fa
THREAD_SHA1_HASH_MOD: ad69e1f2190edbb9a7df71b4b6403437528645f2
FOLLOWUP_IP:
KERNELBASE!RaiseException+68
00007ffe`97bba388 488b8c24c0000000 mov rcx,qword ptr [rsp+0C0h]
FAULT_INSTR_CODE: 248c8b48
SYMBOL_STACK_INDEX: 0
SYMBOL_NAME: KERNELBASE!RaiseException+68
FOLLOWUP_NAME: MachineOwner
MODULE_NAME: KERNELBASE
IMAGE_NAME: KERNELBASE.dll
DEBUG_FLR_IMAGE_TIMESTAMP: 0
STACK_COMMAND: ~0s ; .ecxr ; kb
BUCKET_ID: CPP_EXCEPTION_KERNELBASE!RaiseException+68
FAILURE_EXCEPTION_CODE: e06d7363
FAILURE_IMAGE_NAME: KERNELBASE.dll
BUCKET_ID_IMAGE_STR: KERNELBASE.dll
FAILURE_MODULE_NAME: KERNELBASE
BUCKET_ID_MODULE_STR: KERNELBASE
FAILURE_FUNCTION_NAME: RaiseException
BUCKET_ID_FUNCTION_STR: RaiseException
BUCKET_ID_OFFSET: 68
BUCKET_ID_MODTIMEDATESTAMP: 0
BUCKET_ID_MODCHECKSUM: 27e598
BUCKET_ID_MODVER_STR: 6.2.17134.165
BUCKET_ID_PREFIX_STR: CPP_EXCEPTION_
FAILURE_PROBLEM_CLASS: CPP_EXCEPTION
FAILURE_SYMBOL_NAME: KERNELBASE.dll!RaiseException
FAILURE_BUCKET_ID: CPP_EXCEPTION_e06d7363_KERNELBASE.dll!RaiseException
TARGET_TIME: 2018-09-23T09:56:45.000Z
OSBUILD: 17134
OSSERVICEPACK: 1
SERVICEPACK_NUMBER: 0
OS_REVISION: 0
SUITE_MASK: 256
PRODUCT_TYPE: 1
OSPLATFORM_TYPE: x64
OSNAME: Windows 10
OSEDITION: Windows 10 WinNt SingleUserTS
OS_LOCALE:
USER_LCID: 0
OSBUILD_TIMESTAMP: 2020-08-28 06:38:41
BUILDDATESTAMP_STR: 180410-1804
BUILDLAB_STR: rs4_release
BUILDOSVER_STR: 10.0.17134.1.amd64fre.rs4_release.180410-1804
ANALYSIS_SESSION_ELAPSED_TIME: a63
ANALYSIS_SOURCE: UM
FAILURE_ID_HASH_STRING: um:cpp_exception_e06d7363_kernelbase.dll!raiseexception
FAILURE_ID_HASH: {1253aecc-520d-655b-58e3-5eb61e209188}
Followup: MachineOwner
---------
0:000> .ecxr
rax=0000000000000000 rbx=00007ffe973da570 rcx=0000000000000000
rdx=0000000000000030 rsi=00007ff798203cd0 rdi=000001ee2e25c750
rip=00007ffe97bba388 rsp=00000021ccbef870 rbp=00000021ccbef9b0
r8=0000000000000000 r9=0000000000000000 r10=000001ee2e0f0000
r11=0000000000000000 r12=0000000000000000 r13=0000000000000000
r14=00000021ccbef9f0 r15=0000000000000000
iopl=0 nv up ei pl nz na po nc
cs=0033 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00000206
KERNELBASE!RaiseException+0x68:
00007ffe`97bba388 488b8c24c0000000 mov rcx,qword ptr [rsp+0C0h] ss:00000021`ccbef930=000052660787015b
0:000> k
*** Stack trace for last set context - .thread/.cxr resets it
# Child-SP RetAddr Call Site
00 00000021`ccbef870 00007ffe`8cfd4722 KERNELBASE!RaiseException+0x68
01 00000021`ccbef950 00000021`ccbef9f0 VCRUNTIME140!_CxxThrowException+0xc2 [f:\dd\vctools\crt\vcruntime\src\eh\throw.cpp # 136]
02 00000021`ccbef958 00007ffe`00000000 0x00000021`ccbef9f0
03 00000021`ccbef960 000001ee`2e25ff30 0x00007ffe`00000000
04 00000021`ccbef968 00000000`00000000 0x000001ee`2e25ff30
There are no warnings or errors from what I can tell, so why am I not getting the full stack trace information?
VCRUNTIME140!_CxxThrowException+0xad [f:\dd\vctools\crt\vcruntime\src\eh\throw.cpp # 133]
versus
VCRUNTIME140!_CxxThrowException+0xc2 [f:\dd\vctools\crt\vcruntime\src\eh\throw.cpp # 136]
is a bit worrying. It suggests that the minor version of the MSVC runtime doesn't match between the two machines (because otherwise, why would they invoke RaiseException from different source lines). If your WinDbg session doesn't have symbols for the remote machine's VCRUNTIME140 -- or, worse yet, if it's using the wrong PDB for it -- backtracing is going to become problematic at that point. WinDbg should automatically download and load symbols for whichever version is referenced from the minidump, but I suspect this isn't happening properly.
Use lm v to show the module listing for the minidump, and pay close attention to the checksum information. I suspect you'll see a different checksum for vcruntime140.dll between the two machines. If you do, you'll need to figure out why you're not getting the right symbols for the dll.
Thanks to the tips by users Sneftel and Sean Cline, I found the solution. Running the command !itoldyouso vcruntime140 gives me the following output:
sig MISMATCH: vcruntime140.amd64.pdb and VCRUNTIME140.dll
The problem was that my system which I use for debugging runs on an AMD CPU, while the system that generated the crashdump runs on an intel CPU. For some reason the vcruntime140.dll is system-specific and differs between the two. (Also, on AMD systems the pdb is called "vcruntime140.amd64.pdb", on intel it's "vcruntime140.i386.pdb".)
I've copied the vcruntime140.dll, vcruntime140.i386.pdb and msvcp140.dll from my intel system and added them to the symbol path for WinDbg. Then I ran the same commands as before, and now it outputs the full stacktrace.
*** Stack trace for last set context - .thread/.cxr resets it
# Child-SP RetAddr Call Site
00 00000021`ccbef870 00007ffe`8cfd4722 KERNELBASE!RaiseException+0x68
01 00000021`ccbef950 00007ff7`9820130f VCRUNTIME140!_CxxThrowException+0xc2 [f:\dd\vctools\crt\vcruntime\src\eh\throw.cpp # 136]
02 00000021`ccbef9d0 00007ff7`98201319 test_minidump!ftest3+0x1f [c:\users\florian\documents\projects\test_minidump\test_minidump\test_minidump.cpp # 63]
03 00000021`ccbefa20 00007ff7`98201329 test_minidump!ftest2+0x9 [c:\users\florian\documents\projects\test_minidump\test_minidump\test_minidump.cpp # 68]
04 00000021`ccbefa50 00007ff7`98201346 test_minidump!ftest1+0x9 [c:\users\florian\documents\projects\test_minidump\test_minidump\test_minidump.cpp # 73]
05 00000021`ccbefa80 00007ff7`98201838 test_minidump!main+0x16 [c:\users\florian\documents\projects\test_minidump\test_minidump\test_minidump.cpp # 79]
06 (Inline Function) --------`-------- test_minidump!invoke_main+0x22 [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl # 78]
07 00000021`ccbefab0 00007ffe`98983034 test_minidump!__scrt_common_main_seh+0x10c [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl # 288]
08 00000021`ccbefaf0 00007ffe`9abd1461 kernel32!BaseThreadInitThunk+0x14
09 00000021`ccbefb20 00000000`00000000 ntdll!RtlUserThreadStart+0x21
TLDR;
I have been deploying with Capistrano for over a year and able to rollback and now all of a sudden I cannot rollback saying it cannot find the rake asset file
Problem
Capistrano Rollback is failing complaining that it cannot find the rake asset manifest which I validated is not there. What creates this and why would it just stop being created?
I have been pulling my hair out for days over this and am at a point to figure out how to hack out that portion of the rollback and manually recompiling the assets.
Rollback console output
rvm 1.27.0 (latest) by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.io/]
ruby-2.3.3
ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux]
00:00 deploy:shutdown_god
01 sudo service god stop
✔ 01 quotr#SpottingQuotes.ca 1.404s
00:01 deploy:fix_tmp_permissions
01 sudo chown -R quotr:app /home/quotr/app/releases
✔ 01 quotr#SpottingQuotes.ca 3.636s
removing existing local assets
00:05 git:wrapper
01 mkdir -p /tmp
✔ 01 quotr#SpottingQuotes.ca 0.214s
Uploading /tmp/git-ssh-Quotr-staging-brandon.sh 100.0%
02 chmod 700 /tmp/git-ssh-Quotr-staging-brandon.sh
✔ 02 quotr#SpottingQuotes.ca 0.184s
00:05 git:check
01 git ls-remote git#github.com:XXChester/quotr.git HEAD
01 2c552c143313ae30b3db06372d640ebe3987b1e9 HEAD
✔ 01 quotr#SpottingQuotes.ca 0.708s
00:06 deploy:check:directories
01 mkdir -p /home/quotr/app/shared /home/quotr/app/releases
✔ 01 quotr#SpottingQuotes.ca 0.146s
00:06 deploy:check:linked_dirs
01 mkdir -p /home/quotr/app/shared/log /home/quotr/app/shared/public/system /home/quotr/app/s…
✔ 01 quotr#SpottingQuotes.ca 0.194s
00:09 deploy:assets:prepare
01 rake assets:clean
01 version: e724e4e
01 Loaded /home/brandon/code/quotr/app/jobs/bid_top_up_job.rb
01 Loaded /home/brandon/code/quotr/app/jobs/base_job.rb
01 Loaded /home/brandon/code/quotr/app/jobs/notification_job.rb
01 Loaded /home/brandon/code/quotr/app/jobs/close_project_job.rb
✔ 01 brandon#localhost 3.671s
02 rake assets:precompile
02 I, [2018-05-22T12:30:07.515992 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.535002 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.536569 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.536935 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.538802 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.542173 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.545048 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.545798 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.546547 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.547340 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.548304 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.548384 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.549593 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.550404 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.551790 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.560021 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.561012 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.561902 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.589660 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.590197 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.591274 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.592175 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.592975 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.593805 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.594635 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.595481 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.596272 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.597071 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.597814 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.598977 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.599904 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.600863 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.601763 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.602734 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.603642 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.604583 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.605939 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.606984 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.607987 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.608859 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.609703 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.610610 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.611455 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.612825 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.614628 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.615325 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.615970 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.788390 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.788633 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.808114 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.808206 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.822875 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.822966 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.824946 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.825015 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.834034 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.834149 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 I, [2018-05-22T12:30:07.839802 #16956] INFO -- : Writing /home/brandon/code/quotr/public/…
02 version: e724e4e
02 Loaded /home/brandon/code/quotr/app/jobs/bid_top_up_job.rb
02 Loaded /home/brandon/code/quotr/app/jobs/base_job.rb
02 Loaded /home/brandon/code/quotr/app/jobs/notification_job.rb
02 Loaded /home/brandon/code/quotr/app/jobs/close_project_job.rb
✔ 02 brandon#localhost 4.845s
00:17 deploy:terminate_god
01 sudo service god terminate
01 Terminating god
01
01 Stopped all watches
01
01 Stopped god
01 Finished
✔ 01 quotr#SpottingQuotes.ca 0.286s
00:17 deploy:assets:cleanup
01 rm -rf
✔ 01 brandon#localhost 0.001s
00:18 deploy:assets:restore_manifest
WARN Rails assets manifest file (or backup file) not found.
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host SpottingQuotes.ca: Rails assets manifest file (or backup file) not found.
Caused by:
Capistrano::FileNotFound: Rails assets manifest file (or backup file) not found.
Tasks: TOP => deploy:assets:restore_manifest
(See full trace by running task with --trace)
Doctor Output
rvm 1.27.0 (latest) by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.io/]
ruby-2.3.3
ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux]
Environment
Ruby ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux]
Rubygems 2.5.2
Bundler N/A
Command /home/brandon/.rvm/gems/ruby-2.3.3/bin/cap staging doctor
Gems
capistrano 3.10.1 (update available)
airbrussh 1.3.0
rake 12.3.1
sshkit 1.16.0 (update available)
net-ssh 4.2.0
capistrano-bundler 1.3.0
capistrano-local-precompile 1.1.1
capistrano-npm 1.0.2
capistrano-rails 1.3.1
capistrano-rvm 0.1.2
Variables
:application "Quotr"
:assets_dir "/home/quotrapp/shared/public/assets"
:assets_prefix "assets"
:assets_role "web"
:assets_roles [:web, :app, :db]
:branch "DEV-484-capistrano-cannot-rollback"
:bundle_bins ["gem", "rake", "rails"]
:bundle_binstubs nil
:bundle_clean_options ""
:bundle_env_variables {}
:bundle_flags "--deployment --quiet"
:bundle_gemfile nil
:bundle_jobs nil
:bundle_path #<Pathname:/home/quotr/app/shared/bundle>
:bundle_roles :all
:bundle_servers [#
<Capistrano::Configuration::Server:0x00000002e6d528 #keys=[], #local=false, #user=nil, #hostname="SpottingQuotes.ca", #port=nil, #properties=#<Capistrano::Configuration::Server::Properties:0x00000002e6d258 #properties={:primary=>true}, #roles=#<Set: {:web, :db}>>>]
:bundle_without "development test"
:conditionally_migrate false
:default_env {}
:deploy_to "/home/quotr/app"
:deploy_via :copy
:format :airbrussh
:git_environmental_variables {:git_askpass=>"/bin/echo", :git_ssh=>"/tmp/git-ssh-Quotr-staging-brandon.sh"}
:git_shallow_clone false
:git_wrapper_path "/tmp/git-ssh-Quotr-staging-brandon.sh"
:keep_releases 5
:linked_dirs ["log", "public/system", "public/assets"]
:local_user "brandon"
:log_level :debug
:maintenance_template_path "public/503.html"
:migration_role :db
:migration_servers #<Capistrano::Configuration::Server:0x00000002e6d528 #keys=[], #local=false, #user=nil, #hostname="SpottingQuotes.ca", #port=nil, #properties=#<Capistrano::Configuration::Server::Properties:0x00000002e6d258 #properties={:primary=>true}, #roles=#<Set: {:web, :db}>>>
:npm_flags ["--production", "--silent", "--no-progress"]
:npm_prune_flags "--production"
:npm_roles :all
:packs_dir "public/packs"
:precompile_env "production"
:pty false
:rails_env :production
:repo_url "git#github.com:XXChester/quotr.git"
:rsync_cmd "rsync -av --delete"
:rvm_map_bins ["gem", "rake", "ruby", "bundle"]
:rvm_path "~/.rvm"
:rvm_ruby_version "2.3.3"
:rvm_type :auto
:ssh_options {:forward_agent=>true, :keys=>["/home/brandon/Documents/Google Drive/Quotr/hosting/test-server.pem"], :user=>"quotr", :keepalive=>true}
:stage :staging
:tmp_dir "/tmp"
:use_sudo false
:user "quotr"
:deploy_via is not a recognized Capistrano setting (/home/brandon/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/delegate.rb:83)
:maintenance_template_path is not a recognized Capistrano setting (/home/brandon/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/delegate.rb:83)
:use_sudo is not a recognized Capistrano setting (/home/brandon/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/delegate.rb:83)
:user is not a recognized Capistrano setting (/home/brandon/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/delegate.rb:83)
Servers (1)
SpottingQuotes.ca [:web, :db] { :primary => true }
I saw some recommendations of manually creating the file but this seems just blatantly wrong.
What I am looking for?
I am hoping someone can see a smoking gun or experienced them their self and remembers what it means, or someone can point me in the direction of the answer. I'd like to not hack the solution but if it comes to it (it's very close to be), someone to point me in the direction of how to bypass this step, I already know how to do a manual recompile.
Thanks
I managed to shut off the default behaviour via:
Rake::Task["deploy:assets:restore_manifest"].clear_actions
Then I added a manual recompile to the end of the rollback process via:
before 'deploy:finishing_rollback', 'deploy:pre_start_precompile'
My manual recompile which we were already doing for deployments looks like this;
task :pre_start_precompile do
on roles(:db) do
with rails_env: "#{fetch(:stage)}" do
path_to_bundler = "/home/quotr/.rvm/wrappers/ruby-2.3.3/bundle"
execute "cd #{release_path}; RAILS_ENV=production #{path_to_bundler} exec rake assets:precompile"
end
end
end
I hope this helps someone else; what a nightmare.
[enter image description here][1]I have created the following citrus test cases to test a basic connection between Rest client and server:
#Test
#CitrusTest
fun httpActionTest() {
variable("username", "user")
variable("password","password")
http().client("httpClient")
.send()
.post("/api/authenticate")
.messageType(MessageType.JSON)
.contentType("application/json")
.payload("{ \"username\": \"\${username}\", \"password\": \"\${password}\"}");
http().client("httpClient")
.receive()
.response(HttpStatus.OK)
.validate("$.token","asasasasas")
}
#CitrusTest
fun httpServerActionTest() {
http().server("httpServer")
.receive()
.post("/api/authenticate")
.payload("{ \"username\": \"\${username}\", \"password\": \"\${password}\"}")
.contentType("application/json")
.accept("application/json")
.extractFromPayload("username", "username")
.extractFromPayload("password", "password")
.validate("$.username", "user")
.validate("$.password","pass")
http().server("httpServer")
.send()
.response(HttpStatus.OK)
.payload("{\"token\": \"lsdkfjkh8sdfg98zsd\"}")
.version("HTTP/1.1")
.contentType("application/json")
}
I have defined the server and client endpoints in citrux-context.xml as follows:
<citrus-http:client id="httpClient"
request-url="http://localhost:8080"
request-method="GET"
content-type="application/json"
charset="UTF-8"
timeout="60000"/>
<citrus-http:server id="httpServer"
port="8080"
auto-start="true"
resource-base="src/test/resources"/>
While executing via IntelliJ, following logs are observed:
INFO: Loading XML bean definitions from URL [file:/home/jass/intersales/jk-magento/magento2-auth-service/target/test-classes/citrus-context.xml]
[main] INFO org.eclipse.jetty.util.log - Logging initialized #9851ms to org.eclipse.jetty.util.log.Slf4jLog
[main] INFO org.eclipse.jetty.server.Server - jetty-9.4.6.v20170531
[main] INFO org.eclipse.jetty.server.handler.ContextHandler.ROOT - Initializing Spring FrameworkServlet 'httpServer-servlet'
Oct 23, 2017 8:49:45 AM com.consol.citrus.http.servlet.CitrusDispatcherServlet initServletBean
INFO: FrameworkServlet 'httpServer-servlet': initialization started
Oct 23, 2017 8:49:45 AM org.springframework.web.context.support.XmlWebApplicationContext prepareRefresh
INFO: Refreshing WebApplicationContext for namespace 'httpServer-servlet-servlet': startup date [Mon Oct 23 08:49:45 CEST 2017]; root of context hierarchy
Oct 23, 2017 8:49:45 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [com/consol/citrus/http/citrus-servlet-context.xml]
Oct 23, 2017 8:49:46 AM org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping register
...
INFO: Looking for #ControllerAdvice: WebApplicationContext for namespace 'httpServer-servlet-servlet': startup date [Mon Oct 23 08:49:45 CEST 2017]; root of context hierarchy
Oct 23, 2017 8:49:47 AM com.consol.citrus.http.servlet.CitrusDispatcherServlet initServletBean
INFO: FrameworkServlet 'httpServer-servlet': initialization completed in 1570 ms
[main] INFO org.eclipse.jetty.server.handler.ContextHandler - Started o.e.j.s.ServletContextHandler#1bb1fde8{/,file:///home/jass/intersales/jk-magento/magento2-auth-service/src/test/resources/,AVAILABLE}
[main] INFO org.eclipse.jetty.server.AbstractConnector - Started ServerConnector#1286528d{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}
[main] INFO org.eclipse.jetty.server.Server - Started #12166ms
[main] INFO com.consol.citrus.http.server.HttpServer - Started server: httpServer
[main] INFO com.consol.citrus.Citrus -
[main] INFO com.consol.citrus.Citrus - ------------------------------------------------------------------------
[main] INFO com.consol.citrus.Citrus - .__ __
[main] INFO com.consol.citrus.Citrus - ____ |__|/ |________ __ __ ______
[main] INFO com.consol.citrus.Citrus - _/ ___\| \ __\_ __ \ | \/ ___/
[main] INFO com.consol.citrus.Citrus - \ \___| || | | | \/ | /\___ \
[main] INFO com.consol.citrus.Citrus - \___ >__||__| |__| |____//____ >
[main] INFO com.consol.citrus.Citrus - \/ \/
[main] INFO com.consol.citrus.Citrus -
[main] INFO com.consol.citrus.Citrus - C I T R U S T E S T S 2.7.2
[main] INFO com.consol.citrus.Citrus -
[main] INFO com.consol.citrus.Citrus - ------------------------------------------------------------------------
[main] INFO com.consol.citrus.Citrus -
[main] INFO com.consol.citrus.Citrus -
[main] INFO com.consol.citrus.Citrus - BEFORE TEST SUITE: SUCCESS
[main] INFO com.consol.citrus.Citrus - ------------------------------------------------------------------------
[main] INFO com.consol.citrus.Citrus -
[main] INFO com.consol.citrus.actions.EchoAction - Today is: 23.10.2017
[main] INFO com.consol.citrus.Citrus -
[main] INFO com.consol.citrus.Citrus - TEST SUCCESS VerticleCitrusTest.echoToday (de.intersales.qbus2)
[main] INFO com.consol.citrus.Citrus - ------------------------------------------------------------------------
[main] INFO com.consol.citrus.Citrus -
[qtp191568263-12] INFO com.consol.citrus.channel.ChannelSyncProducer - Message was sent to channel: 'httpServer.inbound'
[qtp191568263-12] WARN com.consol.citrus.channel.ChannelEndpointAdapter - Reply timed out after 1000ms. Did not receive reply message on reply channel
[main] INFO com.consol.citrus.http.client.HttpClient - HTTP message was sent to endpoint: 'http://localhost:8080/magento2/authenticate'
[main] INFO com.consol.citrus.validation.xml.DomXmlMessageValidator - XML message validation successful: All values OK
[main] INFO com.consol.citrus.validation.DefaultMessageHeaderValidator - Message header validation successful: All values OK
[main] INFO com.consol.citrus.Citrus -
[main] INFO com.consol.citrus.Citrus - TEST SUCCESS VerticleCitrusTest.httpActionTest (de.intersales.qbus2)
[main] INFO com.consol.citrus.Citrus - ------------------------------------------------------------------------
[main] INFO com.consol.citrus.Citrus -
[main] INFO com.consol.citrus.Citrus -
[main] INFO com.consol.citrus.Citrus - ------------------------------------------------------------------------
[main] INFO com.consol.citrus.Citrus -
[main] INFO com.consol.citrus.Citrus -
[main] INFO com.consol.citrus.Citrus - AFTER TEST SUITE: SUCCESS
[main] INFO com.consol.citrus.Citrus - ------------------------------------------------------------------------
[main] INFO com.consol.citrus.Citrus -
[main] INFO com.consol.citrus.Citrus - ------------------------------------------------------------------------
[main] INFO com.consol.citrus.Citrus -
[main] INFO com.consol.citrus.Citrus - CITRUS TEST RESULTS
[main] INFO com.consol.citrus.Citrus -
[main] INFO com.consol.citrus.Citrus - VerticleCitrusTest.echoToday ................................... SUCCESS
[main] INFO com.consol.citrus.Citrus - VerticleCitrusTest.httpActionTest .............................. SUCCESS
[main] INFO com.consol.citrus.Citrus -
[main] INFO com.consol.citrus.Citrus - TOTAL: 2
[main] INFO com.consol.citrus.Citrus - FAILED: 0 (0.0%)
[main] INFO com.consol.citrus.Citrus - SUCCESS: 2 (100.0%)
[main] INFO com.consol.citrus.Citrus -
[main] INFO com.consol.citrus.Citrus - ------------------------------------------------------------------------
[main] INFO com.consol.citrus.report.HtmlReporter - Generated HTML test report
But getting an error when executing via mvn clean verify with the following error:
[main] ERROR com.consol.citrus.Citrus - TEST FAILED VerticleCitrusTest.httpActionTest <de.intersales.qbus2> Nested exception is:
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'httpClient' available
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:687)
...
`
Any suggestions or help is greatly appreciated.
EDITED The following is my project structure
[Placement of resources] [1]: https://i.stack.imgur.com/aVabX.png
I see multiple issues in your code and setup. First of all the httpServerActionTest() is missing the #Test annotation. If not put on class level this annotation needs to be repeated on each method in your test class.
Secondly the complete test structure does not make much sense to me. In httpActionTest() test you send a client request to the server while in httpServerActionTest() you receive that very same request as a server and validate its contents with Citrus. Your test is both client and server at the same time. Feels wrong to me! In particular this test setup will never work as Http is a synchronous protocol by nature and httpActionTest() is not able to succeed without httpServerActionTest() performing. You will get timeout exceptions on client side then. This will only work in case both methods are executed in parallel to each other.
Regarding the Maven failure: citrux-context.xml is misspelled (citrux vs. citrus). Also it seems to me that the file is not properly added to the Maven project as a resource. Did you keep the default Maven directory layout?
Once again the complete test setup does not clarify its purpose to me.
I have implemented a connector to different kinds of webservice with JAX-WS in weblogic 10.3.6, the connector can be configured with 2waySSL, proxy and combine both of them.
The implementation to use proxy works properly using ClientProxyFeature.
In the same way with 2waySSL using a custom SSLSocketFactory as Oracle says in the documentation. Persisting the State of a Request over SSL (JAX-WS Only)
((BindingProvider) port).getRequestContext().put(
JAXWSProperties.SSL_SOCKET_FACTORY,
SSLClientUtil.getSSLSocketFactoryFromSysProperties());
The issue occurs when combine both features. The handshake does not happend (ClientHello)
The error is:
ACTIVE] ExecuteThread: '19' for queue: 'weblogic.kernel.Default (self-tuning)', READ: TLSv1.2 Alert, length = 64
Padded plaintext after DECRYPTION: len = 64
0000: F0 E5 6E 9F 6F F4 BB 2E 07 29 56 FE 34 0A 10 0B ..n.o....)V.4...
0010: 02 28 7E 75 92 F7 03 4E CD 3A 7E 0B E2 6A 7C 8E .(.u...N.:...j..
0020: 3B F8 4E F5 98 A3 D3 B4 67 76 20 49 1B 77 07 5E ;.N.....gv I.w.^
0030: 9D 66 0D 0D 0D 0D 0D 0D 0D 0D 0D 0D 0D 0D 0D 0D .f..............
[ACTIVE] ExecuteThread: '19' for queue: 'weblogic.kernel.Default (self-tuning)', RECV TLSv1.2 ALERT: fatal, handshake_failure
[ACTIVE] ExecuteThread: '19' for queue: 'weblogic.kernel.Default (self-tuning)', fatal: engine already closed. Rethrowing javax.net.ssl.SSLException: Received fatal alert: handshake_failure
[ACTIVE] ExecuteThread: '19' for queue: 'weblogic.kernel.Default (self-tuning)', fatal: engine already closed. Rethrowing javax.net.ssl.SSLException: Received fatal alert: handshake_failure
<13-sep-2017 09H32' CEST> <Debug> <SecuritySSL> <BEA-000000> <[Thread[[ACTIVE] ExecuteThread: '19' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads]]weblogic.security.SSL.jsseadapter: SSLENGINE: Exception occurred during SSLEngine.unwrap(ByteBuffer,ByteBuffer[]).
javax.net.ssl.SSLException: Received fatal alert: handshake_failure
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:188)
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.fatal(SSLEngineImpl.java:1614)
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.fatal(SSLEngineImpl.java:1582)
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.recvAlert(SSLEngineImpl.java:1751)
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readRecord(SSLEngineImpl.java:1043)
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readNetRecord(SSLEngineImpl.java:865)
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:740)
Debuging and decompiling weblogic source I can see that the HttpsClient when use proxy does not use the custom SSLSocketFactory.
1) In the transport class weblogic.wsee.jaxws.transport.http.client.HttpClientTransport weblogic opens the connection:
protected HttpURLConnection openConnection(Packet paramPacket)
…
localSSLSocketFactory = (javax.net.ssl.SSLSocketFactory)this.context.invocationProperties.get("com.sun.xml.ws.transport.https.client.SSLSocketFactory");
if ((localSSLSocketFactory != null) && ((localSSLSocketFactory instanceof javax.net.ssl.SSLSocketFactory)))
{
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.fine("set (jdk) ssl socketfactory to wls socketfactory");
}
((weblogic.net.http.HttpsURLConnection)localObject3).setSSLSocketFactory(new MySSLSocketFactory((javax.net.ssl.SSLSocketFactory)localSSLSocketFactory));
}
…
As you can see, set the custom SSLSocketFactory.
2) Without a proxy, the weblogic.net.http.HttpsClient uses the custom SSLSocketFactory to create the socket
this.serverSocket = localSocketFactory.createSocket(arrayOfInetAddress[i], paramInt);
The localSocketFactory is the custom SSLSocketFactory.
3) But if uses proxy then create a new SSLSocketFactory
private void makeConnectionUsingProxy(String s, int i, boolean flag)
throws IOException
{
javax.net.ssl.SSLSocketFactory sslsocketfactory;
int j;
SSLContextWrapper sslcontextwrapper = SSLSetup.getSSLContext(sslInfo);
sslcontextwrapper.getHostnameVerifier().setProxyMapping(s, host);
sslcontextwrapper.getTrustManager().setProxyMapping(s, host);
sslsocketfactory = sslcontextwrapper.getSSLSocketFactory();
The sslInfo is an object without the keystore or truststore informed in the SSLSocketFactory. I haven't seen any way to inform the object sslInfo (weblogic.security.SSL.SSLClientInfo)
The variables to start the weblogic are the next:
-Dweblogic.security.SSL.nojce=true -Djavax.net.debug=all -Dssl.debug=true
-Djavax.net.ssl.keyStore=XXXXXs -Djavax.net.ssl.keyStorePassword=XXXXX
-Djdk.tls.enableRC4CipherSuites=true -Djsse.enableSNIExtension=false -Dweblogic.ssl.JSSEEnabled=true -Dweblogic.security.SSL.enableJSSE=true -Dweblogic.security.SSL.nojce=true -Dweblogic.security.SSL.ignoreHostnameVerification=true
The custom SSLSocketFactory is create with this params and with the default trustore. When no proxy is used everything works propertly.
I don't understand why to make the connection with a proxy weblogic does not use the same SSLSocketFactory.
Any ideas?
Oracle people have confirm us that is a "bug" in this implementation, it is only possible to solve with the property -DUseSunHttpHandler=true.
In Oracle 12 you can use the setter method setUseSunHttpHandler of the ClientProxyFeature. But with the weblogic implementation is not possible to solve.