ggreer / the_silver_searcher

A code-searching tool similar to ack, but faster.
http://geoff.greer.fm/ag/
Apache License 2.0
26.08k stars 1.42k forks source link

ag silently exits without returning results, strace shows exception 80000001 #1279

Open anand-hariharan opened 5 years ago

anand-hariharan commented 5 years ago

Running ag in cygwin 2.11.1(0.329/5/3) on Windows 7

This command ag -w include --cpp in a source tree littered with C++ files generates no results. The equivalent grep command returns expected results.

Running ag with strace shows these following lines at the very end (i.e., just before the process is terminated):

--- Process 7816 thread 14200 created
--- Process 7816, exception 80000001 at 0000000077bec6b6
--- Process 7816 thread 3464 exited with status 0x80000001
--- Process 7816 thread 14112 exited with status 0x80000001
--- Process 7816 thread 5164 exited with status 0x80000001
--- Process 7816 thread 14108 exited with status 0x80000001
--- Process 7816 thread 13852 exited with status 0x80000001
--- Process 7816 thread 14200 exited with status 0x80000001
--- Process 7816 thread 9148 exited with status 0x80000001
--- Process 7816 exited with status 0x80000001

Running within gdb shows this:

[New Thread 13936.0x37f0]
[New Thread 13936.0x1234]
[New Thread 13936.0x360]
[New Thread 13936.0x11f8]
[New Thread 13936.0x30dc]
[Thread 13936.0x360 exited with code 0]
[New Thread 13936.0x34d0]
[New Thread 13936.0x3460]
[New Thread 13936.0x2f60]
[New Thread 13936.0x2510]
gdb: unknown target exception 0x80000001 at 0x77bec6b6

Thread 9 received signal ?, Unknown signal.
[Switching to Thread 13936.0x2510]
0x0000000077bec6b6 in ntdll!RtlFreeHeap ()
   from /cygdrive/c/Windows/SYSTEM32/ntdll.dll

If any other information is required, please let me know.

thank you much,

xperia64 commented 5 years ago

Are you running TrendMicro anti-virus or similar software? If so, try temporarily disabling it. There is a currently known issue with this behavior with TrendMicro and anything threaded in Cygwin.

anand-hariharan commented 5 years ago

Thank you @xperia64 for the feedback. Yes, I confirm disabling TrendMicro resolves the issue. However, despite adding the entire Cygwin installation to TrendMicro's exclusion list, it still causes ag to ( silently ) fail. I cannot disable TrendMicro during the workday.

Is there a fix expected for this known issue (either from Cygwin or ag or ...)?

xperia64 commented 5 years ago

This is out of the scope of ag.

TrendMicro seems to break Cygwin threading as a whole. I've compiled a basic c test of pthreads under Cygwin on a TrendMicro machine, and even that fails.

The specific TrendMicro component that my IT department disabled on my machine I believe was predictive machine learning or deep inspection; something named along those lines.