Bug 206083

Summary: opera (version 32) crashes under linuxulator (64)
Product: Base System Reporter: Yaroslav <yaroslavfyodor.pushkin>
Component: kernAssignee: Dmitry Chagin <dchagin>
Status: Closed FIXED    
Severity: Affects Some People CC: cem, dchagin, emaste, iwtcex, sirfredrick, trasz
Priority: --- Keywords: patch
Version: CURRENT   
Hardware: amd64   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=249282
Bug Depends on:    
Bug Blocks: 247219    
Attachments:
Description Flags
ktraced and dumped into text file
none
patch for test none

Description Yaroslav 2016-01-09 20:38:53 UTC
Created attachment 165329 [details]
ktraced and dumped into text file

When i run 64bit opera binary under linuxulator (jailed ubuntu 14.04 64bit) it fails to run with the following

"ExceptionHandler::GenerateDump waitpid failed:No child processes
Aborted"
Comment 1 Dmitry Chagin freebsd_committer freebsd_triage 2016-01-09 20:47:41 UTC
grab it
Comment 2 Dmitry Chagin freebsd_committer freebsd_triage 2016-01-11 20:44:41 UTC
Created attachment 165410 [details]
patch for test

please, apply attached patch and run opera. only compile tested.
this is prctl PR_[S|G]ET_DUMPABLE option handling. First prctl fails at SET_DUMPABLE, 
may be patch helps )
Comment 3 Yaroslav 2016-01-11 21:22:42 UTC
Now it passed the first prctl and failed at the second

Before patching kernel

" 1364 opera    RET   linux_setsockopt  -1 errno 92 Protocol not available
  1364 opera    CALL  linux_rt_sigprocmask(0x1,0x7fffffffc9d0,0,0x8)
  1364 opera    RET   linux_rt_sigprocmask  0
  1364 opera    CALL  linux_tgkill(0x554,0x554,0x6)
  1364 opera    RET   linux_tgkill  0
  1364 opera    PSIG  SIGIOT caught handler=0x104aa30 mask=0x0 code=SI_LWP
  1364 opera    CALL  linux_rt_sigaction(0x6,0,0x373ee9cabcc0,0x8)
  1364 opera    RET   linux_rt_sigaction  0
  1364 opera    CALL  linux_prctl(0x4,0x1,0,0,0)
  1364 opera    RET   linux_prctl  -1 errno 22 Invalid argument
  1364 opera    CALL  linux_gettid
  1364 opera    RET   linux_gettid  1364/0x554
  1364 opera    CALL  linux_pipe(0x373ee9cab6b8)
  1364 opera    RET   linux_pipe  0
  1364 opera    CALL  linux_fork
  1364 opera    RET   linux_fork  1365/0x555
  1364 opera    CALL  linux_prctl(0x59616d61,0x555,0,0,0)
  1364 opera    RET   linux_prctl  -1 errno 22 Invalid argument
  1364 opera    CALL  write(0xf,0x158bbb1,0x1)
  1364 opera    GIO   fd 15 wrote 1 byte
       "o""

After the patch

"1157 opera    RET   linux_setsockopt  -1 errno 92 Protocol not available
  1157 opera    CALL  linux_rt_sigprocmask(0x1,0x7fffffffc9d0,0,0x8)
  1157 opera    RET   linux_rt_sigprocmask  0
  1157 opera    CALL  linux_tgkill(0x485,0x485,0x6)
  1157 opera    RET   linux_tgkill  0
  1157 opera    PSIG  SIGIOT caught handler=0x104aa30 mask=0x0 code=SI_LWP
  1157 opera    CALL  linux_rt_sigaction(0x6,0,0x17e5b32d7cc0,0x8)
  1157 opera    RET   linux_rt_sigaction  0
  1157 opera    CALL  linux_prctl(0x4,0x1,0,0,0)
  1157 opera    RET   linux_prctl  1
  1157 opera    CALL  linux_gettid
  1157 opera    RET   linux_gettid  1157/0x485
  1157 opera    CALL  linux_pipe(0x17e5b32d76b8)
  1157 opera    RET   linux_pipe  0
  1157 opera    CALL  linux_fork
  1157 opera    RET   linux_fork  1158/0x486
  1157 opera    CALL  linux_prctl(0x59616d61,0x486,0,0,0)
  1157 opera    RET   linux_prctl  -1 errno 22 Invalid argument
  1157 opera    CALL  write(0xf,0x158bbb1,0x1)
  1157 opera    GIO   fd 15 wrote 1 byte
       "o""
Comment 4 Dmitry Chagin freebsd_committer freebsd_triage 2016-01-12 05:24:05 UTC
(In reply to Yaroslav from comment #3)

After the patch

"1157 opera    RET   linux_setsockopt  -1 errno 92 Protocol not available
  1157 opera    CALL  linux_rt_sigprocmask(0x1,0x7fffffffc9d0,0,0x8)
  1157 opera    RET   linux_rt_sigprocmask  0
  1157 opera    CALL  linux_tgkill(0x485,0x485,0x6)
  1157 opera    RET   linux_tgkill  0

I think that opera after failed setsockopt call kill herself, by sending SIGABRT,

so, we need to implement IP_IPSEC_POLICY 


  1157 opera    PSIG  SIGIOT caught handler=0x104aa30 mask=0x0 code=SI_LWP
  1157 opera    CALL  linux_rt_sigaction(0x6,0,0x17e5b32d7cc0,0x8)
  1157 opera    RET   linux_rt_sigaction  0
  1157 opera    CALL  linux_prctl(0x4,0x1,0,0,0)
  1157 opera    RET   linux_prctl  1
  1157 opera    CALL  linux_gettid
  1157 opera    RET   linux_gettid  1157/0x485
  1157 opera    CALL  linux_pipe(0x17e5b32d76b8)
  1157 opera    RET   linux_pipe  0
  1157 opera    CALL  linux_fork
  1157 opera    RET   linux_fork  1158/0x486
  1157 opera    CALL  linux_prctl(0x59616d61,0x486,0,0,0)
  1157 opera    RET   linux_prctl  -1 errno 22 Invalid argument
  1157 opera    CALL  write(0xf,0x158bbb1,0x1)
  1157 opera    GIO   fd 15 wrote 1 byte
       "o""
Comment 5 Yaroslav 2016-01-12 08:25:00 UTC
This is from Firefox (some similar messages but Firefox actually launches and than some minutes later crashes)

  2747 firefox  RET   gettimeofday  0
  2747 firefox  CALL  linux_socketpair(0x1,0x5,0,0x7fffffff8fa8)
  2747 firefox  RET   linux_socketpair  0
  2747 firefox  CALL  linux_setsockopt(0x48,0x1,0x10,0x806f4de68,0x4)
  2747 firefox  RET   linux_setsockopt  -1 errno 92 Protocol not available
  2747 firefox  CALL  write(0x2,0x802820243,0x1)
  2747 firefox  GIO   fd 2 wrote 1 byte
       0x0000 07                                                                                                        |.|

  2747 firefox  RET   write  1
  2747 firefox  CALL  write(0x2,0x7fffffff6440,0xaf)
  2747 firefox  GIO   fd 2 wrote 175 bytes
       "[Parent 2747] ###!!! ABORT: can't create crash reporter socketpair(): file /build/firefox-UUVPGb/firefox-43.0.4+build3/toolkit/crashreporter/nsExceptionHand\
	ler.cpp, line 2756
       "
  2747 firefox  RET   write  175/0xaf
  2747 firefox  CALL  write(0x2,0x7fffffff8b9c,0xae)
  2747 firefox  GIO   fd 2 wrote 174 bytes
       "[Parent 2747] ###!!! ABORT: can't create crash reporter socketpair(): file /build/firefox-UUVPGb/firefox-43.0.4+build3/toolkit/crashreporter/nsExceptionHand\
	ler.cpp, line 2756"
  2747 firefox  RET   write  174/0xae
  2747 firefox  CALL  write(0x2,0x802820243,0x1)
  2747 firefox  GIO   fd 2 wrote 1 byte
       "
       "
  2747 firefox  RET   write  1
  2747 firefox  PSIG  SIGSEGV caught handler=0x8066c9e40 mask=0x0 code=SEGV_MAPERR
  2747 firefox  CALL  linux_unlink(0x802af28e0)
  2747 firefox  NAMI  "/compat/linux/root/.mozilla/firefox/d9789azj.default/lock"
  2747 firefox  NAMI  "/root/.mozilla/firefox/d9789azj.default/lock"
  2747 firefox  RET   linux_unlink  -1 errno 2 No such file or directory
  2747 firefox  CALL  close(0x6)
  2747 firefox  RET   close  0
  2747 firefox  CALL  linux_rt_sigaction(0xb,0,0x7fffffff8630,0x8)
  2747 firefox  RET   linux_rt_sigaction  0
  2747 firefox  CALL  linux_prctl(0x4,0x1,0x9d,0x8,0x7fffffff86e8)
  2747 firefox  RET   linux_prctl  1
  2747 firefox  CALL  linux_gettid
  2747 firefox  RET   linux_gettid  2747/0xabb
  2747 firefox  CALL  linux_mmap2(0,0x2000,0x3,0x22,0xffffffffffffffff,0)
  2747 firefox  RET   linux_mmap2  34380840960/0x801420000
  2747 firefox  CALL  linux_pipe(0x802a48950)
  2747 firefox  RET   linux_pipe  0
  2747 firefox  CALL  linux_clone(0x800600,0x801421f40,0,0,0)
  2747 firefox  RET   linux_clone  2756/0xac4
  2747 firefox  CALL  linux_prctl(0x59616d61,0xac4,0x9d,0,0)
  2747 firefox  RET   linux_prctl  -1 errno 22 Invalid argument
  2747 firefox  CALL  write(0x49,0x806f4df2d,0x1)
  2747 firefox  GIO   fd 73 wrote 1 byte
    "a"
  2747 firefox  RET   write  1
  2747 firefox  CALL  linux_wait4(0xac4,0x7fffffff8014,0x40000000,0)
  2747 firefox  RET   linux_wait4  -1 errno 10 No child processes
  2747 firefox  CALL  close(0x6)
  2747 firefox  RET   close  0
  2747 firefox  CALL  close(0x49)
  2747 firefox  RET   close  0
  2747 firefox  CALL  write(0x2,0x806f4df30,0x2e)
  2747 firefox  GIO   fd 2 wrote 46 bytes
       "ExceptionHandler::GenerateDump waitpid failed:"
  2747 firefox  RET   write  46/0x2e
  2747 firefox  CALL  write(0x2,0x8025ddff3,0x12)
  2747 firefox  GIO   fd 2 wrote 18 bytes
       "No child processes"
Comment 6 Ed Maste freebsd_committer freebsd_triage 2018-08-01 15:28:37 UTC
@dchagin, should we at least commit the proposed patch now?
Comment 7 Alex S 2019-10-01 22:42:43 UTC
Is this PR still relevant?

(In reply to Dmitry Chagin from comment #4)

> so, we need to implement IP_IPSEC_POLICY
I'm fairly sure it's SO_PASSCRED option per https://cs.chromium.org/chromium/src/services/service_manager/zygote/host/zygote_host_impl_linux.cc?l=151&rcl=3012762a85e731dbb5070e292b6c15ae4c043d74 assertion. At least that is where CEF (Chromium Embedded Framework) example application crashes for me if I don't pass --no-sandbox and --no-zygote flags.
Comment 8 Conrad Meyer freebsd_committer freebsd_triage 2020-09-12 20:46:13 UTC
*** Bug 249282 has been marked as a duplicate of this bug. ***
Comment 9 Dmitry Chagin freebsd_committer freebsd_triage 2023-01-30 17:53:45 UTC
SO_PASSCRED implemented by cem@