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

Upgrade to latest Ubuntu LTS #16

Merged
merged 1 commit into from
Jun 17, 2020
Merged

Upgrade to latest Ubuntu LTS #16

merged 1 commit into from
Jun 17, 2020

Conversation

jeroen
Copy link
Contributor

@jeroen jeroen commented Jun 17, 2020

Upgrade Ubuntu to get the latest sanitizers to stay in line with what CRAN is using.

@wch
Copy link
Owner

wch commented Jun 17, 2020

Have you tested to see if the build still works?

@jeroen
Copy link
Contributor Author

jeroen commented Jun 17, 2020

No not yet (I was hoping for CI 😄 ).

@wch
Copy link
Owner

wch commented Jun 17, 2020

The automatic build only happen with the master branch. (It runs on a computer of mine because the builds take too long for CI services.)

When I tried to build, I get:

Step 5/18 : RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
 ---> Running in 47417a7a2ace
Warning: apt-key output should not be parsed (stdout is not a terminal)
Executing: /tmp/apt-key-gpghome.VXi19ngDES/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
gpg: key 51716619E084DAB9: public key "Michael Rutter <[email protected]>" imported
gpg: Total number processed: 1
gpg:               imported: 1
 ---> 91cca985a41d
Removing intermediate container 47417a7a2ace
Step 6/18 : RUN add-apt-repository "deb http://cran.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran35/"
 ---> Running in c05da705cbb8
Hit:1 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:2 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Ign:5 http://cran.r-project.org/bin/linux/ubuntu focal-cran35/ InRelease
Err:6 http://cran.r-project.org/bin/linux/ubuntu focal-cran35/ Release
  404  Not Found [IP: 137.208.57.37 80]
Reading package lists...
E: The repository 'http://cran.r-project.org/bin/linux/ubuntu focal-cran35/ Release' does not have a Release file.
The command '/bin/sh -c add-apt-repository "deb http://cran.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran35/"' returned a non-zero code: 100

@jeroen
Copy link
Contributor Author

jeroen commented Jun 17, 2020

Ah ok, let me fix that...

@jeroen
Copy link
Contributor Author

jeroen commented Jun 17, 2020

OK updated. Running build-all locally now, so far so good...

@wch wch merged commit 6d0dc7b into wch:master Jun 17, 2020
@jeroen jeroen deleted the patch-1 branch June 17, 2020 15:37
@jeroen
Copy link
Contributor Author

jeroen commented Jun 17, 2020

Thanks!

@eddelbuettel
Copy link

Have you two tested the images? For RDcsan I get persistent errors such as C stack usage 7984768 is too close to the limit (even after reinstalling Rcpp and the package I am testing).

@wch
Copy link
Owner

wch commented Jun 29, 2020

I haven't tested RDcsan after the changes. If you're getting that message, it's likely this part needs to be tweaked:

# Modify the RDcsan script to increase stack size with `ulimit -Ss 65532`;
# otherwise we get these messages during package compilation:
# Error: compilation failed - C stack usage 8042720 is too close to the limit at NULL
RUN sed -i 's/^#!\/bin\/bash/#!\/bin\/bash\nulimit -Ss 65532/' /usr/local/bin/RDcsan

@eddelbuettel
Copy link

Oh, nice. Do you have a suggested value? And "how much" then needs rebuilding? The container? Or just the package and its dependencies?

It's a bit weird. I was also running individual test files via RDcsanscript -- which would need a rebuild -- and when I run it via RDcsan -q -e '...' it passes (mosts) the tests but still yells loud and long to the console. Hm.

@wch
Copy link
Owner

wch commented Jun 29, 2020

To rebuild just the stage that provides RDcsan, you'll want to do:

docker build -t wch1/r-debug-3 r-debug-3

Then you can do docker run wch1/r-debug-3 to test it out.

To rebuild that stage and subsequent ones, the easiest way is to use buildall.sh. https://github.com/wch/r-debug/blob/6d0dc7be599da6bc9ba5a7e7265dcc14a36117e3/buildall.sh

RDcsan is a shell script where ulimit is set at the top, but RDscriptcsan is a binary, so I don't know how one would set the ulimit values for it, other than running ulimit from the command line. Maybe in .bashrc?

I don't really know what a good value is. You could try doubling it -- 128MB doesn't seem like a crazy amount of memory for this.

@eddelbuettel
Copy link

eddelbuettel commented Jun 29, 2020

(I never rebuild 3.5gb images locally ;-) ) I remain a big fan of RHub Docker Hub for such builds...

But I'll keep that mind. Maybe if I'm bored. But you're building these nightly on a cron, no? Should we ... not just up the value?

Agreed re ulimit for the binary too...

(Edited: Replaced thinko RHub with Docker Hub)

@jeroen
Copy link
Contributor Author

jeroen commented Jun 29, 2020

Interestingly, I have been debugging mysterious stack limit problems within V8 on Fedora 32. I suspect something may have changed in recent versions of the linux kernel that causes us to hit stack limits where we didn't before.

@wch
Copy link
Owner

wch commented Jun 30, 2020

@eddelbuettel I just doubled the stack size and and kicked off a rebuild.

@jeroen Are you using Docker? Because if so, it will use the same kernel as the host OS.

@eddelbuettel
Copy link

Will give that a spin later.

[ BTW Sent you and Joe email on another [CRAN-related] matter yesterday. Any chance you can follow-up? ]

@eddelbuettel
Copy link

eddelbuettel commented Jun 30, 2020

@wch Looks like the doubled stack allotment did the trick! And better still I seem to have squashed the bug causing the ASAN error. So big Thank You! for the updated container!

krlmlr pushed a commit to cynkra/r-debug that referenced this pull request Jun 3, 2023
The following changes ensure that UBSAN will print full stacktraces on
failure.

Before:

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /usr/local/RDcsan/lib/R/site-library/Rcpp/include/Rcpp/routines.h:223:12 in
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/shared_ptr_base.h:745:15: runtime error: member call on address 0x60c00003fdc0 which does not point to an object of type 'std::_Sp_counted_base<__gnu_cxx::_S_atomic>'
0x60c00003fdc0: note: object is of type 'std::_Sp_counted_ptr_inplace<arrow::ArrayData, std::allocator<arrow::ArrayData>, (__gnu_cxx::_Lock_policy)2>'
 b3 00 80 7d  d8 1c 9c e3 a4 7f 00 00  01 00 00 00 01 00 00 00  d0 b2 04 00 60 60 00 00  c0 b2 04 00

After:

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /usr/local/RDcsan/lib/R/site-library/Rcpp/include/Rcpp/routines.h:223:12 in
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/shared_ptr_base.h:745:15: runtime error: member call on address 0x60c000060100 which does not point to an object of type 'std::_Sp_counted_base<__gnu_cxx::_S_atomic>'
0x60c000060100: note: object is of type 'std::_Sp_counted_ptr_inplace<arrow::ArrayData, std::allocator<arrow::ArrayData>, (__gnu_cxx::_Lock_policy)2>'
 96 00 00 4a  d8 ac bb 7a 89 7f 00 00  01 00 00 00 01 00 00 00  50 b4 04 00 60 60 00 00  40 b4 04 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'std::_Sp_counted_ptr_inplace<arrow::ArrayData, std::allocator<arrow::ArrayData>, (__gnu_cxx::_Lock_policy)2>'
    #0 0x7f897b1ac15e in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::operator=(std::__shared_count<(__gnu_cxx::_Lock_policy)2> const&) /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/shared_ptr_base.h:745:15
    #1 0x7f897b23b793 in std::__shared_ptr<arrow::ArrayData, (__gnu_cxx::_Lock_policy)2>::operator=(std::__shared_ptr<arrow::ArrayData, (__gnu_cxx::_Lock_policy)2> const&) /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/shared_ptr_base.h:1166:69
    #2 0x7f897b23b5a1 in std::shared_ptr<arrow::ArrayData>::operator=(std::shared_ptr<arrow::ArrayData> const&) /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/shared_ptr.h:309:65
    wch#3 0x7f897b23b237 in arrow::Array::SetData(std::shared_ptr<arrow::ArrayData> const&) /usr/include/arrow/array.h:359:11
    wch#4 0x7f897b23a363 in arrow::PrimitiveArray::SetData(std::shared_ptr<arrow::ArrayData> const&) /usr/include/arrow/array.h:422:18
    wch#5 0x7f897b239df7 in arrow::PrimitiveArray::PrimitiveArray(std::shared_ptr<arrow::ArrayData> const&) /usr/include/arrow/array.h:427:5
    wch#6 0x7f897b239c2f in arrow::NumericArray<arrow::Int32Type>::NumericArray(std::shared_ptr<arrow::ArrayData> const&) /usr/include/arrow/array.h:440:67
    wch#7 0x7f897b239b4f in void __gnu_cxx::new_allocator<arrow::NumericArray<arrow::Int32Type> >::construct<arrow::NumericArray<arrow::Int32Type>, std::shared_ptr<arrow::ArrayData>&>(arrow::NumericArray<arrow::Int32Type>*, std::shared_ptr<arrow::ArrayData>&) /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ext/new_allocator.h:136:23
    wch#8 0x7f897b2390a6 in void std::allocator_traits<std::allocator<arrow::NumericArray<arrow::Int32Type> > >::construct<arrow::NumericArray<arrow::Int32Type>, std::shared_ptr<arrow::ArrayData>&>(std::allocator<arrow::NumericArray<arrow::Int32Type> >&, arrow::NumericArray<arrow::Int32Type>*, std::shared_ptr<arrow::ArrayData>&) /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/alloc_traits.h:475:8
    wch#9 0x7f897b2387e4 in std::_Sp_counted_ptr_inplace<arrow::NumericArray<arrow::Int32Type>, std::allocator<arrow::NumericArray<arrow::Int32Type> >, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<std::shared_ptr<arrow::ArrayData>&>(std::allocator<arrow::NumericArray<arrow::Int32Type> >, std::shared_ptr<arrow::ArrayData>&) /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/shared_ptr_base.h:545:4
    wch#10 0x7f897b237e8b in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<arrow::NumericArray<arrow::Int32Type>, std::allocator<arrow::NumericArray<arrow::Int32Type> >, std::shared_ptr<arrow::ArrayData>&>(arrow::NumericArray<arrow::Int32Type>*&, std::_Sp_alloc_shared_tag<std::allocator<arrow::NumericArray<arrow::Int32Type> > >, std::shared_ptr<arrow::ArrayData>&) /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/shared_ptr_base.h:678:6
    wch#11 0x7f897b237a34 in std::__shared_ptr<arrow::NumericArray<arrow::Int32Type>, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<arrow::NumericArray<arrow::Int32Type> >, std::shared_ptr<arrow::ArrayData>&>(std::_Sp_alloc_shared_tag<std::allocator<arrow::NumericArray<arrow::Int32Type> > >, std::shared_ptr<arrow::ArrayData>&) /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/shared_ptr_base.h:1342:14
    wch#12 0x7f897b23772a in std::shared_ptr<arrow::NumericArray<arrow::Int32Type> >::shared_ptr<std::allocator<arrow::NumericArray<arrow::Int32Type> >, std::shared_ptr<arrow::ArrayData>&>(std::_Sp_alloc_shared_tag<std::allocator<arrow::NumericArray<arrow::Int32Type> > >, std::shared_ptr<arrow::ArrayData>&) /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/shared_ptr.h:359:4
    wch#13 0x7f897b23733e in std::shared_ptr<arrow::NumericArray<arrow::Int32Type> > std::allocate_shared<arrow::NumericArray<arrow::Int32Type>, std::allocator<arrow::NumericArray<arrow::Int32Type> >, std::shared_ptr<arrow::ArrayData>&>(std::allocator<arrow::NumericArray<arrow::Int32Type> > const&, std::shared_ptr<arrow::ArrayData>&) /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/shared_ptr.h:705:14
    wch#14 0x7f897b230674 in std::shared_ptr<arrow::NumericArray<arrow::Int32Type> > std::make_shared<arrow::NumericArray<arrow::Int32Type>, std::shared_ptr<arrow::ArrayData>&>(std::shared_ptr<arrow::ArrayData>&) /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/shared_ptr.h:721:14
    wch#15 0x7f897b1ca924 in std::shared_ptr<arrow::Array> arrow::r::MakeSimpleArray<13, arrow::Int32Type>(SEXPREC*) /tmp/RtmpY3I3AL/R.INSTALL1e366ad6e15d/arrow/src/array_from_vector.cpp:913:10
    wch#16 0x7f897b1b5885 in arrow::r::Array__from_vector_reuse_memory(SEXPREC*) /tmp/RtmpY3I3AL/R.INSTALL1e366ad6e15d/arrow/src/array_from_vector.cpp:919:14
    wch#17 0x7f897b1b095c in arrow::r::Array__from_vector(SEXPREC*, std::shared_ptr<arrow::DataType> const&, bool) /tmp/RtmpY3I3AL/R.INSTALL1e366ad6e15d/arrow/src/array_from_vector.cpp:983:12
    wch#18 0x7f897b1b7024 in Array__from_vector(SEXPREC*, SEXPREC*) /tmp/RtmpY3I3AL/R.INSTALL1e366ad6e15d/arrow/src/array_from_vector.cpp:1047:10
    wch#19 0x7f897b2894fa in _arrow_Array__from_vector /tmp/RtmpY3I3AL/R.INSTALL1e366ad6e15d/arrow/src/arrowExports.cpp:481:20
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

Successfully merging this pull request may close these issues.

3 participants