Opened 16 months ago

Last modified 7 weeks ago

#9342 assigned bug

grep crashing while TextSearching

Reported by: humdinger Owned by: korli
Priority: normal Milestone: R1
Component: Applications/Command Line Tools Version: R1/Development
Keywords: grep, TextSearch Cc:
Blocked By: Blocking: #9372, #9527
Has a Patch: no Platform: All

Description

This is hrev 45105.

I'm using the TextSearch add-on on the Haiku source folder haiku/src/bin/. It runs and runs and occasionally grep crashes (maybe 4 or 5 times while running the search). This should be the relevant part of Debugger's report, attached is the full output:

	grep (main), id: 23431, state: Exception (Segment violation)
		Frame		IP			Function Name
		-----------------------------------------------
		0x7ffee2ac	0xffff0238	commpage_memset + 0x40
[...]
		0x7ffeebc4	0x212411	mbtolower + 0x2fd
		0x7ffeec74	0x205887	EGexecute + 0x4f
		0x7ffeeca4	0x2075ea	do_execute + 0xb2
		0x7ffeecf4	0x20770e	grepbuf + 0x106
		0x7ffeed44	0x20795e	grep + 0x1ea
		0x7ffeedd4	0x2080df	grepdesc + 0x263
		0x7ffeee04	0x207e6c	grepfile + 0x84
		0x7ffeee34	0x2082b1	grep_command_line_arg + 0x61
		0x7ffeef74	0x2099ce	main + 0x103e
		0x7ffeef9c	0x205142	_start + 0x56
		0x7ffeefdc	0x10627e	runtime_loader + 0x126
		00000000	0x7ffeefec	?

Attachments (3)

grep-23431-debug-30-12-2012-17-06-46.txt (20.2 KB) - added by humdinger 16 months ago.
full Debugger report
grep-crash.png (93.9 KB) - added by scottmc 14 months ago.
grep version 2.6.1 fails when using -i command line option, but dialog shows 2.10
grep-crash.2.png (93.9 KB) - added by scottmc 14 months ago.
grep version 2.6.1 fails when using -i command line option, but dialog shows 2.10

Download all attachments as: .zip

Change History (19)

Changed 16 months ago by humdinger

full Debugger report

comment:1 Changed 16 months ago by humdinger

Ah. Seems to be some encoding problem. It's reproducible with e.g. "haiku/src/add-ons/input_server/methods/canna/canna/jrkanji.h" which apparently includes kanji characters.

comment:2 Changed 16 months ago by anevilyak

  • Owner changed from nobody to korli
  • Status changed from new to assigned

comment:3 Changed 16 months ago by mmadia

Some more test files, if useful:

Reproducible here on hrev45107 with the same/similar crash in mbtolower + 0x2fd

comment:4 Changed 15 months ago by anevilyak

  • Blocking 9372 added

comment:5 Changed 15 months ago by korli

grep packages should probably be rebuilt, since I'm now unsure they were built on a sufficiently newer Haiku to be compatible.

comment:6 Changed 15 months ago by scottmc

I have added a TEST section to the grep bep on haikuports, which can be run by using the --test option with haikuporter. grep is failing one test out of 56, with 6 tests skipped. I haven't yet run the 6 skipped test but one or more of those might also fail.

comment:7 follow-up: Changed 14 months ago by scottmc

I've added several bep files for several versions of grep to haikuports. The --test haikuporter option will allow running of the grep test suite.
http://ports.haiku-files.org/changeset/2272

Running grep with the -i command line option results in crashes to the debugger in versions 2.6.1 and newer but not with 2.5.4 and older.

Strange thing is that even when grep 2.6.1 fails, the debug crash dialog shows that grep 2.10 failed.
See attached screenshot.

Changed 14 months ago by scottmc

grep version 2.6.1 fails when using -i command line option, but dialog shows 2.10

Changed 14 months ago by scottmc

grep version 2.6.1 fails when using -i command line option, but dialog shows 2.10

comment:8 in reply to: ↑ 7 Changed 14 months ago by scottmc

Strange thing is that even when grep 2.6.1 fails, the debug crash dialog shows that grep 2.10 failed.
See attached screenshot.

The grep-2.10 turned out to just be one of the directories it was searching... so that's not an issue. But the -i issue seems to be due to something that changed in grep from 2.5.4 and 2.6.1.

comment:9 Changed 13 months ago by diver

  • Blocking 9527 added

comment:10 follow-up: Changed 13 months ago by bartolomiew

Sorry for duplicate with #9527
I've recompiled grep with haikuporter -i grep-2.6.1 on a gcc4only build of haiku hrev45343 and the crash with -i option is gone for me.

comment:11 in reply to: ↑ 10 Changed 13 months ago by scottmc

Replying to bartolomiew:

Sorry for duplicate with #9527
I've recompiled grep with haikuporter -i grep-2.6.1 on a gcc4only build of haiku hrev45343 and the crash with -i option is gone for me.

Try running haikuporter --test grep-2.6.1 and see if all of the tests are passing for you.

comment:12 Changed 13 months ago by bartolomiew

I've removed PASS results

haikuporter --test grep-2.6.1 results :

SKIP: fmbtest.sh
SKIP: pcre-z
======================
All 28 tests passed
(2 tests were not run)
======================

haikuporter --test grep-2.14 results :

big-hole: skipped test: expensive: disabled by default
SKIP: big-hole
big-match: skipped test: expensive: disabled by default
SKIP: big-match
XFAIL: equiv-classes
fmbtest: skipped test: this system lacks the cs_CZ.UTF-8 locale
SKIP: fmbtest
XFAIL: grep-dir
FAIL: in-eq-out-infloop
pcre: skipped test: no PCRE support
SKIP: pcre
pcre-abort: skipped test: no PCRE support
SKIP: pcre-abort
pcre-z: skipped test: no PCRE support
SKIP: pcre-z
XFAIL: word-delim-multibyte
======================
Testsuite summary for GNU grep 2.14
======================
# TOTAL: 58
# PASS: 48
# SKIP: 6
# XFAIL: 3
# FAIL: 1
# XPASS: 0
# ERROR: 0
============================================================================

Last edited 13 months ago by bartolomiew (previous) (diff)

comment:13 Changed 13 months ago by bartolomiew

haikuporter --test grep-2.6.3 results :

SKIP: fmbtest
====================
All 33 tests passed
(1 test was not run)
====================

grep-2.6.1 pass tests & using -i
grep-2.6.3 pass tests & using -i
grep-2.7 failed to compile
grep-2.12 failed on some tests but pass using -i
grep-2.14 failed on some tests and sigsegv using -i

comment:14 Changed 13 months ago by bartolomiew

I've created a .bep for grep-2.13
grep-2.13 failed on some tests and sigsegv using -i

So sigsegv using -i is in 2.13 changes, I hope this help

comment:15 Changed 7 weeks ago by diver

Could it be related to hrev46965 by any chance?

comment:16 Changed 7 weeks ago by pulkomandy

Yes, it's very probably the same bug causing this. We could even work around it with a very similar patch/hack. But wouldn't it be better to fix the issue instead?

Note: See TracTickets for help on using tickets.