patrickfrey / strusWebService

web service (HTTP/JSON) to use the strus API as a service
http://project-strus.net
Mozilla Public License 2.0
4 stars 0 forks source link

strusWebService stops on query with stack smashing error #68

Closed andreasbaumann closed 6 years ago

andreasbaumann commented 6 years ago

on ARMv6:

* strusWebService.service - strus web service
   Loaded: loaded (/usr/lib/systemd/system/strusWebService.service; enabled; vendor preset: disabled)
   Active: failed (Result: signal) since Tue 2017-10-03 15:14:56 CEST; 2min 26s ago
     Docs: man:strusWebService(8)
           man:strusWebService.conf(5)
           http://www.project-strus.net
  Process: 32169 ExecStart=/usr/sbin/strusWebService -c /etc/strusWebService/strusWebService.conf (code=killed, signal=
 Main PID: 32169 (code=killed, signal=ABRT)

Oct 03 15:14:51 euroweb systemd[1]: Started strus web service.
Oct 03 15:14:52 euroweb strusWebService[32169]: 2017-10-03 15:14:52; strusWebService, info: Starting strus web service.
Oct 03 15:14:52 euroweb strusWebService[32169]: 2017-10-03 15:14:52; cppcms, warning: The default system locale is 'C',
Oct 03 15:14:54 euroweb strusWebService[32169]: 2017-10-03 15:14:54; cppcms_http, info: POST /strus/query/wwwandreasbau
Oct 03 15:14:54 euroweb strusWebService[32169]: *** stack smashing detected ***: <unknown> terminated
Oct 03 15:14:56 euroweb systemd[1]: strusWebService.service: Main process exited, code=killed, status=6/ABRT
Oct 03 15:14:56 euroweb systemd[1]: strusWebService.service: Unit entered failed state.
Oct 03 15:14:56 euroweb systemd[1]: strusWebService.service: Failed with result 'signal'.
andreasbaumann commented 6 years ago
2017-10-21 12:03:14; strusWebService, debug: query_request(wwwandreasbaumanncc): {"query":{"exclude":[],"features":[{"name":"feat","value":{"term":{"type":"word","value":"the"}},"weight":1},{"name":"sel","value":{"expression":{"cardinality":0,"operator":"union","range":0,"terms":[{"term":{"type":"word","value":"the"}}]}},"weight":1}],"first_rank":0,"metadata":[],"nof_ranks":100,"restrict":[],"select":["sel"],"summarizer":[{"attribute":"docid","name":"attribute","params":[{"key":"name","value":"docid"}],"resultnames":[]},{"attribute":"title_attribute","name":"attribute","params":[{"key":"name","value":"title"}],"resultnames":[{"key":"resultname","value":"title_attribute"}]},{"attribute":"title","name":"test","params":[{"key":"type","value":"title"},{"key":"match","value":"feat"},{"key":"N","value":50},{"key":"add_dots","value":0},{"key":"start_first_match","value":0},{"key":"mark","value":"#SMARK#%1%#EMARK#"}],"resultnames":[{"key":"resultname","value":"title"}]},{"attribute":"abstract","name":"test","params":[{"key":"type","value":"text"},{"key":"match","value":"feat"},{"key":"N","value":50},{"key":"add_dots","value":1},{"key":"start_first_match","value":1},{"key":"mark","value":"#SMARK#%1%#EMARK#"}],"resultnames":[{"key":"resultname","value":"text"}]}],"weighting":[{"name":"bm25","params":[{"key":"match","value":"feat"}]}]}} (query.cpp:98)
2017-10-21 12:03:14; strusWebService, debug: Simple storage config string: path=/srv/strusWebService/storage/wwwandreasbaumanncc (strusWebService.cpp:424)
*** stack smashing detected ***: <unknown> terminated
Aborted (core dumped)
andreasbaumann commented 6 years ago

We need some static analysis here, the gdb dump is not telling much:

Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) info thread
  Id   Target Id         Frame 
* 1    Thread 0x729c5430 (LWP 29041) 0x766d9448 in raise () from /usr/lib/libc.so.6
  2    Thread 0x74229010 (LWP 29037) 0x76781f18 in epoll_pwait () from /usr/lib/libc.so.6
  3    Thread 0x741c5430 (LWP 29038) 0x76801e98 in pthread_cond_wait@@GLIBC_2.4 ()
   from /usr/lib/libpthread.so.0
  4    Thread 0x739c5430 (LWP 29039) 0x76801e98 in pthread_cond_wait@@GLIBC_2.4 ()
   from /usr/lib/libpthread.so.0
  5    Thread 0x731c5430 (LWP 29040) 0x76801e98 in pthread_cond_wait@@GLIBC_2.4 ()
   from /usr/lib/libpthread.so.0
(gdb) bt
#0  0x766d9448 in raise () from /usr/lib/libc.so.6
#1  0x766daac4 in abort () from /usr/lib/libc.so.6
#2  0x00000000 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
patrickfrey commented 6 years ago

Not reproducible anymore.