Author Topic: Segmentation Fault  (Read 5279 times)

Offline tom0769

  • Multiple posting newcomer
  • *
  • Posts: 42
Segmentation Fault
« on: May 03, 2007, 07:47:31 pm »
Hi,
I have some problems on my notebook (WinXP Home Ed.)with Win32Api-calls in debug mode.
I'm using  MinGW 3.4.5 in combination with GDB 6.3.2.
The Api functions, that actually cause the Segmentation fault are:
- Beep()
- GetOpenFileName()

When running the application in release mode, all seems to be ok.
When running in debug mode, the programm is stopped and the message
below is shown:

...
Debugger name and version: GNU gdb 6.3
Child process PID: 3036
Program received signal SIGSEGV, Segmentation fault.
In RpcRaiseException () (C:\WINDOWS\system32\rpcrt4.dll)


The backtrace looks like this:

#0 77E827CA   RpcRaiseException() (C:\WINDOWS\system32\rpcrt4.dll:??)
#1 76302510   DllUnregisterServer() (C:\WINDOWS\system32\winsta.dll:??)
#2 00000000   ??() (??:??)
#3 00000001   ??() (??:??)
#4 0022CBF8   ??() (??:??)
#5 0022CFF4   ??() (??:??)
#6 0022CFD8   ??() (??:??)
#7 77ED360B   RPCRT4!CStdStubBuffer_CountRefs() (C:\WINDOWS\system32\rpcrt4.dll:??)
#8 0022CC44   ??() (??:??)
#9 00000000   ??() (??:??)
#10 002D72B8   ??() (??:??)
#11 00000000   ??() (??:??)
#12 00278FC2   ??() (??:??)
#13 0022D570   ??() (??:??)
#14 002D72B8   ??() (??:??)
#15 00000068   ??() (??:??)
#16 0022CD0C   ??() (??:??)
#17 00000000   ??() (??:??)
#18 00000000   ??() (??:??)
#19 00000000   ??() (??:??)
#20 76302560   DllUnregisterServer() (C:\WINDOWS\system32\winsta.dll:??)
#21 7C936ABE   ntdll!iswdigit() (ntdll.dll:??)
#22 002D7140   ??() (??:??)
#23 7C959B34   ntdll!RtlInsertElementGenericTableAvl() (ntdll.dll:??)
#24 00000000   ??() (??:??)
#25 0022CC18   ??() (??:??)
#26 00000000   ??() (??:??)
#27 00000000   ??() (??:??)
#28 00000000   ??() (??:??)
#29 7C936ABE   ntdll!iswdigit() (ntdll.dll:??)

Does anybody know how I can fix this?
With the same configuration on my Desktop PC (WinXP Prof.) all is fine!

thanks
Tom

Offline tom0769

  • Multiple posting newcomer
  • *
  • Posts: 42
Re: Segmentation Fault
« Reply #1 on: May 17, 2007, 07:44:39 pm »
Hi,

did I mention, that the CPU of my notebook is an AMD Mobile Sempron?
I found MinGW AMD64 headers.
Should I use the headers?
Does anybody have experience with this?

Vladsharp

  • Guest
Re: Segmentation Fault
« Reply #2 on: May 17, 2007, 08:28:15 pm »
I will take a daring guess that the error is due to the "RpcRaiseException()" - but I guess that exception propagation should work fine in GCC 3.4.x series in Windows (unlike that of 4.x)?

Offline tom0769

  • Multiple posting newcomer
  • *
  • Posts: 42
Re: Segmentation Fault
« Reply #3 on: May 19, 2007, 10:24:59 am »
What is more likely for causing this error:
- configuration of the notebook (WinXP Home, AMD Mobile Sempron)
- problems with DLLs (rpcrt4.dll)
- MinGW or GDB installation/libraries

Kalma

  • Guest
Re: Segmentation Fault
« Reply #4 on: May 19, 2007, 11:30:09 am »
Hello I ve the same Problems, for a wile.
But I think it has something to do with the "no execution"- feature which amd provides in some of its processors. :? I think this behavior started after an Microsoft update which incluted the abilyti to use the "no execution" feature for the os.

Offline tom0769

  • Multiple posting newcomer
  • *
  • Posts: 42
Re: Segmentation Fault
« Reply #5 on: May 20, 2007, 11:17:54 am »
Hi Kalma,

could you fix this?
Is there a possibilty to disable this feature?

Kalma

  • Guest
Re: Segmentation Fault
« Reply #6 on: May 20, 2007, 01:23:43 pm »
Hello,
I've tried it but it does not seem to work.
The app runs normaly without the debugger, but with the debugger it gets this SIGSEGV.
Maybe it could be that it works on your machine. You can disable this feature when you
change the boot.ini file.
For example: multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Home Edition" /fastdetect /NoExecute=AlwaysOff /PAE

Offline tom0769

  • Multiple posting newcomer
  • *
  • Posts: 42
Re: Segmentation Fault
« Reply #7 on: May 21, 2007, 07:40:30 am »
Hi,

I tried changing the boot.ini, but the problem is still the same:
In debug mode even a simple win32api-call as "Beep()" leeds to a segmentation fault in "RpcRaiseException()".
The application seems to run normally in release mode.

On several other systems (notebook Win2k PII-400MHz, desktop WinXP prof. SP2 P4-2,4GHz) there is no problem.

Offline tom0769

  • Multiple posting newcomer
  • *
  • Posts: 42
Re: Segmentation Fault
« Reply #8 on: May 22, 2007, 07:17:32 am »
Hi,

yesterday I installed Borland BC55 compiler.
I switched my project to Borland compiler, did some necessary settings (paths, libs, ...), compiled and run the application.
It worked!
I loaded the application in Turbo Debugger and run the application from there:
No segmentation faults or exceptions.
- GetOpenFileName() works fine
- Beep() doesn't crash, though no sound is output, only the duration parameter seems to be handled.