Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » Possible bug in LocalProcess
Possible bug in LocalProcess [message #47665] Mon, 27 February 2017 00:20 Go to next message
mdelfede is currently offline  mdelfede
Messages: 1259
Registered: September 2007
Senior Contributor
Hi,
using LocalProcess I got a bug which makes it work only FIRST time it's called, then fail.
Dumping 'args' variable in LocalProcess::DoStart() gives following :

args = [/home/massimo/.FishIDE/packages/fishino/tools/pic32-tools/4.8.3-pic32gcc/bin/pic32-gcc, .....


on first call, and

args = [FreeFreeFreeFreeFreeFreeFreeFreeFreeFreeFreeFreeFreeFreeFreeFreeFreeFreeFreeFreeFreeFreeFreeFree@, -c, -g, .....


on next calls.
Adding an args.Clear() at beginning of the function solves the problem :

bool LocalProcess::DoStart(const char *command, const Vector<String> *arg, bool spliterr, const char *envptr)
{
	LLOG("LocalProcess::Start(\"" << command << "\")");
	args.Clear();  <=== HERE!
	Kill();


here the dumps :

args = [/home/massimo/.FishIDE/packages/fishino/tools/pic32-tools/4.8.3-pic32gcc/bin/pic32-gcc, -c, -g, -Os..... (first call)

args = [/home/massimo/.FishIDE/packages/fishino/tools/pic32-tools/4.8.3-pic32gcc/bin/pic32-gcc, -c, -g, -Os..... (second call)


Ciao

Massimo
Re: Possible bug in LocalProcess [message #47666 is a reply to message #47665] Mon, 27 February 2017 00:36 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1259
Registered: September 2007
Senior Contributor
Another problem : on second run (and following...) it will not gather error/output from process.
This seems solved adding an Init() along the former args.Clear():

bool LocalProcess::DoStart(const char *command, const Vector<String> *arg, bool spliterr, const char *envptr)
{
	LLOG("LocalProcess::Start(\"" << command << "\")");
	Kill();
args.Clear();   <==== HERE
Init();         <==== HERE


That's weird, I was using localprocess before and it did work. Maybe some changes ?
(system.: Ubuntu Linux 64 bit)
Re: Possible bug in LocalProcess [message #47678 is a reply to message #47666] Sat, 04 March 2017 14:56 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12098
Registered: November 2005
Ultimate Member
Hi,

sorry for the bug, I guess nobody used LocalProcess second time yet. But it has to work obviously.

I have used different way to fix the issue, because calling Init clears all features of LocalProcess (e.g. ConvertCharset flag). I have also added reusing LocalProcess to autotest.

Mirek
Re: Possible bug in LocalProcess [message #47681 is a reply to message #47678] Sun, 05 March 2017 12:46 Go to previous message
mdelfede is currently offline  mdelfede
Messages: 1259
Registered: September 2007
Senior Contributor
Thank you!
Previous Topic: Small bug in DeleteFolderDeep
Next Topic: new operator declared twice in MinGW TDM
Goto Forum:
  


Current Time: Thu Nov 14 20:45:55 CET 2019

Total time taken to generate the page: 0.01211 seconds