Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

segfault after interrupting hung process with /stoppable=true #74

Open
tarkin000 opened this issue Dec 4, 2016 · 2 comments
Open

segfault after interrupting hung process with /stoppable=true #74

tarkin000 opened this issue Dec 4, 2016 · 2 comments

Comments

@tarkin000
Copy link

In the course of debugging, I was running HFC with /stoppable=True.
Hitting enter would shutdown the service, but would hang in the terminal.
Hitting ctl-c causes this:

libev.c:432: Shutdown():        Goodbye.
Stacktrace:


Native stacktrace:

        mono() [0x4accca]
        mono() [0x5040fe]
        mono() [0x4275d7]
        /lib/x86_64-linux-gnu/libpthread.so.0(+0xf0a0) [0x7f3b55cc10a0]
        /lib/x86_64-linux-gnu/libpthread.so.0(pthread_mutex_lock+0x4) [0x7f3b55cbb194]
        /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5(+0x255ee) [0x7f3b5160f5ee]
        /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5(event_base_loop+0x120) [0x7f3b515faf60]
        /usr/lib/libhfc-native.so.1(ProcessLoop+0xd) [0x7f3b51d3245d]
        [0x4032aeaa]

Debug info from gdb:


=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================

Aborted

Command line:
mono --debug /usr/local/src/HyperFastCgi/src/HyperFastCgi/4.0/bin/Release/HyperFastCgi.exe /config=/etc/nginx/hyper.config /stoppable=True /printlog=True /loglevels=All

@xplicit
Copy link
Owner

xplicit commented Dec 7, 2016

Can you provide a reproducible case (application and configs), so I can look what is wrong?

@tarkin000
Copy link
Author

tarkin000 commented Dec 8, 2016

Reflect.cs (it's a bad name, has nothing to do with reflection)

using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Text;
using Newtonsoft.Json;
using HyperFastCgi;
using HyperFastCgi.AppHosts.Raw;
using HyperFastCgi.Interfaces;

namespace Reflect {
  public class PeekRequest : BaseRawRequest {
    public override void Process(IWebResponse response) {
      string json;
      if (ServerVariables == null || ServerVariables.Count == 0) {
        json = "null";
      } else {
        json = JsonConvert.SerializeObject(ServerVariables,Formatting.Indented);
      }
      Status = 200;
      StatusDescription = "OK";
      ResponseHeaders.Add("Content-Type","application/json");
      response.Send(Encoding.UTF8.GetBytes(json));
      response.CompleteResponse();
    }
  }
}

And hyper.config:

<!-- vim: set ft=xml: -->
<configuration>
  <server type="HyperFastCgi.ApplicationServers.SimpleApplicationServer">
    <host-factory>HyperFastCgi.HostFactories.SystemWebHostFactory</host-factory>
    <threads min-worker="40" max-worker="0" min-io="4" max-io="0"/>
    <root-dir>/opt/hyper</root-dir>
  </server>
  <listener type="HyperFastCgi.Listeners.NativeListener">
    <apphost-transport type="HyperFastCgi.Transports.NativeTransport">
      <multithreading>ThreadPool</multithreading>
    </apphost-transport>
    <protocol>Unix</protocol>
    <address>/var/tmp/hyper.sock</address>
  </listener>
  <apphost type="HyperFastCgi.AppHosts.Raw.RawHost">
    <log level="All" write-to-console="true" />
    <add-trailing-slash>false</add-trailing-slash>
    <request-type>Reflect.PeekRequest,Reflect</request-type>
  </apphost>
</configuration>

Mono:
Mono JIT compiler version 4.6.2 (Stable 4.6.2.7/08fd525 Mon Nov 14 12:30:00 UTC 2016)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: sgen

Machine:
Linux vm1 3.2.0-4-amd64 #1 SMP Debian 3.2.82-1 x86_64 GNU/Linux
(7 / Wheezy)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants