Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 312885

Summary: Open eclipse often appear NTVDM CPU has encountered an illegal instruction problem
Product: [Tools] CDT Reporter: Sheng Mising name <foretribe>
Component: cdt-buildAssignee: cdt-build-inbox <cdt-build-inbox>
Status: RESOLVED WORKSFORME QA Contact: Andrew Gvozdev <angvoz.dev>
Severity: major    
Priority: P3 CC: andrea.ranalli, dave.korn.cygwin
Version: 0 DD 1.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
screenShot of myPlugIn folder none

Description Sheng Mising name CLA 2010-05-14 06:23:38 EDT
Build Identifier: 20100506-2000

hi, 

I think the cdt 7.0 currently still have similar problem of cdt 6.0 about using cygwin 1.7.5 on platform windows xp. when I double click want to open the eclipse with CDT. There is always alarm that C:\eclipse\plugins\org.eclipse.cdt.core.win32_5.2.0.201005031211\os\win32\x86\starter.exe NTVDM CPU has encountered an illegal instruction ...

(Actually, I do not know exactly what they will said, because I using the Chinese language system of windows.the alarm is written by Chinese)

After I close this alarm several times, the compiling and linking of the code is ok. But when I want to change the setting of Preference, the alarm window show several times again. I highly suspected this is still the problem cause the symlink of program of the cygwin 1.7.


Reproducible: Always

Steps to Reproduce:
1. when I double click want to open the eclipse with CDT(already contain a cpp project in the space). There is always alarm that C:\eclipse\plugins\org.eclipse.cdt.core.win32_5.2.0.201005031211\os\win32\x86\starter.exe NTVDM CPU has encountered an illegal instruction ...
2.After I close this alarm several times, the compiling and linking of the code is ok. But when I want to change the setting of Preference, the alarm window show several times again. I highly suspected this is still the problem cause the symlink of program of the cygwin 1.7.
3.The new c++ project is also have the similar problem.
Comment 1 Andrew Gvozdev CLA 2010-05-26 13:19:59 EDT
Do you have Subversive plugin installed? See bug 309711.
Comment 2 Dave Korn CLA 2010-05-26 13:41:59 EDT
NTVDM errors are symptomatic of attempting to invoke a Cygwin symlink as if it were an exe, by calling CreateProcess on it.  In particular, "gcc.exe" is a symlink in recent versions of cygwin, allowing the user to redirect it to gcc-3.exe or gcc-4.exe which are the actual binaries.  You can see if this is happening by examining the opcodes reported in the NTVDM error popup: if they're obviously ASCII, that'll be what's happening.  For example:

---------------------------
16 bit MS-DOS Subsystem
---------------------------
C:\WINNT\system32\cmd.exe - gcc.exe
The NTVDM CPU has encountered an illegal instruction.
CS:07a0 IP:210f OP:63 69 66 69 65 Choose 'Close' to terminate the application.
---------------------------
Close   Ignore   
---------------------------

I notice that bug 309711, comment 7 points out that this is a CDT-only problem; could some part of the scanner or discovery stuff perhaps be attempting to invoke gcc?
Comment 3 Andrew Gvozdev CLA 2010-05-26 14:25:42 EDT
(In reply to comment #2)
Thanks for this comment. Looks like it is most likely CDT after all. In CDT 7.0 scanner discovery for Cygwin toolchain is invoked using Cygwin shell command [sh -c 'gcc -E -P -v -dD "${plugin_state_location}/specs.c"']. But a project created before that change or a different toolchain may not have that.

Sheng, could you doublecheck what you got in project properties in Discovery Options? Any related messages in .metadata/.log?
Comment 4 Andrea CLA 2010-12-01 09:56:27 EST
Dear all,
I've had this problem fo a while (I'll say years...) but after have readed this post I've found a solution that at least stop you showing the error window!
Go to the project's properties, then C/C++ Build, Discovery Options.
Here you can select "Profile Scope" equals to "Per language" and this error will disappear!!!
Comment 5 Andrew Gvozdev CLA 2010-12-01 11:25:23 EST
(In reply to comment #4)
> Dear all,
> I've had this problem fo a while (I'll say years...) but after have readed this
> post I've found a solution that at least stop you showing the error window!
> Go to the project's properties, then C/C++ Build, Discovery Options.
> Here you can select "Profile Scope" equals to "Per language" and this error will
> disappear!!!
Andrea, which version of CDT are you using? Could you try to test it one more time? Revert profile scope back and set Compiler invocation command to [sh] and arguments to [-c 'g++ -E -P -v -dD "${plugin_state_location}/specs.cpp"'], just be careful with quotes. Does it work ok with these settings?
Comment 6 Andrea CLA 2010-12-02 04:10:56 EST
Created attachment 184326 [details]
screenShot of myPlugIn folder
Comment 7 Andrea CLA 2010-12-02 04:12:01 EST
Hi Andrew,
I've tried using your suggestion [-c 'g++ -E -P -v -dD "${plugin_state_location}/specs.cpp"'] and now it works too!!!
In DiscoveryOptions I've selected "Configuration-Wide" as profile scope and then "GCC per file scanner info profile".

I'm using EclipsePulsar and originally the issue was generated into this plugin: org.eclipse.cdt.core.win32_5.1.0.201002161416, so I guess my CDT release is the 5.1.

Since I'm not sure I've added a jpg showing the content of my plugin folder, this could help!

Thanks again,

Andrea
Comment 8 Andrew Gvozdev CLA 2010-12-02 08:06:12 EST
Then the problem was resolved in CDT 7.0 and 6.0.1 with bug 218444 as it is now a default setting for Cygwin toolchain.
Comment 9 Andrea CLA 2010-12-03 03:23:19 EST
Andrew,
I'm sorry to let you know that the issue is still present! :-(
When I've tried your setting yesterday I hadn't any problem BECAUSE I hadn't modified any file, and thus the final executable file was already generated (so I think in the compilation process Eclipse skipped some part that cause this issue).
This morning I've edit a file, then I've received the same error when compiling! :-(

By the way, using the "per language" setting doesn't cause this problem, so for the moment I've moved back to previous configuration that avoid such warning.

Best regards,

Andrea