Opened 12 years ago

Closed 10 years ago

#9342 closed bug (fixed)

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
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 12 years ago.
full Debugger report
grep-crash.png (93.9 KB ) - added by scottmc 12 years 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 12 years 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 (21)

by humdinger, 12 years ago

full Debugger report

comment:1 by humdinger, 12 years ago

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 by anevilyak, 12 years ago

Owner: changed from nobody to korli
Status: newassigned

comment:3 by mmadia, 12 years ago

Some more test files, if useful:

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

comment:4 by anevilyak, 12 years ago

Blocking: 9372 added

comment:5 by korli, 12 years ago

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

comment:6 by scottmc, 12 years ago

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 by scottmc, 12 years ago

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.

by scottmc, 12 years ago

Attachment: grep-crash.png added

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

by scottmc, 12 years ago

Attachment: grep-crash.2.png added

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

in reply to:  7 comment:8 by scottmc, 12 years ago

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 by diver, 12 years ago

Blocking: 9527 added

comment:10 by bartolomiew, 12 years ago

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.

in reply to:  10 comment:11 by scottmc, 12 years ago

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 by bartolomiew, 12 years ago

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 12 years ago by bartolomiew (previous) (diff)

comment:13 by bartolomiew, 12 years ago

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 by bartolomiew, 12 years ago

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 by diver, 11 years ago

Could it be related to hrev46965 by any chance?

comment:16 by pulkomandy, 11 years ago

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?

comment:17 by diver, 11 years ago

grep 2.20 from haikuporter doesn't crash anymore. However, it looks like multibyte support is still enabled there.

comment:18 by pulkomandy, 10 years ago

Resolution: fixed
Status: assignedclosed

Fixed in hrev48332 by updating grep.

Note: See TracTickets for help on using tickets.