Log in

View Full Version : LINK problem?!


The_Philosopher
November 25th, 2002, 09:44
Hi

I don't know where is this problem...in olly's debugger or maybe in my system. Here is the problem. I make a program in RadASm. I compile it, and then link it without a problem. Then i run my program in debugger, execute it step by step and check it for errors. Then i press F9 to continue executing my program. Exit from program and press ALT+F2 (Close) in debugger. I fix problems in source, compile it again and then try to link. But here is the problem. I always receive error LINK : fatal error LNK1104: cannot open file x. When i quit debugger with ALT+X i can again link my program without problem. I email olly twice with this problem. First time he told me that there is no problem, and for second email i didn't receive reply. Maybe he think that i am fooling him. But this problem is still here. This is happening on win2k and on win95 (this 2 os's i test). Maybe TBD you can tell him about this or someone else can try something similar. Maybe this is only the problem with my system. I don't know.

Thanks

The_Philosopher

TBD
November 25th, 2002, 11:38
yup, the problem is there in win98 too. you must exit OD to free all file handles and restart OD. i will talk with Olly about this problem

The_Philosopher
November 25th, 2002, 11:52
Thanks TBD!

TBD
December 2nd, 2002, 08:03
The_Philosopher: Olly's response: "I have looked through the sources, and it looks like I free all allocated handles. If anybody has checked build of NT/2000 or some kind of API tracer, he can run OllyDbg and tell me which handles remain locked. Otherwise I have no ideas..."

i tested on NT and it frees all handles, i can delete the file after close.

can you try on win98 and prepare a bug report.

The_Philosopher
December 3rd, 2002, 08:43
I can't try it on win98. I try this on win95 (1st version) and same problem. Did he try with above explanation that i post (make an example in radasm, compile it, link it, run it with debugger, close debugged program, and then try again to link it....FAILUREEEEEEEE!!). But np...i can live with this problem.

The_Philosopher

Alienripper
January 11th, 2003, 11:40
Did you just shut down your program ? Or did you press Alt+F2 in OllyDbg to remove it from memory completely? I'm using WinME, and linking my programs works if I 'Close program' in OllyDbg..

blabberer
January 31st, 2003, 06:39
well i use windows 2000 (5.00.2195) and i too face this problem i link or buildall some asm(+res) with masm(hutchs package) then run olly on the exe find some problem so alt+f2 correct it and want to relink or rebuildall but link failure i have to shut down olly compleately to relink or rebuild

but i also noticed today that after copy to exe file then alt+f2 and then if i tried to delete the bak file it creates it does not let me delete it i have to close the olly compleatly to delete it i got a screen shot but

in windows 2000 it is damn annoying as you have to use runas everytime
so click +press shift+rightclick+ press runas+enter password+click ok

focht
February 1st, 2003, 02:56
Greets,

well i guess it depends how the application (debuggee) works.
Without looking deeper in ollydbg code i assume ollydbg calls "TerminateProcess()" API right away on "alt+f2".

Sometimes this has nasty side effects. As i mentionioned earlier in the thread "How do debuggers terminate the debuggee process?" the "TerminateProcess" API should only be used as *last* resort - when all other fails.

- it leaves named kernel synchronization objects like semaphores, mutexes in abandoned state - makes restart if application impossible if depends on (they will timeout after some time)
- kernel/user space object reference counts may not be decremented (=resource leaks)
- ...

There are occurrences where TerminateProcess() fails (process remains locked in memory) but win32 API returns errorcode "success" (subsequent requests with GetExitCodeProcess() fail with "access denied".

likely cause:

Pending i/o requests (file operations, sound (mci) output, ...)

This may be due to the nature how i/o requests are handled in kernel mode (IRPs) and user mode (APCs).

The issue that the process is unlocked when debugger terminates:

As i stated earlier in other thread, the termination of user mode debugger (namely its debug thread) terminates the debuggee as well. This behavior is by OS design and involves other steps than plain "TerminateProcess" API.

Advice: Use the termination procedures as decribed in "How do debuggers terminate the debuggee process?".

Regards,

Anastasius Focht

blabberer
February 1st, 2003, 03:59
hi focht,
i read that post(how to terminate) and this nice little explanation and probably oleh will read it too
by the way i started using 1.06 for this kind of jugglery (no admin warning so
the mind rests in peace close the debugger and restart(no right click no runas