tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: rust problem when building firefox



On Thu, Nov 16, 2023 at 04:18:33PM +0100, Thomas Klausner wrote:
> On Thu, Nov 16, 2023 at 02:02:58PM +0000, Jonathan Perkin wrote:
> > * On 2023-11-16 at 13:33 GMT, Thomas Klausner wrote:
> > 
> > > When building firefox in my bulk builds, I sometimes see
> > > non-reproducible errors like this one:
> > > 
> > >   0:          0x19147a8 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hc7af7c8c491f235f
> > >   1:          0x195895c - core::fmt::write::h6704aa23384ebf6d
> > >   2:          0x191770e - std::io::Write::write_fmt::h1ec88ed87f1a548f
> > >   3:          0x1914536 - std::sys_common::backtrace::print::h439fad3f83fbc4b5
> > >   4:          0x19346e3 - std::panicking::default_hook::{{closure}}::h1c39ed34efd31c8a
> > >   5:          0x1934368 - std::panicking::default_hook::h4ee60615d1c92b96
> > >   6:          0x193596c - std::panicking::rust_panic_with_hook::hec2f115bd3abe8a5
> > >   7:          0x1914fb7 - std::panicking::begin_panic_handler::{{closure}}::h92a702d96e469894
> > >   8:          0x1914c46 - std::sys_common::backtrace::__rust_end_short_backtrace::h4f5ab40c7a48f822
> > >   9:          0x19354d2 - rust_begin_unwind
> > >  10:           0xc71343 - core::panicking::panic_fmt::h0a6a30a68313052a
> > >  11:          0x193d620 - std::sys::unix::thread::guard::init::h5287555ac329da10
> > >  12:          0x190a3b9 - std::rt::init::h6e67e26812f912e8
> > >  13:          0x190a52b - std::rt::lang_start_internal::h927544304a5690c7
> > >  14:           0xcf2cd5 - main
> > >  15:           0xbf637d - ___start
> > >                               at /usr/src/lib/csu/common/crt0-common.c:350:2
> > > fatal runtime error: initialization or cleanup bug
> > > 
> > > 
> > > It does not happen every time, but regularly.
> > > 
> > > Is this a bug in rust?
> > 
> > It might be missing some initialisation in the NetBSD implementation of
> > Rust.  It's panicking in this function:
> > 
> >   https://doc.rust-lang.org/src/std/sys/unix/thread.rs.html#835-914
> > 
> > There's some OS-specific code for other BSDs.  Does NetBSD also need to do
> > something specific here?
> 
> Does he@ know? :)
> 
> > Or maybe you're just running out of stack space.
> 
> I'll locally add 'stacksize' to UNLIMIT_RESOURCES and see if that makes it better.

Just to confirm, even with:

/usr/pkgsrc/www/firefox> cvs di
Index: mozilla-common.mk
===================================================================
RCS file: /cvsroot/pkgsrc/www/firefox/mozilla-common.mk,v
retrieving revision 1.269
diff -u -r1.269 mozilla-common.mk
--- mozilla-common.mk   9 Nov 2023 00:04:43 -0000       1.269
+++ mozilla-common.mk   18 Nov 2023 05:38:33 -0000
@@ -15,7 +15,7 @@
 HAS_CONFIGURE=         yes
 CONFIGURE_ARGS+=       --prefix=${PREFIX}
 USE_TOOLS+=            pkg-config perl gmake gm4 unzip zip # autoconf213
-UNLIMIT_RESOURCES+=    datasize virtualsize
+UNLIMIT_RESOURCES+=    datasize stacksize virtualsize
 
 USE_LANGUAGES+=                c c++
 


I see:

/usr/pkg/bin/cargo rustc  --release --frozen --manifest-path /scratch/www/firefox/work/firefox-119.0.1/security/manager/ssl/ipcclientcerts/Cargo.toml    --lib --target=x86_64-unk
nown-netbsd --features 'mozilla-central-workspace-hack' --  -Clto
thread '<unnamed>' panicked at library/std/src/sys/unix/thread.rs:855:17:
failed to allocate a guard page: File too large (os error 27)
stack backtrace:
   0:          0x17047a8 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hc7af7c8c491f235f
   1:          0x174895c - core::fmt::write::h6704aa23384ebf6d
   2:          0x170770e - std::io::Write::write_fmt::h1ec88ed87f1a548f
   3:          0x1704536 - std::sys_common::backtrace::print::h439fad3f83fbc4b5
   4:          0x17246e3 - std::panicking::default_hook::{{closure}}::h1c39ed34efd31c8a
   5:          0x1724368 - std::panicking::default_hook::h4ee60615d1c92b96
   6:          0x172596c - std::panicking::rust_panic_with_hook::hec2f115bd3abe8a5
   7:          0x1704fb7 - std::panicking::begin_panic_handler::{{closure}}::h92a702d96e469894
   8:          0x1704c46 - std::sys_common::backtrace::__rust_end_short_backtrace::h4f5ab40c7a48f822
   9:          0x17254d2 - rust_begin_unwind
  10:           0xa61343 - core::panicking::panic_fmt::h0a6a30a68313052a
  11:          0x172d620 - std::sys::unix::thread::guard::init::h5287555ac329da10
  12:          0x16fa3b9 - std::rt::init::h6e67e26812f912e8
  13:          0x16fa52b - std::rt::lang_start_internal::h927544304a5690c7
  14:           0xae2cd5 - main
  15:           0x9e637d - ___start
                               at /usr/src/lib/csu/common/crt0-common.c:350:2
fatal runtime error: initialization or cleanup bug

So we seem to need some code changes for the stack guard page.
 Thomas


Home | Main Index | Thread Index | Old Index