Skip to content

Able to compile but get "... has stopped working" error on launch in Windows 7 x64 #16324

Closed

Description

@ark-

My OS is Windows 7 x64, I have installed rust and mingw as described in this article

I'm have a simple hello world program.

fn main() {

    println!("Hello World!");
}

Compile it rustc hello.rs

Which gives me hello.exe. I go to run this and get:

image

My gdb output is as follows

D:\scratchpad>gdb hello.exe
GNU gdb (GDB) 7.6
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-w64-mingw32".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from D:\scratchpad\hello.exe...done.
(gdb) run
Starting program: D:\scratchpad\hello.exe
[New Thread 15228.0x3954]
warning: [14676] [SetupHookConfiguration] Performing Hook Feature Checks.

warning: [14676] [CDetourHelpers::CachedGetCurrentAppName] ProcessName[\Device\H
arddiskVolume2\scratchpad\hello.exe]

warning: [14676] [PipeComms::Disconnect] [14676]PipeComms: [] Disconnecting [FFF
FFFFF].

warning: [14676] [PipeComms::Do_Connection] [14676]PipeComms: Access - [c0000000
] [\\.\pipe\appsense_ConfigPipe_D3EA4760-A0CC-4d00-AA80-B0D747311668].

warning: [14676] [PipeComms::Do_SendMessage] [14676]PipeComms: [\\.\pipe\appsens
e_ConfigPipe_D3EA4760-A0CC-4d00-AA80-B0D747311668] SendMessage result = [1] [0].


warning: [14676] [PipeComms::Do_ReceiveMessage] [14676]PipeComms: [\\.\pipe\apps
ense_ConfigPipe_D3EA4760-A0CC-4d00-AA80-B0D747311668] ReceiveMessage result = [1
] [0].

warning: [14676] [SetupHookConfiguration] Features for [hello.exe], NET = [0], U
RM = [1]: PDM = [0].

warning: [14676] [PipeComms::Disconnect] [14676]PipeComms: [\\.\pipe\appsense_Co
nfigPipe_D3EA4760-A0CC-4d00-AA80-B0D747311668] Disconnecting [00000078].

warning: [14676] [PipeComms::Disconnect] [14676]PipeComms: [\\.\pipe\appsense_Co
nfigPipe_D3EA4760-A0CC-4d00-AA80-B0D747311668] Disconnecting [FFFFFFFF].

warning: [14676] [CDetourCreateProcess::Load] CoGetObject - attempt to hook on V
ista and above OS

warning: [14676] [CDetourCreateProcess::Load] Hooked detour CoGetObject

warning: [14676] [`anonymous-namespace'::IsCurrentAppOutlook] match[0]

warning: [14676] [CDetourCreateProcess::Load] Hooked detour ShellExecuteExW

warning: [14676] [CDetourOpenSave::Load] CoCreateInstance & CoGetClassObject - a
ttempt to hook on Vista and above OS

warning: [14676] [CDetourOpenSave::Load] Hooked detour CoCreateInstance

warning: [14676] [CDetourOpenSave::Load] Hooked detour CoGetClassObject

warning: [14676] [CDetourOpenSave::Load] Hooked detour GetOpenFileNameA

warning: [14676] [CDetourOpenSave::Load] Hooked detour GetOpenFileNameW

warning: [14676] [CDetourOpenSave::Load] Hooked detour GetSaveFileNameA

warning: [14676] [CDetourOpenSave::Load] Hooked detour GetSaveFileNameW

warning: [14676] [`anonymous-namespace'::IsCurrentAppIExplore] Current Process N
ame is \device\harddiskvolume2\scratchpad\hello.exe

warning: [14676] [`anonymous-namespace'::IsCurrentAppIExplore] Mached I.E name:0


warning: [14676] [IsImageExplorer] ProcessName[\Device\HarddiskVolume2\scratchpa
d\hello.exe]

warning: [14676] [IsImageExplorer] match[0]

warning: [14676] [CCreateProcessCtrl::Start] CreateProcessCtrl::Start()

warning: [14676] [CCreateProcessCtrl::AttachFunctions] Success, Attached to Crea
teProcessInternalW( )

warning: [14676] [CCreateProcessCtrl::AttachFunctions] Success, Attached to Crea
teThread( )

warning: [14676] [CCreateProcessCtrl::AttachFunctions] Success, Attach Function
CoGetObject

warning: [14676] [CCreateProcessCtrl::AttachFunctions] Success, Attached to Shel
lExecuteExW( )

warning: [14676] [CCreateProcessCtrl::AttachFunctions] Did NOT attach to CoGetCl
assObjectFromURL. Function pointer is NULL.

warning: [14676] [CCreateProcessCtrl::AttachFunctions] Did NOT attach to Real_Co
GetClassObjectFromURLInternal. Function pointer is NULL.

warning: [14676] [APCFuncInstallHook] UrmHook::Install Result [0]

warning: [14676] [CDetourCreateProcess::Detoured_CreateThread] CreateThread pare
nt[14676] new[5012]

[New Thread 15228.0x1394]

Program received signal SIGSEGV, Segmentation fault.
0x770c8e19 in ntdll!RtlIntegerToUnicodeString ()
   from C:\Windows\system32\ntdll.dll

Any thoughts?

Activity

  1. alexcrichton commented on Aug 7, 2014

    @alexcrichton
    Member

    Some segfaults I've seen in gdb are actually benign. What happens if you continue after gdb stops on the segfault?

  2. ark- commented on Aug 8, 2014

    @ark-
    Author

    Thanks, I never knew that. This time I used continue until the program ended.

    D:\scratchpad>gdb hello.exe
    GNU gdb (GDB) 7.6
    Copyright (C) 2013 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
    and "show warranty" for details.
    This GDB was configured as "i686-w64-mingw32".
    For bug reporting instructions, please see:
    <http://www.gnu.org/software/gdb/bugs/>...
    Reading symbols from D:\scratchpad\hello.exe...done.
    (gdb) run
    Starting program: D:\scratchpad\hello.exe
    [New Thread 9992.0x245c]
    warning: [9308] [SetupHookConfiguration] Performing Hook Feature Checks.
    
    warning: [9308] [CDetourHelpers::CachedGetCurrentAppName] ProcessName[\Device\Ha
    rddiskVolume2\scratchpad\hello.exe]
    
    warning: [9308] [PipeComms::Disconnect] [9308]PipeComms: [] Disconnecting [FFFFF
    FFF].
    
    warning: [9308] [PipeComms::Do_Connection] [9308]PipeComms: Access - [c0000000]
    [\\.\pipe\appsense_ConfigPipe_D3EA4760-A0CC-4d00-AA80-B0D747311668].
    
    warning: [9308] [PipeComms::Do_SendMessage] [9308]PipeComms: [\\.\pipe\appsense_
    ConfigPipe_D3EA4760-A0CC-4d00-AA80-B0D747311668] SendMessage result = [1] [0].
    
    warning: [9308] [PipeComms::Do_ReceiveMessage] [9308]PipeComms: [\\.\pipe\appsen
    se_ConfigPipe_D3EA4760-A0CC-4d00-AA80-B0D747311668] ReceiveMessage result = [1]
    [0].
    
    warning: [9308] [SetupHookConfiguration] Features for [hello.exe], NET = [0], UR
    M = [1]: PDM = [0].
    
    warning: [9308] [PipeComms::Disconnect] [9308]PipeComms: [\\.\pipe\appsense_Conf
    igPipe_D3EA4760-A0CC-4d00-AA80-B0D747311668] Disconnecting [00000078].
    
    warning: [9308] [PipeComms::Disconnect] [9308]PipeComms: [\\.\pipe\appsense_Conf
    igPipe_D3EA4760-A0CC-4d00-AA80-B0D747311668] Disconnecting [FFFFFFFF].
    
    warning: [9308] [CDetourCreateProcess::Load] CoGetObject - attempt to hook on Vi
    sta and above OS
    
    warning: [9308] [CDetourCreateProcess::Load] Hooked detour CoGetObject
    
    warning: [9308] [`anonymous-namespace'::IsCurrentAppOutlook] match[0]
    
    warning: [9308] [CDetourCreateProcess::Load] Hooked detour ShellExecuteExW
    
    warning: [9308] [CDetourOpenSave::Load] CoCreateInstance & CoGetClassObject - at
    tempt to hook on Vista and above OS
    
    warning: [9308] [CDetourOpenSave::Load] Hooked detour CoCreateInstance
    
    warning: [9308] [CDetourOpenSave::Load] Hooked detour CoGetClassObject
    
    warning: [9308] [CDetourOpenSave::Load] Hooked detour GetOpenFileNameA
    
    warning: [9308] [CDetourOpenSave::Load] Hooked detour GetOpenFileNameW
    
    warning: [9308] [CDetourOpenSave::Load] Hooked detour GetSaveFileNameA
    
    warning: [9308] [CDetourOpenSave::Load] Hooked detour GetSaveFileNameW
    
    warning: [9308] [`anonymous-namespace'::IsCurrentAppIExplore] Current Process Na
    me is \device\harddiskvolume2\scratchpad\hello.exe
    
    warning: [9308] [`anonymous-namespace'::IsCurrentAppIExplore] Mached I.E name:0
    
    warning: [9308] [IsImageExplorer] ProcessName[\Device\HarddiskVolume2\scratchpad
    \hello.exe]
    
    warning: [9308] [IsImageExplorer] match[0]
    
    warning: [9308] [CCreateProcessCtrl::Start] CreateProcessCtrl::Start()
    
    warning: [9308] [CCreateProcessCtrl::AttachFunctions] Success, Attached to Creat
    eProcessInternalW( )
    
    warning: [9308] [CCreateProcessCtrl::AttachFunctions] Success, Attached to Creat
    eThread( )
    
    warning: [9308] [CCreateProcessCtrl::AttachFunctions] Success, Attach Function C
    oGetObject
    
    warning: [9308] [CCreateProcessCtrl::AttachFunctions] Success, Attached to Shell
    ExecuteExW( )
    
    warning: [9308] [CCreateProcessCtrl::AttachFunctions] Did NOT attach to CoGetCla
    ssObjectFromURL. Function pointer is NULL.
    
    warning: [9308] [CCreateProcessCtrl::AttachFunctions] Did NOT attach to Real_CoG
    etClassObjectFromURLInternal. Function pointer is NULL.
    
    warning: [9308] [APCFuncInstallHook] UrmHook::Install Result [0]
    
    warning: [9308] [CDetourCreateProcess::Detoured_CreateThread] CreateThread paren
    t[9308] new[9888]
    
    [New Thread 9992.0x26a0]
    
    Program received signal SIGSEGV, Segmentation fault.
    0x77868e19 in ntdll!RtlIntegerToUnicodeString ()
       from C:\Windows\system32\ntdll.dll
    (gdb) continue
    Continuing.
    
    Program received signal SIGSEGV, Segmentation fault.
    0x77868e19 in ntdll!RtlIntegerToUnicodeString ()
       from C:\Windows\system32\ntdll.dll
    (gdb) continue
    Continuing.
    [Inferior 1 (process 9992) exited with code 030000000005]
    (gdb) continue
    The program is not being run.
    (gdb)
    
  3. vadimcn commented on Aug 17, 2014

    @vadimcn
    Contributor

    @ark-,The messages above indicate that there's some kind of scary system API hooking going on. Looks like you are using AppSense, which is some kind of user-space virtualization software?
    This sort of stuff is notoriously hard to do correctly, so I wouldn't be so sure to blame this crash on rust...

  4. pnkfelix commented on Aug 28, 2014

    @pnkfelix
    Contributor

    This bug is not actionable in its current state. The best hint we have about what is particularly different about your setup is that it may be some sort of user-space virtualized environment?

    Without more specific info on how to reproduce, we cannot hope to address this issue.

    Closing.

  5. ark- commented on Aug 28, 2014

    @ark-
    Author

    Yes this is a work machine with a some virtualised applications. I've had no issues with any other toolchain, so there must be some particular incompatibility between the two. I'll have a dig deeper some time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    O-windows

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions