From owner-freebsd-emulation@freebsd.org Thu Feb 6 20:42:51 2020 Return-Path: Delivered-To: freebsd-emulation@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 76A1623A703 for ; Thu, 6 Feb 2020 20:42:51 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48D9Np42HFz4g1J for ; Thu, 6 Feb 2020 20:42:50 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id 016KggW2064888 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 6 Feb 2020 22:42:45 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 016KggW2064888 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id 016KgeIO064887; Thu, 6 Feb 2020 22:42:40 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 6 Feb 2020 22:42:40 +0200 From: Konstantin Belousov To: Steve Roome Cc: freebsd-emulation@freebsd.org Subject: Re: Panics while running Factorio (linux emulation) Message-ID: <20200206204240.GR4808@kib.kiev.ua> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 48D9Np42HFz4g1J X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com X-Spamd-Result: default: False [-2.00 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; IP_SCORE(0.00)[ip: (-3.18), ipnet: 2001:470::/32(-4.66), asn: 6939(-3.58), country: US(-0.05)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; FREEMAIL_ENVFROM(0.00)[gmail.com]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none] X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 20:42:51 -0000 On Thu, Feb 06, 2020 at 03:46:56PM +0000, Steve Roome wrote: > I keep getting panics (short backtraces later on) while running Factorio > for Linux. > > It is using a slightly newer linux glibc than the one in the linux-c7 > ports, but still, I'm running as a user, and it's causing panics. This is a > 64bit linux program that other than these packages on top of a stock > freebsd/x desktop: > > linux-c7-alsa-lib-1.1.8 = > linux-c7-atk-2.28.1 = > linux-c7-cairo-1.15.12_1 = > linux-c7-dbus-libs-1.10.24_1 = > linux-c7-devtools-7.7.1908_4 = > linux-c7-dri-18.3.4 = > linux-c7-elfutils-libelf-0.176 = > linux-c7-elfutils-libs-0.176 = > linux-c7-expat-2.1.0_2 = > linux-c7-flac-libs-1.3.0_2 = > linux-c7-fontconfig-2.13.0 = > linux-c7-freetype-2.8_1 = > linux-c7-fribidi-1.0.2_1 = > linux-c7-gdk-pixbuf2-2.36.12 = > linux-c7-glx-utils-8.3.0_1 = > linux-c7-graphite2-1.3.10 = > linux-c7-gtk2-2.24.31 = > linux-c7-harfbuzz-1.7.5 = > linux-c7-jasper-libs-1.900.1_5 = > linux-c7-jbigkit-libs-2.0_2 = > linux-c7-jpeg-1.2.90_4 = > linux-c7-libasyncns-0.8_1 = > linux-c7-libdrm-2.4.91 < > linux-c7-libgcrypt-1.5.3_4 = > linux-c7-libgfortran-4.8.5_5 = > linux-c7-libglvnd-1.0.1 = > linux-c7-libgpg-error-1.12_2 = > linux-c7-libogg-1.3.0_1 = > linux-c7-libpciaccess-0.14 = > linux-c7-libpng-1.5.13_2 = > linux-c7-libsndfile-1.0.25_3 = > linux-c7-libthai-0.1.14_1 = > linux-c7-libtiff-4.0.3_4 = > linux-c7-libvorbis-1.3.3_2 = > linux-c7-lz4-1.7.5_1 = > linux-c7-pango-1.42.4_1 = > linux-c7-pixman-0.34.0 = > linux-c7-pulseaudio-libs-10.0_2 = > linux-c7-systemd-libs-219_3 = > linux-c7-tcp_wrappers-libs-7.6_2 = > linux-c7-wayland-1.15.0 = > linux-c7-xorg-libs-7.7_8 = > linux-eagle5-5.12.0_6 = > linux-nvidia-libs-440.31 = > linux_base-c7-7.7.1908_1 = > > It also needed this in it's own space: > > gsm-1.0.13-11.el7.x86_64.rpm > > and a bit of patchelf magic and pointing at this glibc2.18 > > libc6_2.18-0ubuntu4_amd64.deb > > > > This happens rather a lot and it'd be nice to stop it, imho, even a badly > behaved user such as myself using a linux app shouldn't be able to cause a > panic > > Ta .. Steve (backtraces below) > > .... > > Feb 6 01:45:55 tv kernel: cpuid = 3 > Feb 6 01:45:55 tv kernel: time = 1580953529 > Feb 6 01:45:55 tv kernel: KDB: stack backtrace: > Feb 6 01:45:55 tv kernel: #0 0xffffffff80c1d2b7 at kdb_backtrace+0x67 > Feb 6 01:45:55 tv kernel: #1 0xffffffff80bd05ed at vpanic+0x19d > Feb 6 01:45:55 tv kernel: #2 0xffffffff80bd0443 at panic+0x43 > Feb 6 01:45:55 tv kernel: #3 0xffffffff810a7dcc at trap_fatal+0x39c > Feb 6 01:45:55 tv kernel: #4 0xffffffff810a7e19 at trap_pfault+0x49 > Feb 6 01:45:55 tv kernel: #5 0xffffffff810a740f at trap+0x29f > Feb 6 01:45:55 tv kernel: #6 0xffffffff81081a2c at calltrap+0x8 > Feb 6 01:45:55 tv kernel: #7 0xffffffff80bb0389 at __mtx_unlock_sleep+0xb9 > Feb 6 01:45:55 tv kernel: #8 0xffffffff8301fd45 at futex_put+0x135 > Feb 6 01:45:55 tv kernel: #9 0xffffffff8301e869 at linux_sys_futex+0xbb9 > Feb 6 01:45:55 tv kernel: #10 0xffffffff810a8984 at amd64_syscall+0x364 > Feb 6 01:45:55 tv kernel: ---<>--- > Feb 6 01:45:55 tv kernel: Copyright (c) 1992-2019 The FreeBSD Project. > Feb 6 01:45:55 tv kernel: Copyright (c) 1979, 1980, 1983, 1986, 1988, > 1989, 1991, 1992, 1993, 1994 > Feb 6 01:45:55 tv kernel: The Regents of the University of > California. All rights reserved. > -- > Feb 6 13:54:13 tv kernel: panic: page fault > Feb 6 13:54:13 tv kernel: cpuid = 0 > Feb 6 13:54:13 tv kernel: time = 1580997227 > Feb 6 13:54:13 tv kernel: KDB: stack backtrace: > Feb 6 13:54:13 tv kernel: #0 0xffffffff80c1d2b7 at kdb_backtrace+0x67 > Feb 6 13:54:13 tv kernel: #1 0xffffffff80bd05ed at vpanic+0x19d > Feb 6 13:54:13 tv kernel: #2 0xffffffff80bd0443 at panic+0x43 > Feb 6 13:54:13 tv kernel: #3 0xffffffff810a7dcc at trap_fatal+0x39c > Feb 6 13:54:13 tv kernel: #4 0xffffffff810a7e19 at trap_pfault+0x49 > Feb 6 13:54:13 tv kernel: #5 0xffffffff810a740f at trap+0x29f > Feb 6 13:54:13 tv kernel: #6 0xffffffff81081a2c at calltrap+0x8 > Feb 6 13:54:13 tv kernel: #7 0xffffffff80bb0389 at __mtx_unlock_sleep+0xb9 > Feb 6 13:54:13 tv kernel: #8 0xffffffff8301fd45 at futex_put+0x135 > Feb 6 13:54:13 tv kernel: #9 0xffffffff8301e869 at linux_sys_futex+0xbb9 > Feb 6 13:54:13 tv kernel: #10 0xffffffff810a8984 at amd64_syscall+0x364 > Feb 6 13:54:13 tv kernel: ---<>--- > Feb 6 13:54:13 tv kernel: Copyright (c) 1992-2019 The FreeBSD Project. > Feb 6 13:54:13 tv kernel: Copyright (c) 1979, 1980, 1983, 1986, 1988, > 1989, 1991, 1992, 1993, 1994 > Feb 6 13:54:13 tv kernel: The Regents of the University of > California. All rights reserved. > -- > Feb 6 15:12:10 tv kernel: panic: page fault > Feb 6 15:12:10 tv kernel: cpuid = 3 > Feb 6 15:12:10 tv kernel: time = 1581001904 > Feb 6 15:12:10 tv kernel: KDB: stack backtrace: > Feb 6 15:12:10 tv kernel: #0 0xffffffff80c1d2b7 at kdb_backtrace+0x67 > Feb 6 15:12:10 tv kernel: #1 0xffffffff80bd05ed at vpanic+0x19d > Feb 6 15:12:10 tv kernel: #2 0xffffffff80bd0443 at panic+0x43 > Feb 6 15:12:10 tv kernel: #3 0xffffffff810a7dcc at trap_fatal+0x39c > Feb 6 15:12:10 tv kernel: #4 0xffffffff810a7e19 at trap_pfault+0x49 > Feb 6 15:12:10 tv kernel: #5 0xffffffff810a740f at trap+0x29f > Feb 6 15:12:10 tv kernel: #6 0xffffffff81081a2c at calltrap+0x8 > Feb 6 15:12:10 tv kernel: #7 0xffffffff80bb0389 at __mtx_unlock_sleep+0xb9 > Feb 6 15:12:10 tv kernel: #8 0xffffffff8301fd45 at futex_put+0x135 > Feb 6 15:12:10 tv kernel: #9 0xffffffff8301e869 at linux_sys_futex+0xbb9 > Feb 6 15:12:10 tv kernel: #10 0xffffffff810a8984 at amd64_syscall+0x364 > Feb 6 15:12:10 tv kernel: ---<>--- > Feb 6 15:12:10 tv kernel: Copyright (c) 1992-2019 The FreeBSD Project. > Feb 6 15:12:10 tv kernel: Copyright (c) 1979, 1980, 1983, 1986, 1988, > 1989, 1991, 1992, 1993, 1994 > Feb 6 15:12:10 tv kernel: The Regents of the University of > California. All rights reserved. > Would be useful to show the source line for futex_put+0x135. What is the system version ? Try this. diff --git a/sys/compat/linux/linux_futex.c b/sys/compat/linux/linux_futex.c index 4f42081156b..35deca0bfdc 100644 --- a/sys/compat/linux/linux_futex.c +++ b/sys/compat/linux/linux_futex.c @@ -329,9 +329,9 @@ futex_put(struct futex *f, struct waiting_proc *wp) f->f_key.shared); LINUX_CTR3(sys_futex, "futex_put uaddr %p ref %d shared %d", f->f_uaddr, f->f_refcount, f->f_key.shared); - FUTEXES_UNLOCK; if (FUTEX_LOCKED(f)) futex_unlock(f); + FUTEXES_UNLOCK; LIN_SDT_PROBE0(futex, futex_put, return); }