I get this trying to build emacs from source RPM with gcc-4.0.2-6 and kernel- smp-2.6.14-1.1719_FC5: Dumping under names emacs and emacs-21.4.1 ************************************************** Warning: Your system has a gap between BSS and the heap (25018972 byte). This usually means that exec-shield or something similar is in effect. The dump may fail because of this. See the section about exec-shield in etc/PROBLEMS for more information. ************************************************** Segmentation fault (core dumped) I tried both turning off exec-shield and doing setarch x86 as suggested in etc/PROBLEMS, and the problem persists.
So this is not related to bug 174730, right?
I do not believe these bugs are related. I tried turning off -fstack- protector, and that didn't fix this bug.
Ok, i386 presumably?
Yes, i386.
Hmm, finally got a chance to look at this. Turning off exec-shield doesn't help anyway, nor "setarch i386". The segfault is happening during dumping again: : LC_ALL=C ./temacs -batch -l loadup dump Loading loadup (source)... Using load-path (/home/petersen/emacs-21.4/lisp) Loading byte-run... Loading subr... Loading version.el (source)... Loading widget... Loading custom... : : Loading float-sup... ((50723 . 16252) (8262 . 0) (510 . 57) 71542 134842 (14 . 9) (21 . 0) (7070 . 14 98)) Loading vc-hooks... Loading ediff-hook... ((51666 . 15309) (8352 . 0) (511 . 56) 72439 134859 (14 . 9) (21 . 0) (7129 . 14 39)) Finding pointers to doc strings... Finding pointers to doc strings...done Wrote /home/petersen/emacs-21.4/lib-src/fns-21.4.1.el Dumping under names emacs and emacs-21.4.1 ************************************************** Warning: Your system has a gap between BSS and the heap (15422940 byte). This usually means that exec-shield or something similar is in effect. The dump may fail because of this. See the section about exec-shield in etc/PROBLEMS for more information. ************************************************** make[1]: *** [emacs] Segmentation fault make[1]: *** Deleting file `emacs' make[1]: Leaving directory `/home/petersen/emacs-21.4/src' make: *** [src] Error 2
Is emacs built with -fstack-protector (by default in $RPM_OPT_FLAGS) or not? That could be one of the reasons, I guess that's incompatible with emacs crappy dumping. But, the above warning suggests there could be something related to VM layout too, can you provide strace dump?
Emacs isn't built with -fstack-protector anymore with 21.4-11, but that doesn't help here.
Created attachment 123609 [details] emacs-dump.strace.gz Strace of temacs dumping.
In bug 182084 it was suggested (indirectly) to pass -R to setarch, which disables address randomization. Does that help with building on i386?
I added the -R option to setarch in 21.4-13: does it help?
According to the reporter in bug 182084, it fixes the build problem. :)
Doesn't seem to help. Still segfaults on i386 with 21.4-13.
"Doesn't seem to help. Still segfaults on i386 with 21.4-13." Hmm, weird, it seemed to work for me (the package built anyway). I unfortunately do not have an FC5 system up and running that I can test on. I admittedly tried other things including disabling exec shield system wide, however, The build worked upon a reboot, so I figured that wasn't the problem. I will try again tonight an my FC4 system just to make sure the "-R" wasn't some kind of fluke.
Okay, from a couple of test builds I have come to the conclusion that the "-R" is needed, but not in the RPM spec file. Instead, I used the following command to build the rpm: setarch i386 -R rpmbuild --rebuild --nodeps emacs-21.4-13.src.rpm I even removed the "-R" commands from the setarch commands in the spec file and tested with that, and it still built okay. My apologies for barking up the wrong tree, but it looks like I wasn't completely off track, just confused. Unfortunately, this looks like something the RPM can't fix, you'll just have to make sure you build the package with the "setarch i386 -R" command. The "-R" is necessary, I tried just "setarch i386" and that didn't work. If you people want to try that and let me know if that works for you. It worked for me. I don't know why it works that way, and doesn't work in the spec file. It could be the SETARCH environment variable isn't being put in the right place on the command line. The reason I built with --nodeps is that apparently there are build dependencies on libXaw-devel and libX11-devel packages, both of which I don't seem to have. The package built fine without either however. I do have packages named Xaw3d-devel and xorg-x11-devel. Not sure if this is a problem with the package build dependencies or if third party repositories have muddled-up my package names.
This really needs to be fixed inside the rpm spec file, not outside of it. I can't imagine any reason why this wouldn't be possible if done properly.
So uh, I take it that it worked for you then? I can't imagine why it couldn't be fixed in the rpm either, but I'm kind of at a loss on tracking it down. I'm just another user like yourself :). Maybe Jens has some insights.
Sam, this bug is about building Emacs under FC5 - I'm not aware of any problems with rebuilding it on FC4.
The nature of the problem seems very similar though. I'd be curious about what would specific to FC5 that would cause it. The segfaults during the dump and the error message right before the dump were exactly what I was seeing on FC4. Jonathan hasn't said whether or not he's tried build the rpm with my suggestion yet.
Yes, your suggestion worked for me.
Sam, sorry you're right - I finally tested on an i386 rawhide box and "setarch i386 -R rpmbuild ..." works for me too. :)
Ok, I think it should be fixed in 21.4-14.
Yes, it appears to be.