GNU bug report logs -
#16662
Libtool execute mode is DOSing my system
Previous Next
Reported by: Nick Bowler <nbowler <at> draconx.ca>
Date: Thu, 6 Feb 2014 02:08:02 UTC
Severity: normal
Done: Peter Rosin <peda <at> lysator.liu.se>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 16662 in the body.
You can then email your comments to 16662 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-libtool <at> gnu.org
:
bug#16662
; Package
libtool
.
(Thu, 06 Feb 2014 02:08:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Nick Bowler <nbowler <at> draconx.ca>
:
New bug report received and forwarded. Copy sent to
bug-libtool <at> gnu.org
.
(Thu, 06 Feb 2014 02:08:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Hi,
I was surprised to discover that in one of my test cases, running the
program via libtool --mode=execute is consuming huge amounts of memory,
apparently because of a runaway sed program it runs on my program's
input files. This is a problem because these input files are not plain
text files, are several gigabytes in size and GNU sed balloons out to
consume all available memory.
It does eventually complete and the test passes, but not before spending
several minutes pushing the entirety of system memory out to disk.
This can be easily reproduced by running something like the following:
% truncate -s 16G /tmp/bigfile
% libtool --mode=execute /usr/bin/wc -c /tmp/bigfile
Running sh -x libtool, we see...
[...]
+ for file in '"$@"'
+ case $file in
+ func_ltwrapper_script_p /tmp/bigfile
+ func_lalib_p /tmp/bigfile
+ test -f /tmp/bigfile
+ /bin/grep '^# Generated by .*libtool'
+ /bin/sed -e 4q /tmp/bigfile
[thrashing begins here]
and sure enough, running just that sed command by itself exhibits the
same behaviour.
I guess I can see why libtool's execute mode has to search to see
which input files are libtool wrapper scripts, but that sed program
is obviously a poor choice for large binary files.
Frustratingly, putting "--" before the input files does not appear to
affect the behaviour of libtool at all in this matter.
So it would be nice if libtool didn't consume all available memory
before it even starts running my program :)
For reference, I'm running:
libtool 2.4.2
GNU sed 4.2.1
Cheers,
Nick
Information forwarded
to
bug-libtool <at> gnu.org
:
bug#16662
; Package
libtool
.
(Thu, 06 Feb 2014 07:32:01 GMT)
Full text and
rfc822 format available.
Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):
On 2014-02-06 03:06, Nick Bowler wrote:
> Hi,
>
> I was surprised to discover that in one of my test cases, running the
> program via libtool --mode=execute is consuming huge amounts of memory,
> apparently because of a runaway sed program it runs on my program's
> input files. This is a problem because these input files are not plain
> text files, are several gigabytes in size and GNU sed balloons out to
> consume all available memory.
Dup of bug#13472, please see
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13472
Cheers,
Peter
Information forwarded
to
bug-libtool <at> gnu.org
:
bug#16662
; Package
libtool
.
(Tue, 06 May 2014 07:45:03 GMT)
Full text and
rfc822 format available.
Message #11 received at 16662 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
close 13472
close 16662
stop
On 2014-02-14 17:43, Nick Bowler wrote:
> On 2/13/14, Peter Rosin <peda <at> lysator.liu.se> wrote:
>> On 2014-02-13 18:57, Peter Rosin wrote:
>>> Ok, everybody seems happy. But not me, not 100% anyway. This introduces
>>> an extra fork, and AFAICT, the "extra protection" is only needed when
>>> func_lalib_p is called from func_ltwrapper_script_p. Should we perhaps
>>> have a separate implementation in func_ltwrapper_script_p instead of
>>> simply calling func_lalib_p?
>>>
>>> Maybe we could also lose the "sed -e 4q" part when dd limits the size?
>>
>> *snip* outline, real patch attached instead...
>>
>> Now, which patch should I push?
>
> The new looks a bit nicer to me although I have not tested it.
>
> One comment I have that applies to both patches... you should probably
> be using AC_CHECK_PROGS instead of AC_PATH_PROG because the latter
> requires an absolute filename.
>
> Specifically, AC_PATH_PROG will ignore any user-set value for DD if
> it's not absolute.
Ok, I'm reviving this old thing once again. There were two minor complaints
with the last patch, this patch addresses both. I.e.
1. DD=dd now works to override the dd check, you don't need to specify
a full path.
2. The code duplication between func_lalib_p and func_ltwrapper_script_p
has been factored out.
However, to address the first point, I made use of the
AC_PATH_PROGS_FEATURE_CHECK macro, which was added in Autoconf 2.62, which
Libtool didn't require before. But 2.62 is 6 years old by now. If anyone
has problems with that, we will have to fix it later as I'm now pushing
this thing. It's been brewing for far too long already...
Final version attached.
Cheers,
Peter
[0001-libtool-speed-up-ltwrapper_script-detection-in-execu.patch (text/x-patch, attachment)]
bug closed, send any further explanations to
16662 <at> debbugs.gnu.org and Nick Bowler <nbowler <at> draconx.ca>
Request was from
Peter Rosin <peda <at> lysator.liu.se>
to
control <at> debbugs.gnu.org
.
(Tue, 06 May 2014 07:45:06 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Tue, 03 Jun 2014 11:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 11 years and 71 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.