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]

Re: sigsegv in compiled cygwin

i found small piece of code that need some comment.

from trunk

int (*wsastartup) (int, WSADATA *);

      /* Don't use autoload to load WSAStartup to eliminate recursion. */
      wsastartup = (int (*)(int, WSADATA *))
		   GetProcAddress ((HMODULE) (dll->handle), "WSAStartup");

would have meant
      typedef int __stdcall (*pfnwsastartup) (int, WSADATA *);
      pfnwsastartup wsastartup;
      wsastartup = (pfnwsastartup)
		   GetProcAddress ((HMODULE) (dll->handle), "WSAStartup");

otherwise stack frame would be damaged.

On 2011-02-05 ìì 12:01, Christopher Faylor wrote:
On Fri, Feb 04, 2011 at 09:40:46PM +0900, jojelino wrote:
i'm trying to build cygwin with gcc 4.6 trunk. and compile succeed.
but when i try to run cygwin-linked executables with new-compiled-one,
initialization routine failed with sigsegv  at win32_whatever+14

  0x61171a20<+0>:     jmp    0x61171a25<win32_GetKeyboardLayout@4+5>
    0x61171a25<+5>:     mov    0x61171a2c,%eax
    0x61171a2a<+10>:    call   *(%eax)
    0x61171a2c<+12>:    sbb    %al,%al
=>  0x61171a2e<+14>:    pop    %ss

it seems redirection statement('Kludge alert') in didn't
work as expected.
what would i do??

Well, since you're trying to do something cutting edge and unsupported it seems like you will have to debug the problem using gdb and, if you really want this to work, make a change to to fix the problem. Look at a call frame for normal program and find where the return address is stored.

Either that or wait for us to move to a newer version of gcc.


-- Problem reports: FAQ: Documentation: Unsubscribe info:

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