Welcome! Log In Create A New Profile

Advanced

deleted code still compiled into dol

Posted by SteelSLasher 
deleted code still compiled into dol
August 15, 2009 12:55PM
In my current project i replaced the file download function with one from plaat's http lib, now for some reason when i run it and after it crashes the debug file contains debug strings from the older function which is deleted. I made a backup of the original file and put it somewhere faraway yet its still in there.

I also did a clean and then make but no difference.

I would fix the crash but due to the current problem there is no point trying since i can see that the older function is being run at the same time as the newer version and this would obviously cause problems when one returns before the other since that code that executed afterwards is completely fine.
Re: deleted code still compiled into dol
August 16, 2009 01:00PM
*BUMP*

Does anyone know why this happens, its quite annoying since I have nothing else to do right now
Re: deleted code still compiled into dol
August 16, 2009 03:23PM
Manually erase the contents of your "build" folder.
Re: deleted code still compiled into dol
August 16, 2009 04:15PM
Ask make to be verbose, I am sure that it can tell you exactly how it does the build.
Re: deleted code still compiled into dol
August 16, 2009 07:47PM
did both and nothing changed.

i checked the addresses in the code dump and found that the first five did not convert into a line number two of the five were exactly the same and the others were only different from one char.

The last address is 00000061 which must mean something is wrong
Re: deleted code still compiled into dol
August 17, 2009 02:14PM
I have been able to stop it crashing but the deleted debug code is still compiled even though it no longer exists

should i reinstall devkitpro since it seems to be less of my problem
Re: deleted code still compiled into dol
August 17, 2009 03:13PM
Quote

i can see that the older function is being run at the same time as the newer version and this would obviously cause problems when one returns before the other since that code that executed afterwards is completely fine.

how do you see this ?
are you using thread ? did you change the function names ? this is not possible otherwise

obviously, there is something wrong in your code, it might be a copypaste that ended up somewhere and was forgotten or a badly written makefile...

1/ look at your Makefile, especially the SOURCES and INCLUDES paths, make sure the code you don't want to compile is not in there. You can also post it somewher so we could doubleheck it, adding some flags (-Wall, -v) might also be useful
2/ look in your code for occurences of the debug string
Re: deleted code still compiled into dol
August 17, 2009 07:17PM
Quote

how do you see this ?
I made a debug function which writes a message to a text file and non-existant string are appearing

Quote

are you using thread ?
I am using the libwiigui template so yes a thread is involved

Quote

did you change the function names?
well, when i copied and pasted plaats http function instead of being return an int it would be extern bool so i changed that to int, i did later change the debug function to see if any errors would appear (obviously i changed the ones that needed changing). I changed a few other function names to see if it would tick but nada.

Quote

1/ look at your Makefile, especially the SOURCES and INCLUDES paths, make sure the code you don't want to compile is not in there. You can also post it somewher so we could doubleheck it, adding some flags (-Wall, -v) might also be useful
No other files exist in the sources directories which contain http functions, i see a -Wall flag for C but no -v flag

Quote

2/ look in your code for occurences of the debug string
That was the first thing i did an no occurences at all of some of the strings, there was one debug message which outputted some data from the socket buffer which still produces output after being deleted

Here is the makefile in case its wrong [onsinch.pastebin.com]

Here is the actual script which is problematic [code.google.com]

The rest of the source is here [code.google.com] (the makefile is also here but i forgot)
Re: deleted code still compiled into dol
August 18, 2009 12:40AM
Quote

2/ look in your code for occurences of the debug string

Does your .dol contain this debug string (just a sanity check)?
Which object file or library contains this debug string?

Once you know which object file contains this debug string, you should be able to figure out how it's getting linked into your app by looking at make's output. To get make to show you more of what it's doing, I modified the devkitPPC/wii_rules file, and removed the '@' signs in front of things like $(LD). There may be a command line option for make to achieve the same thing, but I couldn't find it.

Michael
Re: deleted code still compiled into dol
August 18, 2009 09:50AM
Quote

That was the first thing i did an no occurences at all of some of the strings, there was one debug message which outputted some data from the socket buffer which still produces output after being deleted

just to be sure, what's the debug messages which are NOT supposed to be output but are still visible ?
seems to me there are still a few debug messages in your code (DEBUG is undefined but Debug is still used... and defined somewhere)
Re: deleted code still compiled into dol
August 18, 2009 11:26AM
Quote
ekeeke
just to be sure, what's the debug messages which are NOT supposed to be output but are still visible ?
seems to me there are still a few debug messages in your code (DEBUG is undefined but Debug is still used... and defined somewhere)

"strncmp" used to be outputted but that still happens after it was removed

thats the same thing that buggered the wii's security, lol at the coincidence



Edited 1 time(s). Last edit at 08/18/2009 01:02PM by SteelSLasher.
Re: deleted code still compiled into dol
August 18, 2009 12:24PM
Quote

file_ptrs = fopen("fat://applog.txt", "a");

this might be stupid but you never know: do you delete the file applog.txt each time you run the application again ?
Because everything you write will append to what was already written, the content of the file is not reseted when you reopen it: it could be that some of your old debug messages are still in the file.

Or maybe you didn't properly deleted the file and it's still there in the file table (but not visible)...
You could try to only open the file once, with the "w" attribute, write to it in the Debug function and close it on exit to see if this solves things.

Also, I don't think "fat" is used anymore, you should think upgrading to a newer libfat.



Edited 1 time(s). Last edit at 08/18/2009 12:31PM by ekeeke.
Re: deleted code still compiled into dol
August 18, 2009 01:15PM
Quote
Michael
Quote

2/ look in your code for occurences of the debug string

Does your .dol contain this debug string (just a sanity check)?
Which object file or library contains this debug string?

Once you know which object file contains this debug string, you should be able to figure out how it's getting linked into your app by looking at make's output. To get make to show you more of what it's doing, I modified the devkitPPC/wii_rules file, and removed the '@' signs in front of things like $(LD). There may be a command line option for make to achieve the same thing, but I couldn't find it.

Michael

There is a flag you can add to make to make it verbose, it literally tells you in english what is happening and no incorrect files where compiled.

Also, I deleted and copied the file from another source and the problem persists.
Re: deleted code still compiled into dol
August 19, 2009 11:49AM
has anyone else been able to compile my code from SVN, if you run it from SD card it should create a file "applog.txt" at the root
Re: deleted code still compiled into dol
August 20, 2009 01:53PM
i was able to suppress most of the non-existent debug functions except for the one executed after the download is completed in the menu file. This concludes that it is a thread problem.

I was able to supress nonexistant strings by outputting the socket buffer to the debug file, i have no idea why it works except that it just does.
Re: deleted code still compiled into dol
August 20, 2009 08:03PM
Problem fixed to an extent that its not bothering me much, also finished the chunk decoder.
Sorry, only registered users may post in this forum.

Click here to login