CEF overrides Java's signal handlers

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

CEF overrides Java's signal handlers

Postby Czarek » Mon Jul 06, 2020 12:27 pm

In a Java app during the call to CefInitialize I can see in logs that Java's signal handlers were detached. When I remove the call to CefInitialize the warnings disappear. Why would CEF library override signal handlers and how can I prevent this from happening? I know that cefclient app for example sets signal handlers, but that's not the case, I am using raw CEF library, just calling CefInitialize. Logs below:

Code: Select all
Warning: SIGSEGV handler expected:libjvm.dylib+0x4804ec  found:0x0000000000000000
Signal Handlers:
SIGSEGV: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGBUS: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGFPE: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGPIPE: SIG_IGN, sa_mask[0]=00000000000000000000000000000000, sa_flags=SA_RESTART
SIGXFSZ: [libjvm.dylib+0x4804ec], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO
SIGILL: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGUSR1: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=SA_RESTART
SIGUSR2: [libjvm.dylib+0x48000a], sa_mask[0]=00100000000000000000000000000000, sa_flags=SA_RESTART|SA_SIGINFO
SIGHUP: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGINT: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGTERM: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGQUIT: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
Warning: SIGILL handler expected:libjvm.dylib+0x4804ec  found:0x0000000000000000
Signal Handlers:
SIGSEGV: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGBUS: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGFPE: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGPIPE: SIG_IGN, sa_mask[0]=00000000000000000000000000000000, sa_flags=SA_RESTART
SIGXFSZ: [libjvm.dylib+0x4804ec], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO
SIGILL: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGUSR1: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=SA_RESTART
SIGUSR2: [libjvm.dylib+0x48000a], sa_mask[0]=00100000000000000000000000000000, sa_flags=SA_RESTART|SA_SIGINFO
SIGHUP: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGINT: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGTERM: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGQUIT: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
Warning: SIGFPE handler expected:libjvm.dylib+0x4804ec  found:0x0000000000000000
Signal Handlers:
SIGSEGV: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGBUS: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGFPE: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGPIPE: SIG_IGN, sa_mask[0]=00000000000000000000000000000000, sa_flags=SA_RESTART
SIGXFSZ: [libjvm.dylib+0x4804ec], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO
SIGILL: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGUSR1: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=SA_RESTART
SIGUSR2: [libjvm.dylib+0x48000a], sa_mask[0]=00100000000000000000000000000000, sa_flags=SA_RESTART|SA_SIGINFO
SIGHUP: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGINT: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGTERM: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGQUIT: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
Warning: SIGBUS handler expected:libjvm.dylib+0x4804ec  found:0x0000000000000000
Signal Handlers:
SIGSEGV: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGBUS: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGFPE: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGPIPE: SIG_IGN, sa_mask[0]=00000000000000000000000000000000, sa_flags=SA_RESTART
SIGXFSZ: [libjvm.dylib+0x4804ec], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO
SIGILL: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGUSR1: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=SA_RESTART
SIGUSR2: [libjvm.dylib+0x48000a], sa_mask[0]=00100000000000000000000000000000, sa_flags=SA_RESTART|SA_SIGINFO
SIGHUP: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGINT: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGTERM: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGQUIT: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
Warning: SIGPIPE handler expected:libjvm.dylib+0x4804ec  found:0x0000000000000001
Signal Handlers:
SIGSEGV: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGBUS: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGFPE: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGPIPE: SIG_IGN, sa_mask[0]=00000000000000000000000000000000, sa_flags=SA_RESTART
SIGXFSZ: [libjvm.dylib+0x4804ec], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO
SIGILL: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGUSR1: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=SA_RESTART
SIGUSR2: [libjvm.dylib+0x48000a], sa_mask[0]=00100000000000000000000000000000, sa_flags=SA_RESTART|SA_SIGINFO
SIGHUP: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGINT: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGTERM: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGQUIT: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
Warning: SIGHUP handler expected:libjvm.dylib+0x47e5e1  found:0x0000000000000000
Signal Handlers:
SIGSEGV: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGBUS: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGFPE: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGPIPE: SIG_IGN, sa_mask[0]=00000000000000000000000000000000, sa_flags=SA_RESTART
SIGXFSZ: [libjvm.dylib+0x4804ec], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO
SIGILL: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGUSR1: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=SA_RESTART
SIGUSR2: [libjvm.dylib+0x48000a], sa_mask[0]=00100000000000000000000000000000, sa_flags=SA_RESTART|SA_SIGINFO
SIGHUP: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGINT: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGTERM: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGQUIT: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
Warning: SIGINT handler expected:libjvm.dylib+0x47e5e1  found:0x0000000000000000
Running in non-interactive shell, SIGINT handler is replaced by shell
Signal Handlers:
SIGSEGV: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGBUS: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGFPE: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGPIPE: SIG_IGN, sa_mask[0]=00000000000000000000000000000000, sa_flags=SA_RESTART
SIGXFSZ: [libjvm.dylib+0x4804ec], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO
SIGILL: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGUSR1: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=SA_RESTART
SIGUSR2: [libjvm.dylib+0x48000a], sa_mask[0]=00100000000000000000000000000000, sa_flags=SA_RESTART|SA_SIGINFO
SIGHUP: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGINT: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGTERM: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGQUIT: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
Warning: SIGTERM handler expected:libjvm.dylib+0x47e5e1  found:0x0000000000000000
Signal Handlers:
SIGSEGV: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGBUS: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGFPE: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGPIPE: SIG_IGN, sa_mask[0]=00000000000000000000000000000000, sa_flags=SA_RESTART
SIGXFSZ: [libjvm.dylib+0x4804ec], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO
SIGILL: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGUSR1: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=SA_RESTART
SIGUSR2: [libjvm.dylib+0x48000a], sa_mask[0]=00100000000000000000000000000000, sa_flags=SA_RESTART|SA_SIGINFO
SIGHUP: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGINT: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGTERM: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGQUIT: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
Warning: SIGQUIT handler expected:libjvm.dylib+0x47e5e1  found:0x0000000000000000
Signal Handlers:
SIGSEGV: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGBUS: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGFPE: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGPIPE: SIG_IGN, sa_mask[0]=00000000000000000000000000000000, sa_flags=SA_RESTART
SIGXFSZ: [libjvm.dylib+0x4804ec], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO
SIGILL: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGUSR1: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=SA_RESTART
SIGUSR2: [libjvm.dylib+0x48000a], sa_mask[0]=00100000000000000000000000000000, sa_flags=SA_RESTART|SA_SIGINFO
SIGHUP: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGINT: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGTERM: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGQUIT: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. I'm available for contract work, see my resume.
User avatar
Czarek
Virtuoso
 
Posts: 1869
Joined: Sun Nov 06, 2011 2:12 am

Re: CEF overrides Java's signal handlers

Postby Czarek » Mon Jul 06, 2020 1:44 pm

Found this code in Java-CEF wrapper:

Code: Select all
#if defined(OS_POSIX)
  // CefInitialize will reset signal handlers. Backup/restore the original
  // signal handlers to avoid crashes in the JVM (see issue #41).
  BackupSignalHandlers();
#endif

#if defined(OS_MACOSX)
  res = util_mac::CefInitializeOnMainThread(main_args, settings,
                                            client_app.get());
#else
  res = CefInitialize(main_args, settings, client_app.get(), NULL);
#endif

#if defined(OS_POSIX)
  RestoreSignalHandlers();
#endif


So I think I must do similarly in my app. Do I understand correctly that CEF initialization must be executed on the very first line in a Java app? Because if I initalize CEF late then some Java thread could throw an Exception during CEF initialization and due to detached Java signal handlers such Java exception would be fatal?
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. I'm available for contract work, see my resume.
User avatar
Czarek
Virtuoso
 
Posts: 1869
Joined: Sun Nov 06, 2011 2:12 am

Re: CEF overrides Java's signal handlers

Postby Phylanx » Tue Jul 07, 2020 1:32 am

I can't tell for the new versions but our application (using version 3325) is initializing JCEF/CEF far beyong user authentification.
So I don't think you need to do this on the first line of your application (at least we don't do it).
Phylanx
Expert
 
Posts: 121
Joined: Thu Aug 11, 2016 8:17 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 19 guests