RE: Compiled programs fail to run from Cygwin Terminal, but work from windows cmd

2017-06-27 Thread Soegtrop, Michael
Dear Wouter,

> One day on, and it's all reverted. Everything failing again in exactly the 
> same way
> as before. It was too good to be true...

You might want to disassemble the good and bad binaries and compare the 
disassemblies. This should reveal what is going on. You can send me the 
binaries via private mail (as zip encrypted). Please note that the PATH has not 
only an influence at build time, but also at run time.

> I'll have to give up on cygwin, still appreciate the attempts at helping me.

You shouldn't. Of cause there is bogus SW which just isn't worth it, but Cygwin 
definitely doesn't fall into this category. 

One more advice: if computers behave erratically and don't have ECC memory, it 
is worthwhile to run a memory test (use memtest86, burn a boot CD and run it 
for 1 hour - don't trust in BIOS memory tests). I see broken memory about once 
or twice a year.

Best regards,

Michael
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

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



Re: Compiled programs fail to run from Cygwin Terminal, but work from windows cmd

2017-06-27 Thread Wouter van Doorn
Ho-hum.

One day on, and it's all reverted. Everything failing again in exactly
the same way as before. It was too good to be true...

I'll have to give up on cygwin, still appreciate the attempts at helping me.
Wouter

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



Re: Compiled programs fail to run from Cygwin Terminal, but work from windows cmd

2017-06-26 Thread Wouter van Doorn
Hello Cygwin-helpers,

Many thanks to all who have responded. It was good not to sit here
alone behind my keyboard tearing my hair out.

I'll outline what has heppened next especially for the benefit of
those readers who find themselves with this same problem. It would be
nasty to leave them in the lurch if I now only said 'thanks - it's
fine now'.

But things have now taken a strange/miraculous turn for the better. It
started with a suggestion from Achim about the general crappiness of
my PATH (fair), with a very specific request concerning the path by
Houder soon after. That was to recompile/link and re-run after setting
the PATH to just /usr/bin and nothing more.

To my relief, the resulting executable worked. Not just under the
command prompt, but also under mintty this time.

>From there, it seemed an easy task to find what the path component was
that caused the whole mess, but... it wasn't. Because now that it once
worked as expected, I was NEVER able to get it to go wrong again. I
re-instated the troublesome path, removed and rebuilt the executable,
and it is now still fine. Did the same after a shutdown/restart. No
change - everything is now as it should have been from the start.

So the message to those with the same problem is: try recompiling with
the PATH set to /usr/bin. After that, you may, just like me,
experience some sort of magic that means the fault disappears.

I'd rather know what was wrong, and what really happened to make the
error go away, but I can live with how it is. If developers want me to
run specific tests, I'll be very happy to do so. Otherwise, I'd say we
should consider this closed (but not forgotten).

Thanks again to all who chipped in - it was really apreciated.
Wouter

On 21 June 2017 at 22:10, Wouter van Doorn  wrote:
> Hi,
>
> Having installed Cygwin with no errors I could see, I went on to
> compile and run "hello world" - as you do. I could make it go from a
> windows command prompt after modifying the system path to include
> cygwin\bin, so - so far so good.
>
> From the cygwin terminal, however, the same executable refuses to play
> ball. No text is shown; the command prompt returns instantly.
>
> I have tried looking in the mailing list archive, and the answer may
> well be there (in which case I apologise). But the searches I have
> tried either returned nothing, or an incredible amount of information
> that was not apparently relevant to my problem.
>
> Maybe the attached strace output tells somebody something; to me its
> only helpful thing is that it shows that the cygwin1.dll is found and
> loaded, which eliminates the most likely potential problem that I
> could see. Dependency Walker only mutters about 64-bit and 32-bit
> libraries being mixed, but as the program runs under the Windows
> command prompt, I am discounting that as a reason for the failure.
>
> All the standard pre-compiled utilities I tried run as expected from
> the cygwin terminal.
>
> I'd be very grateful for a pointer!
> Wouter van Doorn

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



Re: Compiled programs fail to run from Cygwin Terminal, but work from windows cmd

2017-06-26 Thread Wouter van Doorn
Hello again!

Thanks for your continued support.

Answers to your questions will follow, but I do need to say first that
there has been progress, and although the wy of getting there was
extremely vague, things now do work properly. I'll say more in a
general reply later. So the urgency is gone, but I still fail to
understand what happened. I can live with that, though not gladly.

Anyway.

Compiling/linking is done in the most elementary way, via make with no
makefile (so make hello from the source hello.c). Furthermore:

$ uname -a
CYGWIN_NT-6.1-WOW User-PC 2.8.0(0.309/5/3) 2017-04-01 20:42 i686 Cygwin

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-pc-cygwin/5.4.0/lto-wrapper.exe
Target: i686-pc-cygwin
Configured with:
/cygdrive/i/szsz/tmpp/gcc/gcc-5.4.0-1.i686/src/gcc-5.4.0/configure
--srcdir=/cygdrive/i/szsz/tmpp/gcc/gcc-5.4.0-1.i686/src/gcc-5.4.0
--prefix=/usr --exec-prefix=/usr --localstatedir=/var
--sysconfdir=/etc --docdir=/usr/share/doc/gcc
--htmldir=/usr/share/doc/gcc/html -C --build=i686-pc-cygwin
--host=i686-pc-cygwin --target=i686-pc-cygwin
--without-libiconv-prefix --without-libintl-prefix
--libexecdir=/usr/lib --enable-shared --enable-shared-libgcc
--enable-static --enable-version-specific-runtime-libs
--enable-bootstrap --enable-__cxa_atexit --with-dwarf2
--with-arch=i686 --with-tune=generic --disable-sjlj-exceptions
--enable-languages=ada,c,c++,fortran,java,lto,objc,obj-c++
--enable-graphite --enable-threads=posix --enable-libatomic
--enable-libcilkrts --enable-libgomp --enable-libitm
--enable-libquadmath --enable-libquadmath-support --enable-libssp
--enable-libada --enable-libjava --enable-libgcj-sublibs
--disable-java-awt --disable-symvers
--with-ecj-jar=/usr/share/java/ecj.jar --with-gnu-ld --with-gnu-as
--with-cloog-include=/usr/include/cloog-isl --without-libiconv-prefix
--without-libintl-prefix --with-system-zlib --enable-linker-build-id
--with-default-libstdcxx-abi=gcc4-compatible
Thread model: posix
gcc version 5.4.0 (GCC)

$ ld -v
GNU ld (GNU Binutils) 2.25.2

I am unclear about the attachments you mention - I don't know what was
expected. But the urgency is gone, even if the mystery is not.

Kind regards,
Wouter

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



Re: Compiled programs fail to run from Cygwin Terminal, but work from windows cmd

2017-06-26 Thread cyg Simple
On 6/22/2017 11:57 AM, Wouter van Doorn wrote:
>>
>> Is your prompt overwriting the output of the program?
>>
>> Try:
>>
>> $ hello | cat
>> $ hello | grep ello
>>
>> etc.
>
> On 22 June 2017 at 14:57, cyg Simple  wrote:
> Nice thought, but no, that's not it. The standard utilities behave
> normally, only the things I compile myself stay schtumm.
> 

I've not seen you explain your compile and link process; assuming is a
bad idea.  I've not seen any attachments as per the problems link in
every email in this thread.  What is the output of uname -a, gcc -v and
ld -v?

-- 
cyg Simple

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



Re: Compiled programs fail to run from Cygwin Terminal, but work from windows cmd

2017-06-25 Thread Brian Inglis
On 2017-06-25 00:31, Wouter van Doorn wrote:
> There isn't one! The default rule does exactly that (although despite
> the -o it creates a hello.exe, but that's fine.

It doesn't seem to be fine - is that not what you're complaining about?
Given your PATH, we don't know which make might be running, which
rules it might be using, and which programs might be producing your
hello.exe which doesn't run, running a simple "gcc -o hello hello.c"
may give you some certainty and possibly success.

In general, your Cygwin profile should prefix your Windows user PATH with
e.g. PATH=$HOME/bin:/usr/local/bin:/usr/bin:/bin:%PATH%
- append /usr/sbin;/sbin; before %PATH% to also run admin utilities.

Also your Windows user PATH should prefix your Windows system Path with utility
paths you installed and use logged on e.g. PATH ->
C:\Cygwin\usr\local\bin;C:\Cygwin\bin;%ProgramFiles%\;%ProgramFiles%\\bin;...%Path%

Your Windows system Path should be prefixed with utility paths you may want to
run logged out or under other ids e.g. Path -> ...

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

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



Re: Compiled programs fail to run from Cygwin Terminal, but work from windows cmd

2017-06-25 Thread Houder
On Sun, 25 Jun 2017 10:33:17, Achim Gratz wrote:
> Wouter van Doorn writes:
> [=E2=80=A6]
> 
> Your strace shows that you're getting the following exception on loading
> one of the Windows DLL or just after an attempt to do that:
> 
> C096: STATUS_PRIVILEGED_INSTRUCTION
>   Executing an instruction not allowed in current machine mode.
> 
> You might want to look if Windows' Event Viewer has something more
> useful on this error.
> 
> Other than that, it appears you have installed Cygwin using a
> non-administrator account (which may or may not correlate with your
> problem), you are apparently using a program TVexe that might doing
> strange things and your PATH is complete bunk.  Since you're using a

Achim vraagt je hier beleefd om PATH te beperken tot uitluitend paden,
die Cygwin betreffen ... ;-)

> 64bit OS you'd have much less chances of encountering problems using a
> 64bit Cygwin I'd think.


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



Re: Compiled programs fail to run from Cygwin Terminal, but work from windows cmd

2017-06-25 Thread Achim Gratz
Wouter van Doorn writes:
[…]

Your strace shows that you're getting the following exception on loading
one of the Windows DLL or just after an attempt to do that:

C096: STATUS_PRIVILEGED_INSTRUCTION
  Executing an instruction not allowed in current machine mode.

You might want to look if Windows' Event Viewer has something more
useful on this error.

Other than that, it appears you have installed Cygwin using a
non-administrator account (which may or may not correlate with your
problem), you are apparently using a program TVexe that might doing
strange things and your PATH is complete bunk.  Since you're using a
64bit OS you'd have much less chances of encountering problems using a
64bit Cygwin I'd think.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Waldorf MIDI Implementation & additional documentation:
http://Synth.Stromeko.net/Downloads.html#WaldorfDocs

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



Re: Compiled programs fail to run from Cygwin Terminal, but work from windows cmd

2017-06-25 Thread Wouter van Doorn
Hi René,

There isn't one! The default rule does exactly that (although despite
the -o it creates a hello.exe, but that's fine.

Wouter

I'm convinced that the answer must lie hidden in the two differing
outputs of procmon, elsewhere in this thread. But I lack the knowledge
to go in deeper, and the development environment to correct it if I
didn't...

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



Re: Compiled programs fail to run from Cygwin Terminal, but work from windows cmd

2017-06-25 Thread René Berber
On 6/25/2017 1:14 AM, Wouter van Doorn wrote:

> The tools are the original ones, as shown below:
> User@User-PC ~/c_dir
> $ ./hello.exe
> 
> User@User-PC ~/c_dir
> $ type make
> make is hashed (/usr/bin/make)
> 
> User@User-PC ~/c_dir
> $ type gcc
> gcc is /usr/bin/gcc

Try a simple:

$ gcc -o hello hello.c

$ ./hello

Take out make out of the equation, we don't know what the Makefile does
anyway (we haven't seen it).
-- 
R. Berber


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



Re: Compiled programs fail to run from Cygwin Terminal, but work from windows cmd

2017-06-25 Thread Wouter van Doorn
Hello Thomas,

Thanks for looking.

The tools are the original ones, as shown below:
User@User-PC ~/c_dir
$ ./hello.exe

User@User-PC ~/c_dir
$ type make
make is hashed (/usr/bin/make)

User@User-PC ~/c_dir
$ type gcc
gcc is /usr/bin/gcc

User@User-PC ~/c_dir
$ type cc
cc is /usr/bin/cc


If you know of anything more to check, I'll try almost anything, as
this is driving me up the walls!

Kind regards,
Wouter

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



Re: Compiled programs fail to run from Cygwin Terminal, but work from windows cmd

2017-06-23 Thread Wouter van Doorn
Hi Andrey,

That looked really promising, as that whole rebasing stuff was
something I'd never heard about. Unfortunately, it did not lead to
anything; all my self-compiled tools still do exactly nothing.

Apologies about the top-posting; I had missed that rule.
Wouter

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



Re: Compiled programs fail to run from Cygwin Terminal, but work from windows cmd

2017-06-22 Thread Andrey Repin
Greetings, Wouter van Doorn!

> On 22 June 2017 at 15:08, René Berber wrote:
>> On 6/22/2017 8:13 AM, Wouter van Doorn wrote:
>>
>> [snip]
>>> STOP PRESS: in gdb, the output IS there:
>>> User-PC-> gdb hello.exe
>>> GNU gdb (GDB) (Cygwin 7.10.1-1) 7.10.1
>> ...
>>> Reading symbols from hello.exe...done.
>>> (gdb) run
>>> Starting program: /home/User/c_dir/hello.exe
>>> [New Thread 6868.0x5b0]
>>> [New Thread 6868.0x18dc]
>>> [New Thread 6868.0x1990]
>>> Hello, world!
>>> [Thread 6868.0x1990 exited with code 0]
>>> [Inferior 1 (process 6868) exited normally]
>>> (gdb)
>>>
>>> Which is dandy, but then why, outside of gdb, is there nothing at all?
>>
>> What is "outside"?
>>
>> Are you running this from mintty (recommended) or the Cygwin.bat cmd window?
>>
>> Which shell? (i.e. echo $SHELL)

> With 'outside', I meant a normal run not involving gdb at all. Sorry
> if I was unclear.

> Yes, it's minty, and it's /bin/bash.

> Out of desperation, I have added a sleep for two seconds both before
> and after the printf statement. The sleep does not happen either! The
> prompt is immediately back, so it's more than just 'no output', it
> seems my code never even gets started. Does this shed any new light?


Did you try to rebase your program?

P.S.
And did you try to not top-post in this list? Thank you in advance.


-- 
With best regards,
Andrey Repin
Friday, June 23, 2017 03:48:14

Sorry for my terrible english...

Re: Compiled programs fail to run from Cygwin Terminal, but work from windows cmd

2017-06-22 Thread Thomas Wolff

Am 22.06.2017 um 15:13 schrieb Wouter van Doorn:

Hi René,

Thanks for your attempts at having me dig deeper. So far, I am not
striking lucky. Here's the various outputs, that don't say anything
obvious to me:
User-PC-> echo $PATH
/home/User/exe.CYGWIN:/home/User/bin:/usr/local/bin:/usr/bin:/cygdrive/c/ProgramData/Oracle/Java/javapath:...
Do you have any of make, cc or gcc in /home/Usr/exe.CYGWIN or 
/home/User/bin ?

What does `type make` and `type cc` / `type gcc` say?


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



Re: Compiled programs fail to run from Cygwin Terminal, but work from windows cmd

2017-06-22 Thread Wouter van Doorn
Well, it's the same antivirus (comodo) that I earlier had a working
system with, and there's also the matter of it running fine under a
windows command prompt.

Thanks for all your suggestions!

On 22 June 2017 at 17:18, René Berber  wrote:
> On 6/22/2017 10:59 AM, Wouter van Doorn wrote:
>
>> With 'outside', I meant a normal run not involving gdb at all. Sorry
>> if I was unclear.
>>
>> Yes, it's minty, and it's /bin/bash.
>>
>> Out of desperation, I have added a sleep for two seconds both before
>> and after the printf statement. The sleep does not happen either! The
>> prompt is immediately back, so it's more than just 'no output', it
>> seems my code never even gets started. Does this shed any new light?
>
> Then its down to the 'weird' stuff, any anti-virus installed? (maybe
> even the name hello.exe could cause an anti-virus to block it).
> --
> R. Berber
>
>
> --
> Problem reports:   http://cygwin.com/problems.html
> FAQ:   http://cygwin.com/faq/
> Documentation: http://cygwin.com/docs.html
> Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
>

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



RE: Compiled programs fail to run from Cygwin Terminal, but work from windows cmd

2017-06-22 Thread Soegtrop, Michael
Dear Wouter,

when things get bizarre on Windows, I tend to use Sysinternals/Microsoft 
ProcMon. It is free and can be downloaded here:

https://technet.microsoft.com/en-us/sysinternals/processmonitor.aspx

ProcMon shows you all Windows system calls with parameters and error results. 
You should see the CreatProcess call and possibly can see why it fails. Since 
Cygwin in the end creates a windows process with windows system calls, it 
should also help for Cygwin. In case your process does start and fails during 
initialization, you can also see the Windows system calls it does. If there are 
DLLs missing, you can also see that.

Best regards,

Michael
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928


Re: Compiled programs fail to run from Cygwin Terminal, but work from windows cmd

2017-06-22 Thread René Berber
On 6/22/2017 10:59 AM, Wouter van Doorn wrote:

> With 'outside', I meant a normal run not involving gdb at all. Sorry
> if I was unclear.
> 
> Yes, it's minty, and it's /bin/bash.
> 
> Out of desperation, I have added a sleep for two seconds both before
> and after the printf statement. The sleep does not happen either! The
> prompt is immediately back, so it's more than just 'no output', it
> seems my code never even gets started. Does this shed any new light?

Then its down to the 'weird' stuff, any anti-virus installed? (maybe
even the name hello.exe could cause an anti-virus to block it).
-- 
R. Berber


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



Re: Compiled programs fail to run from Cygwin Terminal, but work from windows cmd

2017-06-22 Thread Wouter van Doorn
With 'outside', I meant a normal run not involving gdb at all. Sorry
if I was unclear.

Yes, it's minty, and it's /bin/bash.

Out of desperation, I have added a sleep for two seconds both before
and after the printf statement. The sleep does not happen either! The
prompt is immediately back, so it's more than just 'no output', it
seems my code never even gets started. Does this shed any new light?

On 22 June 2017 at 15:08, René Berber  wrote:
> On 6/22/2017 8:13 AM, Wouter van Doorn wrote:
>
> [snip]
>> STOP PRESS: in gdb, the output IS there:
>> User-PC-> gdb hello.exe
>> GNU gdb (GDB) (Cygwin 7.10.1-1) 7.10.1
> ...
>> Reading symbols from hello.exe...done.
>> (gdb) run
>> Starting program: /home/User/c_dir/hello.exe
>> [New Thread 6868.0x5b0]
>> [New Thread 6868.0x18dc]
>> [New Thread 6868.0x1990]
>> Hello, world!
>> [Thread 6868.0x1990 exited with code 0]
>> [Inferior 1 (process 6868) exited normally]
>> (gdb)
>>
>> Which is dandy, but then why, outside of gdb, is there nothing at all?
>
> What is "outside"?
>
> Are you running this from mintty (recommended) or the Cygwin.bat cmd window?
>
> Which shell? (i.e. echo $SHELL)
> --
> R. Berber
>
>
> --
> Problem reports:   http://cygwin.com/problems.html
> FAQ:   http://cygwin.com/faq/
> Documentation: http://cygwin.com/docs.html
> Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
>

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



Re: Compiled programs fail to run from Cygwin Terminal, but work from windows cmd

2017-06-22 Thread Wouter van Doorn
Nice thought, but no, that's not it. The standard utilities behave
normally, only the things I compile myself stay schtumm.

On 22 June 2017 at 14:57, cyg Simple  wrote:
>>
>> STOP PRESS: in gdb, the output IS there:
>> User-PC-> gdb hello.exe
>> GNU gdb (GDB) (Cygwin 7.10.1-1) 7.10.1
>> Copyright (C) 2015 Free Software Foundation, Inc.
>> License GPLv3+: GNU GPL version 3 or later 
>> 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-pc-cygwin".
>> Type "show configuration" for configuration details.
>> For bug reporting instructions, please see:
>> .
>> Find the GDB manual and other documentation resources online at:
>> .
>> For help, type "help".
>> Type "apropos word" to search for commands related to "word"...
>> Reading symbols from hello.exe...done.
>> (gdb) run
>> Starting program: /home/User/c_dir/hello.exe
>> [New Thread 6868.0x5b0]
>> [New Thread 6868.0x18dc]
>> [New Thread 6868.0x1990]
>> Hello, world!
>> [Thread 6868.0x1990 exited with code 0]
>> [Inferior 1 (process 6868) exited normally]
>> (gdb)
>>
>> Which is dandy, but then why, outside of gdb, is there nothing at all?
>> Still stumped!
>
> Is your prompt overwriting the output of the program?
>
> Try:
>
> $ hello | cat
> $ hello | grep ello
>
> etc.
>
> --
> cyg Simple
>
> --
> Problem reports:   http://cygwin.com/problems.html
> FAQ:   http://cygwin.com/faq/
> Documentation: http://cygwin.com/docs.html
> Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
>

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



Re: Compiled programs fail to run from Cygwin Terminal, but work from windows cmd

2017-06-22 Thread René Berber
On 6/22/2017 8:13 AM, Wouter van Doorn wrote:

[snip]
> STOP PRESS: in gdb, the output IS there:
> User-PC-> gdb hello.exe
> GNU gdb (GDB) (Cygwin 7.10.1-1) 7.10.1
...
> Reading symbols from hello.exe...done.
> (gdb) run
> Starting program: /home/User/c_dir/hello.exe
> [New Thread 6868.0x5b0]
> [New Thread 6868.0x18dc]
> [New Thread 6868.0x1990]
> Hello, world!
> [Thread 6868.0x1990 exited with code 0]
> [Inferior 1 (process 6868) exited normally]
> (gdb)
> 
> Which is dandy, but then why, outside of gdb, is there nothing at all?

What is "outside"?

Are you running this from mintty (recommended) or the Cygwin.bat cmd window?

Which shell? (i.e. echo $SHELL)
-- 
R. Berber


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



Re: Compiled programs fail to run from Cygwin Terminal, but work from windows cmd

2017-06-22 Thread cyg Simple
> 
> STOP PRESS: in gdb, the output IS there:
> User-PC-> gdb hello.exe
> GNU gdb (GDB) (Cygwin 7.10.1-1) 7.10.1
> Copyright (C) 2015 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later 
> 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-pc-cygwin".
> Type "show configuration" for configuration details.
> For bug reporting instructions, please see:
> .
> Find the GDB manual and other documentation resources online at:
> .
> For help, type "help".
> Type "apropos word" to search for commands related to "word"...
> Reading symbols from hello.exe...done.
> (gdb) run
> Starting program: /home/User/c_dir/hello.exe
> [New Thread 6868.0x5b0]
> [New Thread 6868.0x18dc]
> [New Thread 6868.0x1990]
> Hello, world!
> [Thread 6868.0x1990 exited with code 0]
> [Inferior 1 (process 6868) exited normally]
> (gdb)
> 
> Which is dandy, but then why, outside of gdb, is there nothing at all?
> Still stumped!

Is your prompt overwriting the output of the program?

Try:

$ hello | cat
$ hello | grep ello

etc.

-- 
cyg Simple

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



Re: Compiled programs fail to run from Cygwin Terminal, but work from windows cmd

2017-06-22 Thread Wouter van Doorn
Hi René,

Thanks for your attempts at having me dig deeper. So far, I am not
striking lucky. Here's the various outputs, that don't say anything
obvious to me:
User-PC-> echo $PATH
/home/User/exe.CYGWIN:/home/User/bin:/usr/local/bin:/usr/bin:/cygdrive/c/ProgramData/Oracle/Java/javapath:/cygdrive/c/Program
Files/Dell/DW WLAN
Card:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/Program
Files/WIDCOMM/Bluetooth Software:/cygdrive/c/Program
Files/WIDCOMM/Bluetooth Software/syswow64:/cygdrive/c/Program
Files/Git/cmd:/usr/bin:.:/cygrive/c/cygwin/bin:/cygdrive/c/cygwin/bin

===>so yes, /usr/bin is there.

User-PC-> ldd hello.exe
ntdll.dll => /cygdrive/c/Windows/SysWOW64/ntdll.dll (0x7772)
kernel32.dll => /cygdrive/c/Windows/syswow64/kernel32.dll (0x768b)
KERNELBASE.dll => /cygdrive/c/Windows/syswow64/KERNELBASE.dll
(0x7723)
cygwin1.dll => /usr/bin/cygwin1.dll (0x6100)

===>no missing items

User-PC-> file hello.exe
hello.exe: PE32 executable (console) Intel 80386, for MS Windows

===>nothing here that worries me either.

Any other thoughts?

No doubt overdone, but here's the code:
User-PC-> cat hello.c
#include 

int main(int arg, char **argv) {
printf("Hello, world!\n");
}

and compilation was just by make hello... The simplest thing ever,
you'd say... The only real clue as far as I can see is the exception
in the last line but one of the strace output. But I don't know how to
read that.

STOP PRESS: in gdb, the output IS there:
User-PC-> gdb hello.exe
GNU gdb (GDB) (Cygwin 7.10.1-1) 7.10.1
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
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-pc-cygwin".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from hello.exe...done.
(gdb) run
Starting program: /home/User/c_dir/hello.exe
[New Thread 6868.0x5b0]
[New Thread 6868.0x18dc]
[New Thread 6868.0x1990]
Hello, world!
[Thread 6868.0x1990 exited with code 0]
[Inferior 1 (process 6868) exited normally]
(gdb)

Which is dandy, but then why, outside of gdb, is there nothing at all?
Still stumped!

Wouter

On 21 June 2017 at 22:48, René Berber  wrote:
> On 6/21/2017 4:10 PM, Wouter van Doorn wrote:
>
>> Having installed Cygwin with no errors I could see, I went on to
>> compile and run "hello world" - as you do. I could make it go from a
>> windows command prompt after modifying the system path to include
>> cygwin\bin, so - so far so good.
>>
>> From the cygwin terminal, however, the same executable refuses to play
>> ball. No text is shown; the command prompt returns instantly.
> [snip]
>
> It could be the program itself, i.e. not coded for a Posix environment,
> or it could be your PATH which should include /usr/bin (as shown, not as
> a Windows path C:\...)
>
> Easiest way to figure it out is by running:
>
> $ ldd hello (or whatever the name of your executable is)
> (sample output)
> ntdll.dll => /cygdrive/c/WINDOWS/SYSTEM32/ntdll.dll (0x7ffaf660)
> ??? => ??? (0x7779)
> wow64.dll => /cygdrive/c/WINDOWS/System32/wow64.dll (0x5aa4)
> wow64win.dll => /cygdrive/c/WINDOWS/System32/wow64win.dll
> (0x5aaa)
>
> In this case the missing cygwin1.dll doesn't even show its name, it
> happens to be the 32-bit version, because I ran ldd from a 64-bit Cygwin
> on a 32-bit Cygwin program, my PATH doesn't include the cygwin 32-bit
> binary directory.
>
> And if that doesn't show the missing libraries, then even
>
> $ file hello
>
> could show a clue, like "PE32+ executable (GUI) x86-64 (stripped to
> external PDB), for MS Windows" which is a GUI program compiled with
> MinGW, i.e. doesn't depend on Cygwin.  Cygwin is not mentioned in the
> output of file, even a Cygwin console program shows something like "PE32
> executable (console) Intel 80386, for MS Windows" or "PE32+ executable
> (console) x86-64, for MS Windows".
>
> Hope this helps.
> --
> R. Berber
>
>
> --
> Problem reports:   http://cygwin.com/problems.html
> FAQ:   http://cygwin.com/faq/
> Documentation: http://cygwin.com/docs.html
> Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
>

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

Re: Compiled programs fail to run from Cygwin Terminal, but work from windows cmd

2017-06-21 Thread René Berber
On 6/21/2017 4:10 PM, Wouter van Doorn wrote:

> Having installed Cygwin with no errors I could see, I went on to
> compile and run "hello world" - as you do. I could make it go from a
> windows command prompt after modifying the system path to include
> cygwin\bin, so - so far so good.
> 
> From the cygwin terminal, however, the same executable refuses to play
> ball. No text is shown; the command prompt returns instantly.
[snip]

It could be the program itself, i.e. not coded for a Posix environment,
or it could be your PATH which should include /usr/bin (as shown, not as
a Windows path C:\...)

Easiest way to figure it out is by running:

$ ldd hello (or whatever the name of your executable is)
(sample output)
ntdll.dll => /cygdrive/c/WINDOWS/SYSTEM32/ntdll.dll (0x7ffaf660)
??? => ??? (0x7779)
wow64.dll => /cygdrive/c/WINDOWS/System32/wow64.dll (0x5aa4)
wow64win.dll => /cygdrive/c/WINDOWS/System32/wow64win.dll
(0x5aaa)

In this case the missing cygwin1.dll doesn't even show its name, it
happens to be the 32-bit version, because I ran ldd from a 64-bit Cygwin
on a 32-bit Cygwin program, my PATH doesn't include the cygwin 32-bit
binary directory.

And if that doesn't show the missing libraries, then even

$ file hello

could show a clue, like "PE32+ executable (GUI) x86-64 (stripped to
external PDB), for MS Windows" which is a GUI program compiled with
MinGW, i.e. doesn't depend on Cygwin.  Cygwin is not mentioned in the
output of file, even a Cygwin console program shows something like "PE32
executable (console) Intel 80386, for MS Windows" or "PE32+ executable
(console) x86-64, for MS Windows".

Hope this helps.
-- 
R. Berber


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



Compiled programs fail to run from Cygwin Terminal, but work from windows cmd

2017-06-21 Thread Wouter van Doorn
Hi,

Having installed Cygwin with no errors I could see, I went on to
compile and run "hello world" - as you do. I could make it go from a
windows command prompt after modifying the system path to include
cygwin\bin, so - so far so good.

>From the cygwin terminal, however, the same executable refuses to play
ball. No text is shown; the command prompt returns instantly.

I have tried looking in the mailing list archive, and the answer may
well be there (in which case I apologise). But the searches I have
tried either returned nothing, or an incredible amount of information
that was not apparently relevant to my problem.

Maybe the attached strace output tells somebody something; to me its
only helpful thing is that it shows that the cygwin1.dll is found and
loaded, which eliminates the most likely potential problem that I
could see. Dependency Walker only mutters about 64-bit and 32-bit
libraries being mixed, but as the program runs under the Windows
command prompt, I am discounting that as a reason for the failure.

All the standard pre-compiled utilities I tried run as expected from
the cygwin terminal.

I'd be very grateful for a pointer!
Wouter van Doorn


cygcheck.out
Description: Binary data


hello.strace.out
Description: Binary data

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