Bug 229392

Summary: www/rubygem-passenger: Process aborted! signo=SIGABRT(6)
Product: Ports & Packages Reporter: iron.udjin
Component: Individual Port(s)Assignee: Sergey A. Osokin <osa>
Status: Closed FIXED    
Severity: Affects Only Me CC: david, jonaspalm, kastner, romain, vvd
Priority: --- Flags: bugzilla: maintainer-feedback? (osa)
Version: Latest   
Hardware: amd64   
OS: Any   
Attachments:
Description Flags
set of patch files for passenger
none
Patch to update to 5.3.4 none

Description iron.udjin 2018-06-28 15:34:58 UTC
Hello,

After passenger upgrade from 5.2.3 to 5.3.2 on FreeBSD 11.2-STABLE r335568M when I try to restart nginx I see:

nginx: [alert] Unable to start the Phusion Passenger watchdog: it seems to have been killed with signal

passenger-crash-log:

[ pid=65135, timestamp=1529724482 ] Process aborted! signo=SIGABRT(6), reason=#65543, si_addr=0x0, randomSeed=1529724482
[ pid=65135 ] Crash log dumped to /var/tmp/passenger-crash-log.1529724482
[ pid=65135 ] Date, uname and ulimits:
Sat Jun 23 06:28:02 +03 2018
FreeBSD 11.2-STABLE FreeBSD 11.2-STABLE #0 r335568M: Sat Jun 23 01:44:21 +03 2018     root@mm:/usr/obj/usr/src/sys/MM  amd64 amd64
cpu time               (seconds, -t)  unlimited
file size           (512-blocks, -f)  unlimited
data seg size           (kbytes, -d)  33554432
stack size              (kbytes, -s)  524288
core file size      (512-blocks, -c)  unlimited
max memory size         (kbytes, -m)  unlimited
locked memory           (kbytes, -l)  131072
max user processes              (-u)  89999
open files                      (-n)  3773268
virtual mem size        (kbytes, -v)  unlimited
swap limit              (kbytes, -w)  unlimited
socket buffer size       (bytes, -b)  unlimited
pseudo-terminals                (-p)  unlimited
kqueues                         (-k)  unlimited
umtx shared locks               (-o)  unlimited
[ pid=65135 ] Phusion Passenger version: 5.3.2
[ pid=65135 ] libc backtrace not available.
--------------------------------------
[ pid=65135 ] Open files and file descriptors:
*** ERROR: cannot execute lsof: No such file or directory (errno=2)
Falling back to another mechanism for dumping file descriptors.
ls: illegal option -- v
usage: ls [-ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1,] [-D format] [file ...]
ERROR: Could not run 'ls' to dump file descriptor information!
--------------------------------------
[ pid=65135 ] Dumping a backtrace with crash-watch...
Found gdb at: /usr/bin/gdb
/usr/bin/gdb is broken on FreeBSD. Looking for an alternative...
*** ERROR ***: '/usr/bin/gdb' is broken on FreeBSD. Please install the one from the devel/gdb port instead. If you want to use another gdb


Coredump backtrace:

(gdb) bt
#0  0x0000000802a6dd9a in thr_kill () from /lib/libc.so.7
#1  0x0000000802a6dd64 in __raise (s=6) at /usr/src/lib/libc/gen/raise.c:52
#2  0x0000000802a6dcd9 in abort () at /usr/src/lib/libc/stdlib/abort.c:65
#3  0x0000000000418ca3 in boost::throw_exception<boost::bad_function_call> (e=...) at src/cxx_supportlib/vendor-modified/boost/throw_exception.hpp:69
#4  0x000000000041fa28 in boost::function1<Passenger::Json::Value, Passenger::Json::Value const&>::operator() (this=<optimized out>, a0=...) at src/cxx_supportlib/vendor-modified/boost/function/function_template.hpp:757
#5  Passenger::ConfigKit::Store::applyInspectFilters (this=<optimized out>, doc=...) at src/cxx_supportlib/ConfigKit/Store.h:219
#6  0x0000000000416932 in Passenger::ConfigKit::Store::inspect (this=<optimized out>) at src/cxx_supportlib/ConfigKit/Store.h:542
#7  0x00000000004116bb in Passenger::LoggingKit::Context::inspectConfig (this=<optimized out>) at src/cxx_supportlib/LoggingKit/Implementation.cpp:592
#8  0x000000000048dc0a in Passenger::Agent::Fundamentals::initializeLoggingKit (processName=0x954cc8 "Passenger watchdog", config=..., loggingKitTranslator=..., loggingKitPreInitFunc=@0x7fffffffc578: 0x0)
    at src/agent/Shared/Fundamentals/Initialization.cpp:492
#9  0x000000000048c7fd in Passenger::Agent::Fundamentals::initializeAgent (argc=3, argv=0x7fffffffc5b0, processName=0x954cc8 "Passenger watchdog", config=..., loggingKitTranslator=..., 
    optionParser=0x4c22e0 <parseOptions(int, char const**, Passenger::ConfigKit::Store&)>, loggingKitPreInitFunc=@0x7fffffffc578: 0x0, argStartIndex=2) at src/agent/Shared/Fundamentals/Initialization.cpp:610
#10 0x00000000004b2680 in initializeBareEssentials (argc=3, argv=0x7fffffffec88, wo=...) at src/agent/Watchdog/WatchdogMain.cpp:804
#11 0x00000000004b1358 in watchdogMain (argc=3, argv=0x7fffffffec88) at src/agent/Watchdog/WatchdogMain.cpp:1296
#12 0x000000000048ba18 in dispatchSubcommand (argc=3, argv=0x7fffffffec88) at src/agent/AgentMain.cpp:82
#13 0x000000000048b8f6 in main (argc=3, argv=0x7fffffffec88) at src/agent/AgentMain.cpp:105

nginx configuration:

passenger_root /usr/local/lib/ruby/gems/2.3/gems/passenger;
passenger_ruby /usr/local/bin/ruby23;
passenger_user redmine;
passenger_group redmine;

server {
...
    passenger_enabled on;
...
}

Original bug report: https://github.com/phusion/passenger/issues/2097
Comment 1 Vladimir Druzenko freebsd_committer freebsd_triage 2018-07-10 19:27:20 UTC
Same here with FreeBSD 11.2 amd64 (clang 6.0.0), passenger 5.3.2 and 5.3.3, apache 2.4:
(gdb) bt
#0  0x0000000802c3547a in thr_kill () from /lib/libc.so.7
#1  0x0000000802c35444 in raise () from /lib/libc.so.7
#2  0x0000000802c353b9 in abort () from /lib/libc.so.7
#3  0x0000000000420b32 in boost::throw_exception<boost::bad_function_call> (e=@0x7fffffff8b50) at throw_exception.hpp:69
#4  0x0000000000430764 in boost::function1<Passenger::Json::Value, Passenger::Json::Value const&>::operator() (
    this=0x805a2b778, a0=@0x805abfdd0) at function_template.hpp:757
#5  0x000000000042e813 in Passenger::ConfigKit::Store::applyInspectFilters (this=0x805a67568, doc=@0x7fffffffaf80)
    at Store.h:219
#6  0x000000000041d0da in Passenger::ConfigKit::Store::inspect (this=0x805a67568) at Store.h:542
#7  0x0000000000413639 in Passenger::LoggingKit::Context::inspectConfig (this=0x805a67500)
    at src/cxx_supportlib/LoggingKit/Implementation.cpp:592
#8  0x0000000000502c7a in Passenger::Agent::Fundamentals::initializeLoggingKit (processName=0x9d4080 "Passenger watchdog", 
    config=@0x805a64db0, loggingKitTranslator=@0x805a26120, loggingKitPreInitFunc=@0x7fffffffc538) at Initialization.cpp:492
#9  0x000000000050186d in Passenger::Agent::Fundamentals::initializeAgent (argc=3, argv=0x7fffffffc570, 
    processName=0x9d4080 "Passenger watchdog", config=@0x805a64db0, loggingKitTranslator=@0x805a26120, 
    optionParser=0x531970 <parseOptions(int, char const**, Passenger::ConfigKit::Store&)>, 
    loggingKitPreInitFunc=@0x7fffffffc538, argStartIndex=2) at Initialization.cpp:610
#10 0x0000000000521d10 in initializeBareEssentials (argc=3, argv=0x7fffffffec48, wo=@0x7fffffffeb20)
    at src/agent/Watchdog/WatchdogMain.cpp:804
#11 0x00000000005209e8 in watchdogMain (argc=3, argv=0x7fffffffec48) at src/agent/Watchdog/WatchdogMain.cpp:1296
#12 0x0000000000500a88 in dispatchSubcommand (argc=3, argv=0x7fffffffec48) at src/agent/AgentMain.cpp:82
#13 0x0000000000500966 in main (argc=3, argv=0x7fffffffec48) at src/agent/AgentMain.cpp:105

But it work fine after compile passenger with gcc:
CC=gcc6 CXX=g++6 CPP=cpp6 passenger-install-apache2-module

And it work fine with FreeBSD 11.1 (clang 4.0.0).

I think it's clang 6.0.0 issue.
Comment 2 Vladimir Druzenko freebsd_committer freebsd_triage 2018-07-11 18:54:13 UTC
It's boost's issue.

Bug report at passenger's tracker:
https://github.com/phusion/passenger/issues/2097777

Bug report at boost's tracker:
https://svn.boost.org/trac10/ticket/13632
Comment 3 Vladimir Druzenko freebsd_committer freebsd_triage 2018-07-11 21:32:40 UTC
Correct link is:
https://github.com/phusion/passenger/issues/2097
Comment 4 Vladimir Druzenko freebsd_committer freebsd_triage 2018-07-16 15:52:37 UTC
Fixed in upstream: https://github.com/phusion/passenger/issues/2097#issuecomment-405160085
Waiting 5.3.4 release or add patch.
Comment 5 david 2018-07-24 02:55:41 UTC
I have patched this with an extracted patch from passenger's github page and its working, providing patch until upstream can do another release
Comment 6 david 2018-07-24 03:27:41 UTC
Created attachment 195411 [details]
set of patch files for passenger

just untar this to /usr/ports/www/rubygem-passenger.

Source for this patch:
https://github.com/phusion/passenger/commit/98064360967103030114417de2ea414ceed6bbca
Comment 7 Vladimir Druzenko freebsd_committer freebsd_triage 2018-08-01 21:44:50 UTC
passenger 5.3.4 was released 2 days ago: https://github.com/phusion/passenger/blob/stable-5.3/CHANGELOG

Tested on 11.2 amd64 - all work fine.
Comment 8 Romain Tartière freebsd_committer freebsd_triage 2018-08-02 15:24:46 UTC
Created attachment 195766 [details]
Patch to update to 5.3.4

Replace previous attachment of ad hoc patches with a single patch to update the port itself to the latest version.

Seems to perform well for my use case :-)
Comment 9 commit-hook freebsd_committer freebsd_triage 2018-08-05 16:46:24 UTC
A commit references this bug:

Author: osa
Date: Sun Aug  5 16:45:53 UTC 2018
New revision: 476419
URL: https://svnweb.freebsd.org/changeset/ports/476419

Log:
  Upgrade passenger and its third-party modules for www/nginx and
  www/nginx-devel from 5.3.3 to 5.3.4.

  PR:	229392

  <ChangeLog>

  * Fixes a crash during startup on FreeBSD 11.2 and recent OpenBSD versions
    due to C++11 compatibility issues in the code. Closes GH-2097.
  * Updates Boost to version 1.67.0.
  * [Apache] Fixes the handling of HTTP requests with chunked bodies in
    combination with `PassengerBufferUploads off`. Closes GH-2102.

  </ChangeLog>

Changes:
  head/www/nginx/Makefile
  head/www/nginx/Makefile.extmod
  head/www/nginx/distinfo
  head/www/nginx/files/extra-patch-passenger-build-nginx.rb
  head/www/nginx-devel/Makefile
  head/www/nginx-devel/Makefile.extmod
  head/www/nginx-devel/distinfo
  head/www/nginx-devel/files/extra-patch-passenger-build-nginx.rb
  head/www/rubygem-passenger/Makefile
  head/www/rubygem-passenger/distinfo
Comment 10 Sergey A. Osokin freebsd_committer freebsd_triage 2018-08-05 16:54:35 UTC
Hi there,

the passenger and its third-party modules have been upgraded to 5.3.4.

Thanks for the report!