Bug 174736 - can't build emacs from srpm
can't build emacs from srpm
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: emacs (Show other bugs)
rawhide
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jens Petersen
:
Depends On:
Blocks: FC5Target
  Show dependency treegraph
 
Reported: 2005-12-01 15:16 EST by Jonathan Kamens
Modified: 2007-11-30 17:11 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-03-16 00:15:26 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
emacs-dump.strace.gz (57.75 KB, application/octet-stream)
2006-01-24 06:48 EST, Jens Petersen
no flags Details

  None (edit)
Description Jonathan Kamens 2005-12-01 15:16:34 EST
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.
Comment 1 Jens Petersen 2005-12-14 02:56:24 EST
So this is not related to bug 174730, right?
Comment 2 Jonathan Kamens 2005-12-14 11:07:48 EST
I do not believe these bugs are related.  I tried turning off -fstack-
protector, and that didn't fix this bug.
Comment 3 Jens Petersen 2005-12-20 02:18:53 EST
Ok, i386 presumably?
Comment 4 Jonathan Kamens 2005-12-20 13:42:54 EST
Yes, i386.
Comment 5 Jens Petersen 2006-01-24 03:09:51 EST
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
Comment 6 Jakub Jelinek 2006-01-24 05:09:52 EST
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?
Comment 7 Jens Petersen 2006-01-24 06:43:58 EST
Emacs isn't built with -fstack-protector anymore with 21.4-11, but that
doesn't help here.
Comment 8 Jens Petersen 2006-01-24 06:48:09 EST
Created attachment 123609 [details]
emacs-dump.strace.gz

Strace of temacs dumping.
Comment 9 Jens Petersen 2006-02-27 07:21:39 EST
In bug 182084 it was suggested (indirectly) to pass -R to setarch,
which disables address randomization.  Does that help with building on i386?
Comment 10 Jens Petersen 2006-02-27 08:47:15 EST
I added the -R option to setarch in 21.4-13: does it help?
Comment 11 Jens Petersen 2006-02-27 22:48:52 EST
According to the reporter in bug 182084, it fixes the build problem. :)
Comment 12 Jonathan Kamens 2006-03-03 14:36:22 EST
Doesn't seem to help.  Still segfaults on i386 with 21.4-13.
Comment 13 Sam Peterson 2006-03-05 22:24:36 EST
"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.
Comment 14 Sam Peterson 2006-03-05 23:23:15 EST
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.
Comment 15 Jonathan Kamens 2006-03-06 00:18:49 EST
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.
Comment 16 Sam Peterson 2006-03-06 00:44:08 EST
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.
Comment 17 Jens Petersen 2006-03-06 06:09:03 EST
Sam, this bug is about building Emacs under FC5 - I'm not aware of any
problems with rebuilding it on FC4.
Comment 18 Sam Peterson 2006-03-06 07:19:48 EST
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.
Comment 19 Jonathan Kamens 2006-03-06 08:24:24 EST
Yes, your suggestion worked for me.
Comment 20 Jens Petersen 2006-03-06 08:43:21 EST
Sam, sorry you're right - I finally tested on an i386 rawhide box and
"setarch i386 -R rpmbuild ..." works for me too. :)
Comment 21 Jens Petersen 2006-03-07 07:11:42 EST
Ok, I think it should be fixed in 21.4-14.
Comment 22 Jonathan Kamens 2006-03-16 00:15:26 EST
Yes, it appears to be.

Note You need to log in before you can comment on or make changes to this bug.