NO

Author Topic: Fatal Error: Access Violation (Debugging 32-bit Console Apps)  (Read 11471 times)

inisheer

  • Guest
Fatal Error: Access Violation (Debugging 32-bit Console Apps)
« on: December 15, 2012, 07:09:33 AM »
Details:
OS: Windows 8 64bit
Pelles C Version: 7(r) Fresh Install

I can't seem how to get debugging working in Pelles C for 32-bit applications. Seems to work fine for 64-bit. I've changed every type of folder permission I can think of to get it working. Note that this only applies to Win32 Console based applications. Dialog based apps debug fine. Below are my steps to reproduce with first project of brand new install.

1. Start "poide64.exe"
2. Authorize UAC
3. New Win32 Console Program
4. Add win_main.c file with main method plus a simple printf("Test");
5. Go to Project->Project Options->Compiler Tab->Set "Debug Information" to "Full"
6. Go to Linker Tab->Set "Debug Information" to "CodeView Format" (tried all options)
7. Build / Compile
8. Press "Run" and get the results you would expect.
8. Press Debug.. and the following happens (which I have to close the IDE via the Task Manager because there are endless "Access Denied" messageboxes displayed):





As a side note, I've also tried to install the debugging addin posted in the addin forum. However, when placing the .dll in the correct addin folder and starting Pessel C IDE, the option for the addin is not visible in both places described in the forum thread.

Thanks for your help!! I really want to replace Microsoft VS for my C projects.
 
« Last Edit: December 15, 2012, 04:50:52 PM by inisheer »

CommonTater

  • Guest
Re: Fatal Error: Access Violation (Debugging 32-bit Console Apps)
« Reply #1 on: December 15, 2012, 07:57:10 PM »
Ok... the correct debug settings for 32 bit projects are:

Compiler : full
Linker : codeview and coff

From there you should be able to simply click the "Go Debug" button on the toolbar and you're off to the races.  (Note that you cannot debug a program that will not compile)

For the UAC issue... you should be running POIDE as an administrator... Locate the POIDE file in your Program Files folder, right click then under compatibility select "Run as Administrator" ... that should solve that problem for you.

For the problem with the Addin... was it a 64bit DLL?  You can't run 32 bit dlls from a 64 bit program. (Note that I've just updated the FAQ to explain this a little more clearly)
« Last Edit: December 15, 2012, 08:08:52 PM by CommonTater »

inisheer

  • Guest
Re: Fatal Error: Access Violation (Debugging 32-bit Console Apps)
« Reply #2 on: December 15, 2012, 08:17:40 PM »
Ok... the correct debug settings for 32 bit projects are:

Compiler : full
Linker : codeview and coff

From there you should be able to simply click the "Go Debug" button on the toolbar and you're off to the races.  (Note that you cannot debug a program that will not compile)

For the UAC issue... you should be running POIDE as an administrator... Locate the POIDE file in your Program Files folder, right click then under compatibility select "Run as Administrator" ... that should solve that problem for you.

For the problem with the Addin... was it a 64bit DLL?  You can't run 32 bit dlls from a 64 bit program. (Note that I've just updated the FAQ to explain this a little more clearly)

Unfortunately, this doesn't seem to resolve the problem. I have tried all the steps you outlined (even before posting my original post).

-  Setting up the debug options as you stated.
-  Running as admin (via right-click Run As, as well as setting the Run As Admin property in the property window)
-  Changing compatibility modes to Windows 7 / Vista.
-  The .dll for the addin was in-fact 64-bit

Attached is the sample project if needed. Simple Console App with getchar();.

Maybe I'll try to install the 32-bit version of POIDE side by side to see if that works for 32-bit apps.

Thanks again for helping. It seems this is a one-off issue with just my system and not a common bug. Hard to solve these...

CommonTater

  • Guest
Re: Fatal Error: Access Violation (Debugging 32-bit Console Apps)
« Reply #3 on: December 15, 2012, 08:30:25 PM »
Ok, tested your project... it runs and debugs perfectly on my machine as supplied (Win7, x64, PellesC 64bit).

Click Go Debug... it stops at main, click step into, stops at getchar(), click on the console window hit enter, click on the debugger, it finishes normally.

I cannot say what the boggle is... Maybe it's something about Windows 8 ... I don't know for sure.
Installing the 32 bit version isn't going to solve your problem and will probably mess your settings up so bad you won't be able to fix them...

If you do get into that state, uninstall both copies of PellesC, open RegEdit and path to ...
hkey_current_user\Software\  and delete the key named "Pelle Orinius" (which will reset all your settings to defaults) then reinstall the x64 version and redo your settings.

About the only other thing I can think for you to check is in the Settings -> Options -> Debug tab, make sure you uncheck the "Just In Time Debugging" option. 


inisheer

  • Guest
Re: Fatal Error: Access Violation (Debugging 32-bit Console Apps)
« Reply #4 on: December 15, 2012, 08:41:03 PM »
Thanks again. Still doesn't seem to work. I installed POIDE64 on my laptop as well and still have the same problems. It's running Win8 too.

Side note: Have VS2012 installed on both machines.

I'm at a loss and I hate using VS' terrible C support for C projects. Don't get me started on Code::Blocks...  :) 

I'll continue to work the issue.

inisheer

  • Guest
Re: Fatal Error: Access Violation (Debugging 32-bit Console Apps)
« Reply #5 on: December 15, 2012, 08:47:10 PM »
Attached are some screenshots of the registry if it helps.

Also, when downloading the setup file from the website, I get a "The signature of setup.exe is corrupt or invalid" regardless if downloading the 32/64 bit setup file.
« Last Edit: December 15, 2012, 08:49:53 PM by inisheer »

CommonTater

  • Guest
Re: Fatal Error: Access Violation (Debugging 32-bit Console Apps)
« Reply #6 on: December 15, 2012, 08:52:00 PM »
Thanks again. Still doesn't seem to work. I installed POIDE64 on my laptop as well and still have the same problems. It's running Win8 too.

Side note: Have VS2012 installed on both machines.

I'm at a loss and I hate using VS' terrible C support for C projects. Don't get me started on Code::Blocks...  :) 

I'll continue to work the issue.

Visual Studio isn't the problem ... VC++ is.  It's C89 with Microsoft Extensions perminently enabled. 

Code::Blocks is bloatware and I find it unbelievably frustrating to use.

Does Pelles C work normally except for the debugger?
Do your programs work normally except for the debugger?

About the only remaining suggestion is that you head over to the Bug Reports section of the forum and raise a "Debugger doesn't work on Windows 8" thread and see what happens.


 

inisheer

  • Guest
Re: Fatal Error: Access Violation (Debugging 32-bit Console Apps)
« Reply #7 on: December 15, 2012, 08:54:37 PM »
Thanks again. Still doesn't seem to work. I installed POIDE64 on my laptop as well and still have the same problems. It's running Win8 too.

Side note: Have VS2012 installed on both machines.

I'm at a loss and I hate using VS' terrible C support for C projects. Don't get me started on Code::Blocks...  :) 

I'll continue to work the issue.

Visual Studio isn't the problem ... VC++ is.  It's C89 with Microsoft Extensions perminently enabled. 

Code::Blocks is bloatware and I find it unbelievably frustrating to use.

Does Pelles C work normally except for the debugger?
Do your programs work normally except for the debugger?

About the only remaining suggestion is that you head over to the Bug Reports section of the forum and raise a "Debugger doesn't work on Windows 8" thread and see what happens.

I know this is a bit odd, but I did just install the 32-bit version side-by-side with the 64-bit on my laptop. It seems to work GREAT for 32-bit applications. Debugger works perfectly. I had to manually change the install directory from Program Files to Program Files (x86) however, but this is unrelated.

Therefore, somewhere lies a problem within the 64-bit version when trying to debug 32-bit apps.

CommonTater

  • Guest
Re: Fatal Error: Access Violation (Debugging 32-bit Console Apps)
« Reply #8 on: December 15, 2012, 09:00:33 PM »
Therefore, somewhere lies a problem within the 64-bit version when trying to debug 32-bit apps.

The only problem is that both 32 and 64 bit versions use the same registry locations... your settings are now cross connected and will remain so until you uninstall BOTH and delete the registry key as I suggested.  On a 64bit OS you really do want the 64bit version of POIDE... even with the bug you've found.

It's time to make a Bug Report... "64 bit POIDE cannot debug 32 bit programs on Windows 8 64 bit OS" ... It's now pretty obvious that it's a compatibility issue that Pelle needs to address.
 
(I've personally decided to simply ignore Windows 8... I just don't like the new tiles crap)


« Last Edit: December 15, 2012, 09:05:26 PM by CommonTater »

inisheer

  • Guest
Re: Fatal Error: Access Violation (Debugging 32-bit Console Apps)
« Reply #9 on: December 15, 2012, 09:03:32 PM »
Sounds good to me. Thanks again for the help. I think there is another topic related to this problem in the bug reporting section. However, the OP didn't provide a ton of details outlining the problem.

Thanks again!

CommonTater

  • Guest
Re: Fatal Error: Access Violation (Debugging 32-bit Console Apps)
« Reply #10 on: December 15, 2012, 09:06:02 PM »
Thanks again!

No worries... Wish I could have done more.

inisheer

  • Guest
Re: Fatal Error: Access Violation (Debugging 32-bit Console Apps)
« Reply #11 on: December 15, 2012, 09:12:42 PM »
Therefore, somewhere lies a problem within the 64-bit version when trying to debug 32-bit apps.

(I've personally decided to simply ignore Windows 8... I just don't like the new tiles crap)

I don't like it either honestly and I mainly ignore it. However, I do intend to put some apps on the Windows Market and therefore was somewhat forced into having Windows 8 for testing purposes.

CommonTater

  • Guest
Re: Fatal Error: Access Violation (Debugging 32-bit Console Apps)
« Reply #12 on: December 15, 2012, 09:17:17 PM »
I don't like it either honestly and I mainly ignore it. However, I do intend to put some apps on the Windows Market and therefore was somewhat forced into having Windows 8 for testing purposes.

Yeah I've got some stuff in the oven myself (the Easy Build project in "User Contributions").  My plan is to simply say "If it works on Windows 8, that's great.  If it doesn't, Oh well..."  Seriously, I have no plans to use or support Win8... It lasted less than 10 minutes on my main system.

inisheer

  • Guest
Re: Fatal Error: Access Violation (Debugging 32-bit Console Apps)
« Reply #13 on: December 15, 2012, 09:20:59 PM »
I don't like it either honestly and I mainly ignore it. However, I do intend to put some apps on the Windows Market and therefore was somewhat forced into having Windows 8 for testing purposes.

Yeah I've got some stuff in the oven myself (the Easy Build project in "User Contributions").  My plan is to simply say "If it works on Windows 8, that's great.  If it doesn't, Oh well..."  Seriously, I have no plans to use or support Win8... It lasted less than 10 minutes on my main system.

I've found that Win8 and tiles aren't too much of a pain for me. I've learned to get around it. However, a hidden cause of frustration and family disputes raises it's ugly head when I have to assist my non-computer smart wife on using it. She hates it.

CommonTater

  • Guest
Re: Fatal Error: Access Violation (Debugging 32-bit Console Apps)
« Reply #14 on: December 15, 2012, 09:30:04 PM »
[I've found that Win8 and tiles aren't too much of a pain for me. I've learned to get around it. However, a hidden cause of frustration and family disputes raises it's ugly head when I have to assist my non-computer smart wife on using it. She hates it.

I just REALLY wish those stupid tiles were optional...  I have 4 1080p monitors 2 at 24", 1 at 22" and one projector (in the home theatre) and I really don't want to play like I'm on a stupid tablet...  With the old XP and Aero desktops it was way too simple... make desktop shortcuts, get wherever you need to go with one or 2 clicks... the tiles are just ridiculous to navigate.

Anyway, I saw your bug report... lets see what happens.

Cheers!