osdir.com
mailing list archive

Subject: Re: force stdio from newlib/cegcc.dll - msg#00099

List: gnu.cegcc.devel

Date: Prev Next Index Thread: Prev Next Index


Pedro Alves wrote:
> Please don't top post.

Oops, sorry. I have limited experience posting to mailing lists like
this one, so
my apologies for poor etiquette.

> Ximsce wrote:
>> I don't get any int return warnings, the only output from compilation is:
>>
>> Info: resolving _CRT_MT by linking to __imp__CRT_MT (auto-import)
>>
>> which has something to do with multi-threading, I believe.
>
> OK, this is normal.
>
> Below is
>> almost the exact code that worked yesterday morning (I unfortunately
>> don't have an exact copy of the code that worked), before I started to
>> complicate things. If I comment out the execv(), everything else works.
>> I have tested the lame.exe by itself, and it works, too. I am
>> compiling with arm-wince-cegcc-gcc and then copying to Windows Mobile 5.
>>
>> char *args[3];
>> args[0] = LAME_EXECUTABLE;
>> args[1] = TEST_WAV_FILE;
>> args[2] = TEST_MP3_OUT;
>>
>> execv(LAME_EXECUTABLE, args);
>>
>
> You didn't NULL terminate the argument list:
> http://www.opengroup.org/onlinepubs/000095399/functions/exec.html
>
> "The argument argv is an array of character pointers to
> null-terminated strings. The application shall ensure that the last
> member of this array is a null pointer. These strings shall constitute
> the argument list available to the new process image. The value in
> argv[0] should point to a filename that is associated with the process
> being started by one of the exec functions."
>
> Try this:
>
> char *args[4];
> args[0] = LAME_EXECUTABLE;
> args[1] = TEST_WAV_FILE;
> args[2] = TEST_MP3_OUT;
> args[3] = NULL;
>
> execv(LAME_EXECUTABLE, args);
>
> Cheers,
> Pedro Alves
>

Right, that was a slight typo on my part. I've added the NULL
termination, now the
program sort of works. When I run it the first time, the log file gets
created, but
execution appears to still fail on the execv(). If I run the program a
second time,
then the execv() appears to run (the file encoded by lame appears), but
then the log
file is locked and not written too, as well as the exe for my
application, and the pop
up dialog signaling completion never shows. Needless to say, strange
behavior. I am going
to try exception handling again, maybe that will turn up something.

Thanks,
Matt

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/


Was this page helpful?
Yes No
Thread at a glance:

Previous Message by Date: click to view message preview

Re: CeGCC 0.50 has been released

On Tue, 2007-06-19 at 22:57 +0200, Carsten Sørensen wrote: > On 19/06/07, Danny Backx > <danny.backx-rJAIWvhRp0CZIoH1IeqzKA@xxxxxxxxxxxxxxxx> wrote: > > We've just released CeGCC 0.50 - the first stable release of the CeGCC > > tool family : > > - arm-wince-mingw32ce-* tools (recommended) > > - arm-wince-cegcc-* tools (includes unix-like layer) > > (sorry about the triple post Danny) > > Great! I'd like to make good on my offer to build binaries for OSX, > has this release been tagged in SVN? Or just a revision number to > build from would be fine. It is a tag in SVN : dannypc: {206} svn info cegcc-0.50/ Path: cegcc-0.50 URL: https://svn.sourceforge.net/svnroot/cegcc/tags/cegcc-0.50 ... > I have to idea how to get the resulting files to you though, it's > 2x100 MB (one package for x86 and one for PowerPC, each package > contains both cegcc and mingw32ce) No need to get them to me, you can upload to sourceforge and then Pedro or I can move them from the upload area to the download area. Basically all you need to do is ftp upload.sf.net cd /incoming put your-file bye and convince Pedro or myself to pick up your-file quickly enough before it gets deleted. (/incoming is temporary storage) Danny -- Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info signature.asc Description: This is a digitally signed message part ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/_______________________________________________ Cegcc-devel mailing list Cegcc-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/cegcc-devel

Next Message by Date: click to view message preview

Re: CeGCC 0.50 has been released

On 20/06/07, Danny Backx <danny.backx-rJAIWvhRp0CZIoH1IeqzKA@xxxxxxxxxxxxxxxx> wrote: > Basically all you need to do is > ftp upload.sf.net > cd /incoming > put your-file > bye OK! I decided at the last minute to mimic your packages so cegcc and mingw32ce both get their own package. Looks like you're stripping executables so I did that as well in my build script, which instantly halved the size of the packages. I've uploaded four files in /incoming for OSX: cegcc-0.50-i386.dmg mingw32ce-0.50-i386.dmg cegcc-0.50-powerpc.dmg mingw32ce-0.50-powerpc.dmg Hopefully you or Pedro will grab them before they go away. Regards, Carsten Sorensen ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/

Previous Message by Thread: click to view message preview

Re: force stdio from newlib/cegcc.dll

Please don't top post. Ximsce wrote: > I don't get any int return warnings, the only output from compilation is: > > Info: resolving _CRT_MT by linking to __imp__CRT_MT (auto-import) > > which has something to do with multi-threading, I believe. OK, this is normal. Below is > almost the exact code that worked yesterday morning (I unfortunately > don't have an exact copy of the code that worked), before I started to > complicate things. If I comment out the execv(), everything else works. > I have tested the lame.exe by itself, and it works, too. I am > compiling with arm-wince-cegcc-gcc and then copying to Windows Mobile 5. > > char *args[3]; > args[0] = LAME_EXECUTABLE; > args[1] = TEST_WAV_FILE; > args[2] = TEST_MP3_OUT; > > execv(LAME_EXECUTABLE, args); > You didn't NULL terminate the argument list: http://www.opengroup.org/onlinepubs/000095399/functions/exec.html "The argument argv is an array of character pointers to null-terminated strings. The application shall ensure that the last member of this array is a null pointer. These strings shall constitute the argument list available to the new process image. The value in argv[0] should point to a filename that is associated with the process being started by one of the exec functions." Try this: char *args[4]; args[0] = LAME_EXECUTABLE; args[1] = TEST_WAV_FILE; args[2] = TEST_MP3_OUT; args[3] = NULL; execv(LAME_EXECUTABLE, args); Cheers, Pedro Alves ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/

Next Message by Thread: click to view message preview

Re: force stdio from newlib/cegcc.dll

On Tue, 2007-06-19 at 19:52 -0600, Ximsce wrote: > Pedro Alves wrote: > > You didn't NULL terminate the argument list: > > http://www.opengroup.org/onlinepubs/000095399/functions/exec.html > > > > "The argument argv is an array of character pointers to > > null-terminated strings. The application shall ensure that the last > > member of this array is a null pointer. These strings shall constitute > > the argument list available to the new process image. The value in > > argv[0] should point to a filename that is associated with the process > > being started by one of the exec functions." Even though the comments about the argv argument are accurate, this may not be the right reference to quote from. I've been looking for reference material on MSDN. Here's one : http://msdn2.microsoft.com/en-us/library/431x4c1w(VS.80).aspx The reason I'm being picky on this is I suspect that behaviour for open files may be different as well. The MSDN doc states three things that catch my attention : - deprecated API - open files remain open but you must flush before exec - translation mode of open files may change But more importantly, I have my suspicions about your source. I think the MSDN docs say that exec doesn't return (unless something went wrong), but spawn can be used with a parameter to make it create a new process. See http://msdn2.microsoft.com/en-us/library/20y988d2(VS.80).aspx and look into what _P_WAIT means. I suspect that you really want to replace the execv call by a spawn call with this parameter. I've tweaked your source a bit. You'll see an execv call, and a spawnv call. Depending on which one you comment out, the application behaves differently. Also note the fflush statement before execv or spawn. With execv the original application is *replaced* by the second one, so the END: text is never printed, the "Execution Complete" dialog is never shown. With spawnv, both do happen. Danny -- Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info exec1.c Description: Text Data exec2.c Description: Text Data signature.asc Description: This is a digitally signed message part ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/_______________________________________________ Cegcc-devel mailing list Cegcc-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/cegcc-devel
Sign up for updates to this mailing list. email:
Loading Comments...
Home | News | Patents | Sitemap | FAQ | advertise

Advertising by