printf statements not seen on STDOUT terminal

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

printf statements not seen on STDOUT terminal

saptha.global
Sub: printf statements not seen on STDOUT terminal
Hi,

Created an sample WxWidgets application( wx-config version : 2.8.12) on Debian  7.4 (wheezy) Linux platform.
In this sample application, calling another process (child process) using wxProcess() & wxExecute() function calls.
In the child process, we are using normal printf statements & we are expecting the same printf messages to be printed on the STDOUT terminal.

Case 1. We started child process using wxExecute() with flag = wxEXEC_ASYNC
Observation: In this case the child process printf statements are not printed on the STDOUT terminal.

Case 2: We started child process using wxExecute() with flag = wxEXEC_SYNC
Observation: In this case, the child process printf statement are printed on the STDOUT terminal.

Please find the code snippet:

void MyFrame::OnStart(wxCommandEvent& WXUNUSED(event))
{
   wxProcess *pHelpProcess = NULL;
   long m_helpProcessId;
    static const wxString CHILD_PROCESS_PATH = wxT("child"); // location of the child process executable
   
   wxMessageBox( "This is a wxWidgets' Clicked START Button",
                  "About WxWidgets", wxOK | wxICON_INFORMATION );
   
   pHelpProcess = new wxProcess(this,wxID_ANY);
   
   if(pHelpProcess)
    {
        // case 1 : not working, child output is not seen on STDOUT terminal
          m_helpProcessId = wxExecute(CHILD_PROCESS_PATH, wxEXEC_ASYNC, pHelpProcess);
        
        // case 2 working fine, child output is seen on STDOUT terminal
        //m_helpProcessId = wxExecute(CHILD_PROCESS_PATH, wxEXEC_SYNC, pHelpProcess);
        
    }
}
Is there any flags or rules to be set to see the child process printf messages on the STDOUT terminal.
Kindly provide your inputs.

Thanks & Regards,
Giri

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
 
To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: printf statements not seen on STDOUT terminal

oneeyeman
Hi,
2.8 is about 10 years old.
You need to use at least 3.1 and have Git HEAD compiled for testing purposes.

Thank you.


On Thu, Feb 9, 2017 at 1:17 AM,  <[hidden email]> wrote:

> Sub: printf statements not seen on STDOUT terminal
> Hi,
>
> Created an sample WxWidgets application( wx-config version : 2.8.12) on
> Debian  7.4 (wheezy) Linux platform.
> In this sample application, calling another process (child process) using
> wxProcess() & wxExecute() function calls.
> In the child process, we are using normal printf statements & we are
> expecting the same printf messages to be printed on the STDOUT terminal.
>
> Case 1. We started child process using wxExecute() with flag = wxEXEC_ASYNC
> Observation: In this case the child process printf statements are not
> printed on the STDOUT terminal.
>
> Case 2: We started child process using wxExecute() with flag = wxEXEC_SYNC
> Observation: In this case, the child process printf statement are printed on
> the STDOUT terminal.
>
> Please find the code snippet:
>
> void MyFrame::OnStart(wxCommandEvent& WXUNUSED(event))
> {
>    wxProcess *pHelpProcess = NULL;
>    long m_helpProcessId;
>     static const wxString CHILD_PROCESS_PATH = wxT("child"); // location of
> the child process executable
>
>    wxMessageBox( "This is a wxWidgets' Clicked START Button",
>                   "About WxWidgets", wxOK | wxICON_INFORMATION );
>
>    pHelpProcess = new wxProcess(this,wxID_ANY);
>
>    if(pHelpProcess)
>     {
>         // case 1 : not working, child output is not seen on STDOUT terminal
>           m_helpProcessId = wxExecute(CHILD_PROCESS_PATH, wxEXEC_ASYNC,
> pHelpProcess);
>
>         // case 2 working fine, child output is seen on STDOUT terminal
>         //m_helpProcessId = wxExecute(CHILD_PROCESS_PATH, wxEXEC_SYNC,
> pHelpProcess);
>
>     }
> }
> Is there any flags or rules to be set to see the child process printf
> messages on the STDOUT terminal.
> Kindly provide your inputs.
>
> Thanks & Regards,
> Giri
>
> --
> Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
>
> To unsubscribe, send email to [hidden email]
> or visit http://groups.google.com/group/wx-users

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: printf statements not seen on STDOUT terminal

saptha.global
Hi

Thanks for your response,

Yes tried in WxWidgets 3.1 & sample application is working fine in both cases:

1. wxExecute(CHILD_PROCESS_PATH, wxEXEC_ASYNC, pHelpProcess); 
2. wxExecute(CHILD_PROCESS_PATH, wxEXEC_SYNC, pHelpProcess); 

Observation: Yes in the child process, printf messages are seen on the STDOUT terminal.

wxWidgets 2.8.12:
--------------------------

1. wxExecute(CHILD_PROCESS_PATH, wxEXEC_ASYNC, pHelpProcess); 
Observation: child process printf messages not seen on the STDOUT terminal.

 Just wanted to know the root cause what changes might have fixed this issue. 
 It will be very helpful for me if you can just give an overview i.e fixes done to resolve above issue.

Inputs will be highly appreciated.

Thanks & Regards,
Giri


On Thursday, February 9, 2017 at 8:19:04 PM UTC+5:30, Igor Korot wrote:
Hi,
2.8 is about 10 years old.
You need to use at least 3.1 and have Git HEAD compiled for testing purposes.

Thank you.


On Thu, Feb 9, 2017 at 1:17 AM,  <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="89bXrvGQCAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">saptha...@...> wrote:

> Sub: printf statements not seen on STDOUT terminal
> Hi,
>
> Created an sample WxWidgets application( wx-config version : 2.8.12) on
> Debian  7.4 (wheezy) Linux platform.
> In this sample application, calling another process (child process) using
> wxProcess() & wxExecute() function calls.
> In the child process, we are using normal printf statements & we are
> expecting the same printf messages to be printed on the STDOUT terminal.
>
> Case 1. We started child process using wxExecute() with flag = wxEXEC_ASYNC
> Observation: In this case the child process printf statements are not
> printed on the STDOUT terminal.
>
> Case 2: We started child process using wxExecute() with flag = wxEXEC_SYNC
> Observation: In this case, the child process printf statement are printed on
> the STDOUT terminal.
>
> Please find the code snippet:
>
> void MyFrame::OnStart(wxCommandEvent& WXUNUSED(event))
> {
>    wxProcess *pHelpProcess = NULL;
>    long m_helpProcessId;
>     static const wxString CHILD_PROCESS_PATH = wxT("child"); // location of
> the child process executable
>
>    wxMessageBox( "This is a wxWidgets' Clicked START Button",
>                   "About WxWidgets", wxOK | wxICON_INFORMATION );
>
>    pHelpProcess = new wxProcess(this,wxID_ANY);
>
>    if(pHelpProcess)
>     {
>         // case 1 : not working, child output is not seen on STDOUT terminal
>           m_helpProcessId = wxExecute(CHILD_PROCESS_PATH, wxEXEC_ASYNC,
> pHelpProcess);
>
>         // case 2 working fine, child output is seen on STDOUT terminal
>         //m_helpProcessId = wxExecute(CHILD_PROCESS_PATH, wxEXEC_SYNC,
> pHelpProcess);
>
>     }
> }
> Is there any flags or rules to be set to see the child process printf
> messages on the STDOUT terminal.
> Kindly provide your inputs.
>
> Thanks & Regards,
> Giri
>
> --
> Please read <a href="http://www.wxwidgets.org/support/mlhowto.htm" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.wxwidgets.org%2Fsupport%2Fmlhowto.htm\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGeLI38cNrlq2cC-jNsMzVrvhdIVA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.wxwidgets.org%2Fsupport%2Fmlhowto.htm\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGeLI38cNrlq2cC-jNsMzVrvhdIVA&#39;;return true;">http://www.wxwidgets.org/support/mlhowto.htm before posting.
>
> To unsubscribe, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="89bXrvGQCAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">wx-users+u...@googlegroups.com
> or visit <a href="http://groups.google.com/group/wx-users" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://groups.google.com/group/wx-users&#39;;return true;" onclick="this.href=&#39;http://groups.google.com/group/wx-users&#39;;return true;">http://groups.google.com/group/wx-users

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
 
To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: printf statements not seen on STDOUT terminal

oneeyeman
Hi

On Thu, Feb 9, 2017 at 10:22 PM,  <[hidden email]> wrote:

> Hi
>
> Thanks for your response,
>
> Yes tried in WxWidgets 3.1 & sample application is working fine in both
> cases:
>
> 1. wxExecute(CHILD_PROCESS_PATH, wxEXEC_ASYNC, pHelpProcess);
> 2. wxExecute(CHILD_PROCESS_PATH, wxEXEC_SYNC, pHelpProcess);
>
> Observation: Yes in the child process, printf messages are seen on the
> STDOUT terminal.
>
> wxWidgets 2.8.12:
> --------------------------
>
> 1. wxExecute(CHILD_PROCESS_PATH, wxEXEC_ASYNC, pHelpProcess);
> Observation: child process printf messages not seen on the STDOUT terminal.
>
>  Just wanted to know the root cause what changes might have fixed this
> issue.
>  It will be very helpful for me if you can just give an overview i.e fixes
> done to resolve above issue.
>
> Inputs will be highly appreciated.

I don't think anybody can search a 10-years commit history and give you an  idea
of what fixed it.

You were advised on the forum to move to 3.1 - please do so and forget
about 2.8.

Thank you.

P.S.: Moreover you can try to do it yourself using "git bisect". However
this will be a waste of time as it's possible it is multiple commits that
fixed it. Also some classes might have been rewritten completely or
partially.

>
> Thanks & Regards,
> Giri
>
>
> On Thursday, February 9, 2017 at 8:19:04 PM UTC+5:30, Igor Korot wrote:
>>
>> Hi,
>> 2.8 is about 10 years old.
>> You need to use at least 3.1 and have Git HEAD compiled for testing
>> purposes.
>>
>> Thank you.
>>
>>
>> On Thu, Feb 9, 2017 at 1:17 AM,  <[hidden email]> wrote:
>> > Sub: printf statements not seen on STDOUT terminal
>> > Hi,
>> >
>> > Created an sample WxWidgets application( wx-config version : 2.8.12) on
>> > Debian  7.4 (wheezy) Linux platform.
>> > In this sample application, calling another process (child process)
>> > using
>> > wxProcess() & wxExecute() function calls.
>> > In the child process, we are using normal printf statements & we are
>> > expecting the same printf messages to be printed on the STDOUT terminal.
>> >
>> > Case 1. We started child process using wxExecute() with flag =
>> > wxEXEC_ASYNC
>> > Observation: In this case the child process printf statements are not
>> > printed on the STDOUT terminal.
>> >
>> > Case 2: We started child process using wxExecute() with flag =
>> > wxEXEC_SYNC
>> > Observation: In this case, the child process printf statement are
>> > printed on
>> > the STDOUT terminal.
>> >
>> > Please find the code snippet:
>> >
>> > void MyFrame::OnStart(wxCommandEvent& WXUNUSED(event))
>> > {
>> >    wxProcess *pHelpProcess = NULL;
>> >    long m_helpProcessId;
>> >     static const wxString CHILD_PROCESS_PATH = wxT("child"); // location
>> > of
>> > the child process executable
>> >
>> >    wxMessageBox( "This is a wxWidgets' Clicked START Button",
>> >                   "About WxWidgets", wxOK | wxICON_INFORMATION );
>> >
>> >    pHelpProcess = new wxProcess(this,wxID_ANY);
>> >
>> >    if(pHelpProcess)
>> >     {
>> >         // case 1 : not working, child output is not seen on STDOUT
>> > terminal
>> >           m_helpProcessId = wxExecute(CHILD_PROCESS_PATH, wxEXEC_ASYNC,
>> > pHelpProcess);
>> >
>> >         // case 2 working fine, child output is seen on STDOUT terminal
>> >         //m_helpProcessId = wxExecute(CHILD_PROCESS_PATH, wxEXEC_SYNC,
>> > pHelpProcess);
>> >
>> >     }
>> > }
>> > Is there any flags or rules to be set to see the child process printf
>> > messages on the STDOUT terminal.
>> > Kindly provide your inputs.
>> >
>> > Thanks & Regards,
>> > Giri
>> >
>> > --
>> > Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
>> >
>> > To unsubscribe, send email to [hidden email]
>> > or visit http://groups.google.com/group/wx-users
>
> --
> Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
>
> To unsubscribe, send email to [hidden email]
> or visit http://groups.google.com/group/wx-users

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users