Differences in building with gcc 3.4.6 versus gcc 4.4.0 ? - page 2 - General Discussion and Assistance - CHDK Forum

Differences in building with gcc 3.4.6 versus gcc 4.4.0 ?

  • 33 Replies
  • 9706 Views
*

Offline whim

  • ******
  • 2013
  • A495/590/620/630 ixus70/115/220/230/300/870 S95
Re: Differences in building with gcc 3.4.6 versus gcc 4.4.0 ?
« Reply #10 on: 23 / April / 2011, 17:11:23 »
Advertisements
@waterwingz

Perfectly illustrates why CHDK-Shell defaults to keeping dowloaded archives ... ;)

wim

*

Offline reyalp

  • ******
  • 11902
Re: Differences in building with gcc 3.4.6 versus gcc 4.4.0 ?
« Reply #11 on: 23 / April / 2011, 17:18:08 »
Strange thing is that philmoz specially said that the gcc4 compiler barfed without his changes.  Making a buffer bigger never hurts but you would not think it would be compiler specific.
Phil and cppasm both seemed confident that gcc4.4 was just generating invalid code. I took their word for it but I'll have to go through and look again.

If it is too small (and I wouldn't enlarge it without verifying) then it wouldn't be a surprise at all if it changed depending on the compiler, because what got overwritten would depend on what the compiler happened to put near it. Changing the initialization would also have the same effect.
Don't forget what the H stands for.

Re: Differences in building with gcc 3.4.6 versus gcc 4.4.0 ?
« Reply #12 on: 23 / April / 2011, 17:35:33 »
Perfectly illustrates why CHDK-Shell defaults to keeping dowloaded archives ... ;)
Okay - rub it in.  I was cursing the day I asked you to put in the function to delete old versions.  As one of my mentors once told me "Be careful what you ask for,  you might just get it.".

Still,  I had a few of the older version zip files backed up.  And unless I had updated the trunk via CHDK-shell at least every day (or more often - reyalp is VERY proficient at pushing out changes) I would still have been looking at a search through each update for when the problem crept in.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Differences in building with gcc 3.4.6 versus gcc 4.4.0 ?
« Reply #13 on: 23 / April / 2011, 17:39:29 »
If it is too small (and I wouldn't enlarge it without verifying) then it wouldn't be a surprise at all if it changed depending on the compiler, because what got overwritten would depend on what the compiler happened to put near it. Changing the initialization would also have the same effect.
Is there a C programmer in the world who has not been bitten by a buffer that was just a little too small or a buffer missing the magic 0x00 when using strcpy and its brothers ?  At one point in my embedded systems career,  I actually thought about removing all string functions that did not include a buffer length ( i.e.  strncat vs strcat ).


Ported :   A1200    SD940   G10    Powershot N    G16


*

Offline reyalp

  • ******
  • 11902
Re: Differences in building with gcc 3.4.6 versus gcc 4.4.0 ?
« Reply #14 on: 23 / April / 2011, 18:00:13 »
Here's a patch to test size issue. It displays the 16 bytes after the normal 40 byte de in misc debug vals. Before readdir has been used, it should be zeros. After it has been used it should all be 0xdededede. If dirent is bigger, it should be something else...
Don't forget what the H stands for.

Re: Differences in building with gcc 3.4.6 versus gcc 4.4.0 ?
« Reply #15 on: 23 / April / 2011, 18:24:13 »
Here's a patch to test size issue. It displays the 16 bytes after the normal 40 byte de in misc debug vals. Before readdir has been used, it should be zeros. After it has been used it should all be 0xdededede. If dirent is bigger, it should be something else...
Made the change,  loaded and shot a couple of pix.  The debug stayed at 00000000.   Fired up the menu,  went to file browser and all four lines of the debug read dededede afterwards.

Pretty much what you were expecting.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline reyalp

  • ******
  • 11902
Re: Differences in building with gcc 3.4.6 versus gcc 4.4.0 ?
« Reply #16 on: 23 / April / 2011, 19:07:10 »
Here's a patch to test size issue. It displays the 16 bytes after the normal 40 byte de in misc debug vals. Before readdir has been used, it should be zeros. After it has been used it should all be 0xdededede. If dirent is bigger, it should be something else...
Made the change,  loaded and shot a couple of pix.  The debug stayed at 00000000.   Fired up the menu,  went to file browser and all four lines of the debug read dededede afterwards.

Pretty much what you were expecting.

Well if they all stayed de, then it looks like dirent hasn't gotten bigger than 40 bytes, which leaves us without a cause for the crash. Possibly it expects it to be initialized to zeros I guess.
Don't forget what the H stands for.

Re: Differences in building with gcc 3.4.6 versus gcc 4.4.0 ?
« Reply #17 on: 23 / April / 2011, 19:19:05 »
Well if they all stayed de, then it looks like dirent hasn't gotten bigger than 40 bytes, which leaves us without a cause for the crash. Possibly it expects it to be initialized to zeros I guess.
Oh oh .. it gets better. Did a little more exploring - using File Browser to explore for files buried deeper in the directory structure.  And guess what ?  When I go deeper I get :

d:             0
d: 12cea600
d: 12cea600
d: 12cea600

on the debug display.   Interesting.


Ported :   A1200    SD940   G10    Powershot N    G16


*

Offline reyalp

  • ******
  • 11902
Re: Differences in building with gcc 3.4.6 versus gcc 4.4.0 ?
« Reply #18 on: 23 / April / 2011, 19:38:25 »
Based on sub_FF95B0E4 in ixus120 103c, I'd guess dirent should be 64 bytes

edit
probably applies to all dryos R39 and later cams.
« Last Edit: 23 / April / 2011, 19:46:06 by reyalp »
Don't forget what the H stands for.

*

Offline reyalp

  • ******
  • 11902
Don't forget what the H stands for.

 

Related Topics