[so] more parser/robocheck bugreports

Bogdan Luca so@cursuri.cs.pub.ro
Wed, 10 Nov 2004 02:23:23 +0200


Salut,

Inca una (robocheck / Windows):
3. Creez un proces cu 'CreateProcess(..., &piProcInfo);', dupa care fac 
un 'CloseHandle(piProcInfo.hThread);', moment in care programul crapa cu 
un segfault:
----
Program received signal SIGSEGV, Segmentation fault.
0x77c42a16 in _libmsvcrt_a_iname ()
(gdb) bt
#0  0x77c42a16 in _libmsvcrt_a_iname ()
#1  0x0022fd74 in ?? ()
#2  0x77c42101 in _libmsvcrt_a_iname ()
#3  0x63982793 in ABORT (
     format=0x63981b10 "trying to release invalid resource 0x%x at %s:%d\n")
     at misc.c:23
#4  0x63981b82 in robocheck_release_resource (descriptor=4294969272, 
line=439,
     file=0x403b99 "exec.c") at resources.c:69
#5  0x63981cff in robocheck_CloseHandle (line=439, file=0x403b99 "exec.c",
     h=0x7b8) at resources.c:194
...
#9  0x00404d2d in main () at main.c:33
----
, deci la crearea unui proces cu 'CreateProcess(..., &piProcInfo);' ar 
trebui tinut cont si de handle-ul 'piProcInfo.hThread'.
(Citez din MSDN:
----
Remarks

If the function [CreateProcess] succeeds, be sure to call the 
CloseHandle function to close the hProcess and hThread handles when you 
are finished with them. Otherwise, when the child process exits, the 
system cannot clean up these handles because the parent process did not 
close them. However, the system will close these handles when the parent 
process terminates, so they would be cleaned up at this point.
----

Bogdan Luca
345CA

Bogdan Luca wrote:
> 
> Salut,
> 
> 2 chestii:
> 1. M-am chinuit vreo jumatate de ora sa-mi dau seama de ce nu se 
> compileaza in Windows parser-ul cu robocheck.
> ----
> C:\msys\1.0\home\Bogdan Luca\so\tema1>grep -B2 -n WORD parser.tab.h
> 30-      know about them.  */
> 31-   enum yytokentype {
> 32:     WORD = 258,
> -- 
> 47-   };
> 48-#endif
> 49:#define WORD 258
> ----
> Problema ar fi ca parser.tab.h defineste 'WORD' ca fiind '258', dupa 
> care include 'robocheck.h', care la randul lui include 'windows.h' (unde 
> 'WORD' ar trebui sa fie un tip definit ca in 'windef.h:234:typedef 
> unsigned short WORD;'), rezultatul constand intr-o eroare de compilare. 
> Solutia ar fi inlocuirea identificatorului 'WORD' cu orice alta denumire 
> care sa nu fie folosita in alte headere (eu am folosit 'MYWORD').
> 
> 2. Se pare ca robocheck ignora exclude-urile atunci cand face check-ul 
> 'at process exit':
> ----
> C:\msys\1.0\home\Bogdan Luca\so\tema1>grep -n exclude main.c
> 16:    robocheck_set_exclude("lex.yy.c");
> C:\msys\1.0\home\Bogdan Luca\so\tema1>shell.exe
> # exit
> 
> heap leak at process exit:3748: 003F1FFC/4 allocated by lex.yy.c:1720
> heap leak at process exit:3748: 00591FFE/16386 allocated by lex.yy.c:1720
> heap leak at process exit:3748: 00581FD0/48 allocated by lex.yy.c:1720
> ----
> 
> Bogdan Luca
> 345CA
> 
> _______________________________________________
> so mailing list
> so@cursuri.cs.pub.ro
> http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so