Compiling Pale Moon 28.12.0 on CentOS 6 results in broken binaries

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
GrandAdmiralThrawn

Compiling Pale Moon 28.12.0 on CentOS 6 results in broken binaries

Unread post by GrandAdmiralThrawn » 2020-08-19, 09:58

Hello,

As the title's saying, I'm trying to compile Pale Moon 28.12.0 on CentOS 6 Linux, as official packages are no longer being provided. I'm following [this guide] plus a few more things as I'm trying to produce stable binaries.

My configuration:
  • CentOS 6.10 x86_64
  • GCC 9.2.0, GCC 7.3.1 & 7.2.0 (tried all of them, 7.3.1 via scl, 7.2.0 as a 3-stage & 9.2.0 as a 1-stage bootstrapped build by myself, 9.2.0 might not be 100% trustworthy because of the 1-stage build)
  • yasm 1.3.0 & nasm 2.14.02
  • Python 2.6.6, 2.7.16, 3.4.5 & 3.6.9 (using 2.7.16)
  • xz 5.2.3
  • GNU autoconf 2.68 & 2.13 (using 2.13)
  • GNU make 3.81
  • GNU ld.bfd & ld.gold (tried both) from GNU binutils 2.35
  • Hardware: Intel X58 platform, Core i7 980X "Westmere" chip.
My problem is, that I tend to get "Bus error (core dumped)" for no discernible reason from time to time, so I'm getting SIGHUP from the system while browsing with the complete, packaged version of my build. This probably means something is going reaaally wrong. It's also not perfectly reproducible, but it happened with all different combinations of compilers & linkers I tried.

Pale Moon 28.2.2 from [this source] works in a completely stable fashion though, as does Firefox 68.9.0 ESR from CentOS packages. I guess I'm doing something wrong when building/linking, or some of my components shouldn't be used (anymore).

I'm building with official branding, only changes to .mozconfig are:

Code: Select all

mk_add_options PYTHON=/usr/local/bin/python2.7.16
mk_add_options AUTOCONF=/usr/bin/autoconf-2.13
When I was briefly trying GNU ld.bfd, there was also the line "ac_add_options --disable-gold" inside. The linker used doesn't seem to make any difference either though, so I reverted back to using ld.gold, the Pale Moon build system default.

Should I maybe use a very specific version of binutils (for GNU as, ld.gold, etc.)? Or a different version of GCC? Or something else?

Thank you!

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35478
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Compiling Pale Moon 28.12.0 on CentOS 6 results in broken binaries

Unread post by Moonchild » 2020-08-19, 10:07

On CentOS 6 you probably want to be using GCC 4.9 to build it, but other people more in tune with the Linux build process may have better advice for you :)
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

New Tobin Paradigm

Re: Compiling Pale Moon 28.12.0 on CentOS 6 results in broken binaries

Unread post by New Tobin Paradigm » 2020-08-19, 20:55

My advice is don't use CentOS 6, for anything. Wasted effort since it will be dead in a matter of months.

GrandAdmiralThrawn

Re: Compiling Pale Moon 28.12.0 on CentOS 6 results in broken binaries

Unread post by GrandAdmiralThrawn » 2020-08-20, 11:28

Thank you, but I'll probably have to keep using it for a while after official EoL. I would just like to use a newer build because I'm having trouble with a few websites using 28.2.2.

So there is no experience with Pale Moon getting SIGHUPs under Linux?

Moonchild, I have re-compiled with GCC 4.9.3 + binutils 2.35, and will conduct tests with the new build. Let's see whether it helps. ;)

User avatar
adesh
Board Warrior
Board Warrior
Posts: 1277
Joined: 2017-06-06, 07:38

Re: Compiling Pale Moon 28.12.0 on CentOS 6 results in broken binaries

Unread post by adesh » 2020-08-20, 12:59

Just to chime in, when I used CentOS 6 to build, I used gcc 4.9 as that was the only supported compiler for UXP at that time (about 2 years ago). I was able to produce stable binaries without issues. After a few months, I moved to CentOS 7 and started using gcc 7 which worked again without no issues. Although now I build infrequently on Linux.

New Tobin Paradigm

Re: Compiling Pale Moon 28.12.0 on CentOS 6 results in broken binaries

Unread post by New Tobin Paradigm » 2020-08-20, 13:10

I could give you the procedure of how to PROPERLY setup a centos 6 build env but it does rely on stuff that isn't easy to work out how to get anymore. I should see if I can recover those bits but I don't think I really WANT to relay those secrets anymore. It depends.

GrandAdmiralThrawn

Re: Compiling Pale Moon 28.12.0 on CentOS 6 results in broken binaries

Unread post by GrandAdmiralThrawn » 2020-08-21, 06:49

Why would it be a secret in the first place, if I may ask? Wouldn't it be better for all technical documentation to be open and free (for free software)?

In the meantime I tried my GCC 4.9.3 build, but unfortunately it's unstable as well. Only difference being that I'm no longer receiving SIGHUP signals, but SIGSEGV ones, so segmentation faults. I have not run strace/ltrace on it yet, though, so at this point I cannot provide any more detailed information. If strace/ltrace results would help, please let me know.

Also, I am not very proficient when it comes to debugging, so if I were instructed to use gdb, I would require pretty detailed instructions to get it done, as I am no developer myself.

Thank you very much!

User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 4942
Joined: 2015-12-09, 15:45
Contact:

Re: Compiling Pale Moon 28.12.0 on CentOS 6 results in broken binaries

Unread post by moonbat » 2020-08-21, 06:52

GrandAdmiralThrawn wrote:
2020-08-21, 06:49
Wouldn't it be better for all technical documentation to be open and free (for free software)?
It's not documentation, it's whatever Tobin figured out on his own.
GrandAdmiralThrawn wrote:
2020-08-21, 06:49
if I were instructed to use gdb, I would require pretty detailed instructions to get it done, as I am no developer myself.
You know that search engines exist, right?
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

GrandAdmiralThrawn

Re: Compiling Pale Moon 28.12.0 on CentOS 6 results in broken binaries

Unread post by GrandAdmiralThrawn » 2020-08-21, 13:26

Yes, I do of course know that, just like everybody else does. But I couldn't find any detailed information on how to debug Pale Moon with gdb under Linux, and the only time I was instructed to use gdb (for a different program), the instructions from the developer were very specific. I myself wasn't aware of what it really was that I was doing there with gdb, I just followed the instructions step-by-step. That's why I mentioned that.

As for your instructions and findings for CentOS 6, Tobin, I'd be grateful if you could share them, if it is not too much work for you.

Thanks!

User avatar
Lunokhod
Lunatic
Lunatic
Posts: 469
Joined: 2017-04-20, 21:25
Contact:

Re: Compiling Pale Moon 28.12.0 on CentOS 6 results in broken binaries

Unread post by Lunokhod » 2020-08-23, 14:24

Pssst! - Old .mozconfig I used a while ago to build with debug symbols, you can specify a particular compiler version with the commented out exports too if needed. Probably you'll get better advice from someone else but it might help a bit if you are using GDB ;)

mk_add_options AUTOCLOBBER=1
mk_add_options MOZ_OBJDIR=/home/$USER/pmbuild/
mk_add_options MOZ_MAKE_FLAGS="-j1"
ac_add_options --enable-application=palemoon
#ac_add_options --enable-optimize="-O2"
# Please see https://www.palemoon.org/redist.shtml for restrictions when using the official branding.
ac_add_options --enable-official-branding
export MOZILLA_OFFICIAL=1
#export CC=/usr/bin/gcc-5
#export CXX=/usr/bin/g++-5
#export HOST_CC=/usr/bin/gcc-5
#export HOST_CXX=/usr/bin/g++-5
ac_add_options --enable-default-toolkit=cairo-gtk2
ac_add_options --enable-jemalloc
# build with debug symbols, --enable-debug-symbols is default anyway according to FF site info
ac_add_options --disable-strip
ac_add_options --disable-install-strip
ac_add_options --enable-debug-symbols
#ac_add_options --enable-strip
ac_add_options --with-pthreads
ac_add_options --disable-tests
ac_add_options --disable-eme
ac_add_options --disable-parental-controls
ac_add_options --disable-accessibility
ac_add_options --disable-webrtc
ac_add_options --disable-gamepad
ac_add_options --disable-necko-wifi
ac_add_options --disable-updater
ac_add_options --x-libraries=/usr/lib
Wait, it's all Ohio? Always has been...

GrandAdmiralThrawn

Re: Compiling Pale Moon 28.12.0 on CentOS 6 results in broken binaries

Unread post by GrandAdmiralThrawn » 2020-08-26, 13:14

Thanks, I made a copy of that, just in case. :)

The Squash

Re: Compiling Pale Moon 28.12.0 on CentOS 6 results in broken binaries

Unread post by The Squash » 2020-09-03, 00:53

Allow me to chime in:

First off, bus errors are not associated with SIGHUP signals -- they are associated with SIGBUS signals. Check

Code: Select all

man 7 signal
if you don't believe me.

Second, start Pale Moon with the 'catchsegv' command (I know it's for catching segmentation faults, just try it), and when it crashes post the output of the catchsegv command and the last 10 lines of dmesg. To use catchsegv, run Pale Moon something like this:

Code: Select all

catchsegv palemoon
(Note: I'm not sure if CentOS even has this command. If it does not, or if catchsegv does not give you any output, then please try running Pale Moon under GDB -- all I want really is a function call backtrace, so we know where the problem occurred:

Code: Select all

gdb /usr/local/bin/palemoon [or wherever the Pale Moon binary is located]
[Blah blah blah, copyright 2012 FSF]
> run
> backtrace
> finish
> quit
)

Third, interesting note if you didn't already know: A SIGSEGV (segmentation fault, once called SEGmentation Violation) is when an invalid memory address is accessed; a SIGBUS is emitted by the kernel when a process attempts to misuse a valid memory address, for example attempts to write to a memory page which is read-only. I've seen bad sectors on storage media cause bus errors; segmentation faults are usually caused by null pointer dereferences or the like.

Locked