Segmentation fault

14 views
Skip to first unread message

Anton Daneyko

unread,
Nov 24, 2011, 11:55:00 AM11/24/11
to ack dev/users
I am getting a segfault, with a particular search. Does that interest
anyone of maintainers? I could then provide more details or core file.

I am running this on a Power 6 system with IBM AIX as an OS and Perl
5.8.8.

Andy Lester

unread,
Nov 24, 2011, 11:56:03 AM11/24/11
to ack-...@googlegroups.com

On Nov 24, 2011, at 10:55 AM, Anton Daneyko wrote:

I am running this on a Power 6 system with IBM AIX as an OS and Perl
5.8.8.

Yes, please.  


Thanks,
xoxo,
Andy


Anton Daneyko

unread,
Nov 24, 2011, 1:04:51 PM11/24/11
to ack-...@googlegroups.com
I boiled it down to one file in a directory. The file is a 260 Mb binary data file, which happens to reside next to some of my C++ source files. The produced core file is of the size close to the binary data file. If you're still interested I could upload the files somewhere or give you a C++ program that generates this file. When I run ack in the same directory, but from a Linux ppc64 (Perl 5.8.8) machine I do not get any problems.

--
You received this message because you are subscribed to the Google Groups "ack dev/users" group.
To post to this group, send email to ack-...@googlegroups.com.
To unsubscribe from this group, send email to ack-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ack-users?hl=en.

Andy Lester

unread,
Nov 24, 2011, 1:28:02 PM11/24/11
to ack-...@googlegroups.com
If it is a binary file,

Andy Lester

unread,
Nov 24, 2011, 1:28:37 PM11/24/11
to ack-...@googlegroups.com
If it is a binary file, then why are you using ack to search it?

Anton Daneyko

unread,
Nov 24, 2011, 1:33:25 PM11/24/11
to ack-...@googlegroups.com
I tried it on a branch of directories with C++ sources and that file is a part of the test cases, and it resides in the same branch.

If I do a search in the root directory -- I stumble upon this file anyway.

Andy Lester

unread,
Nov 24, 2011, 1:40:09 PM11/24/11
to ack-...@googlegroups.com
Are you saying ack with a *? Don't do that. No need to specify filenames.

Anton Daneyko

unread,
Nov 24, 2011, 1:49:34 PM11/24/11
to ack-...@googlegroups.com
I do not use *, I do:
$ ack MyCppFunction
and that's it. Is that ok, that I am writing so much?

Andy Lester

unread,
Nov 24, 2011, 2:01:33 PM11/24/11
to ack-...@googlegroups.com
That should be fine. Are you using the -a flag? What is the file called? I don't know why ack is even looking at it.

Andy Lester

unread,
Nov 24, 2011, 2:02:29 PM11/24/11
to ack-...@googlegroups.com
What is the file called? I don't know why ack is even looking at it. Do you use the -a flag?

Anton Daneyko

unread,
Nov 24, 2011, 2:48:18 PM11/24/11
to ack-...@googlegroups.com
No I do not use any flags it's just ack my_pattern.
The binary data file is named doubles.tmp. Is that the .tmp extension that is causing the problem?

Bill Ricker

unread,
Nov 24, 2011, 3:36:51 PM11/24/11
to ack-...@googlegroups.com
i wonder if the big binary file has accidental false positive on
hashbang. otherwise it shouldn't read more than first block.

i have aix on power 5 and 7 at work if there are tests to be done.


--
Bill
@n1vux bill....@gmail.com

Anton Daneyko

unread,
Nov 25, 2011, 4:47:03 AM11/25/11
to ack-...@googlegroups.com
The binary file is built like that:

#include <fstream>
int main()
{
      double floats[] = { 3.1415, 2.84, 2.9};

       std::ofstream floats_file("doubles.tmp");
       for (int i = 0; i < 22369622; ++i)
       {
           floats_file.write(reinterpret_cast<const char *>(&floats),
                             sizeof(floats));
       }
}

I tried reducing the size of the file and then ack works fine.

Bill Ricker

unread,
Nov 25, 2011, 4:35:40 PM11/25/11
to ack-...@googlegroups.com, William Ricker (office)
On Fri, Nov 25, 2011 at 4:47 AM, Anton Daneyko <se...@mezhaka.com> wrote:
The binary file is built like that:

I'll try that on AIX when I get back to the office. I'm wondering what the 'magic number' is. That might explain its getting read when not -a not * and not a recognized filetype (unless .tmp in in ackrc) .


--
Bill
@n1vux bill....@gmail.com

Andy Lester

unread,
Nov 29, 2011, 1:36:14 PM11/29/11
to Ricker, William, Bill Ricker, Anton Daneyko, ack-...@googlegroups.com

On Nov 29, 2011, at 12:32 PM, Ricker, William wrote:

*  I can reproduce the dump on a big file,


My guess is that it's trying to read the first line of the file, and in the absence of any actual "\n" in the big binary file, it slurps up the whole thing and then goes scanning.  Shouldn't segfault, but it isn't good, either.

xoa
Reply all
Reply to author
Forward
0 new messages