This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Segmentation fault with winmm library



Hi,

when trying to run the following program, which uses the windows winmm
library:

---
#include <stdio.h>
#include <windows.h>

int main(void)
  {
  // a library call to make sure winmm gets loaded
  TIMECAPS tc ;
  timeGetDevCaps (&tc, sizeof (TIMECAPS));

  printf("hello world\n");

  return 0;
  }
---

compiled with the following command:

g++ main.cc /usr/lib/w32api/libwinmm.a -Wall -g -O0

I get a segmentation fault under gdb:

---
$ gdb a.exe
GNU gdb 6.5.50.20060706-cvs (cygwin-special)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-cygwin"...
(gdb) r
Starting program: /home/geschema/projects/pulsers2/ppc/temp/a.exe
Loaded symbols for /ecos-c/WINDOWS/system32/ntdll.dll
Loaded symbols for /ecos-c/WINDOWS/system32/kernel32.dll
Loaded symbols for /usr/bin/cygwin1.dll
Loaded symbols for /ecos-c/WINDOWS/system32/advapi32.dll
Loaded symbols for /ecos-c/WINDOWS/system32/rpcrt4.dll
Loaded symbols for /ecos-c/WINDOWS/system32/winmm.dll
Loaded symbols for /ecos-c/WINDOWS/system32/user32.dll
Loaded symbols for /ecos-c/WINDOWS/system32/gdi32.dll

Program received signal SIGSEGV, Segmentation fault.
0x18bfb7c3 in wxvault!??0Cwxvault@@QAE@XZ ()
(gdb) bt
#0  0x18bfb7c3 in wxvault!??0Cwxvault@@QAE@XZ ()
#1  0x00000018 in ?? ()
#2  0x00400000 in ?? ()
#3  0x18bf0000 in ?? ()
#4  0x00410000 in ?? ()
#5  0x00400000 in ?? ()
#6  0x00000080 in ?? ()
#7  0x000a2000 in ?? ()
#8  0x00001000 in ?? ()
#9  0x00000001 in ?? ()
#10 0x01000000 in ?? ()
#11 0x0022e8bc in ?? ()
#12 0x00410000 in ?? ()
#13 0x0022e8b4 in ?? ()
#14 0x18bfca38 in wxvault!??0Cwxvault@@QAE@XZ ()
#15 0x0022eb38 in ?? ()
#16 0x18bfca38 in wxvault!??0Cwxvault@@QAE@XZ ()
#17 0x18c09798 in wxvault!??0Cwxvault@@QAE@XZ ()
#18 0x00000000 in ?? ()
---

The problem seems to be related to the winmm library, because it disappears
when I remove the timeGetDevCaps function call in the main function.
Also, the segmentation fault happens *before* the main function is called.
A breakpoint at main() is never reached.

Does someone have a suggestion about how to debug this?

Many thanks,
Guy.

(See attached file: cygcheck.out)
Sennheiser electronic GmbH & Co.KG, Sitz: Wedemark, Handelsregister: AG
Hannover HRA 120100, Aufsichtsratsvorsitzender: Prof. Dr. sc. techn. Jörg
Sennheiser phG:
Sennheiser Beteiligungsgesellschaft mbH, Sitz: Wedemark, Handelsregister:
AG Hannover HRB 120179, Geschäftsführer: Volker Bartels, Dr. Heinrich
Esser, Stefan Junker

Diese E-Mail enthält vertrauliche oder rechtlich geschützte Informationen.
Wenn Sie nicht der beabsichtigte Empfänger sind, informieren Sie bitte
sofort den Absender
und löschen Sie diese E-Mail. Das unbefugte Kopieren dieser E-Mail oder die
unbefugte Weitergabe der enthaltenen Informationen ist nicht gestattet.

The information contained in this message is confidential or protected by
law. If you are not the intended recipient, please contact the sender
and delete this message. Any unauthorized copying of this message or
unauthorized distribution of the information contained herein is
prohibited.

Attachment: cygcheck.out
Description: Binary data

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]