Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WillRaiseAttribute memory leak #206

Open
alexvulpe opened this issue May 23, 2018 · 6 comments
Open

WillRaiseAttribute memory leak #206

alexvulpe opened this issue May 23, 2018 · 6 comments

Comments

@alexvulpe
Copy link

alexvulpe commented May 23, 2018

[Test, WillRaise(EJobNotAllowed)]
procedure TestError;

Test passes, but when app closes FastMM4 reports memory leak.
If using
Assert.WillRaise(TestError, EJobNotAllowed)
everthing is fine, no memory leaks.

@skermajo
Copy link

Also seeing this - below is an example FastMM stack trace for one of the leaked blocks:

A memory block has been leaked. The size is: 52

This block was allocated by thread 0x3558, and the stack trace (return addresses) at the time was:
409C66 [System][@GetMem$qqri]
40C3FF [System][TObject.NewInstance$qqrv]
40CC12 [System][@ClassCreate$qqrpvzc]
5D640F [DUnitX.WeakReference][Generics.Collections.%TList__1$pv%.$bctr$qqrv]
409C32 [System][AllocMem$qqri]
40CEF2 [System][TMonitor.Create$qqrv]
5D5F09 [DUnitX.WeakReference][Weakreference.TWeakReferencedObject.AddWeakRef$qqrpv]
4128A8 [System][@IntfCast$qqrr44System.%DelphiInterface$17System.IInterface%x44System.%DelphiInterface$17System.IInterface%rx5_GUID]
40C893 [System][@IsClass$qqrxp14System.TObjectp17System.TMetaClass]
40C8BE [System][@AsClass$qqrxp14System.TObjectp17System.TMetaClass]
5F52FE [DUnitX.TestResult][Weakreference.%TWeakReference__1$57System.%DelphiInterface$30Dunitx.Testframework.ITestInfo%%.$bctr$qqrx57System.%DelphiInterface$30Dunitx.Testframework.ITestInfo%]
40C408 [System][TObject.NewInstance$qqrv]
5F4986 [DUnitX.TestResult][Testresult.TDUnitXTestResult.$bctr$qqrx57System.%DelphiInterface$30Dunitx.Testframework.ITestInfo%x36Dunitx.Testframework.TTestResultTypex20System.UnicodeStringx56System.%DynamicArray$32Dunitx.Testframework.TLogMessage%]
607010 [DUnitX.TestRunner][Testrunner.TDUnitXTestRunner.ExecuteSuccessfulResult$qqrx72System.%DelphiInterface$45Dunitx.Internalinterfaces.ITestExecuteContext%xuix53System.%DelphiInterface$26Dunitx.Extensibility.ITest%x20System.UnicodeStringx56System.JzUhU2QduHE
6072DC [DUnitX.TestRunner][Testrunner.TDUnitXTestRunner.ExecuteTest$qqrx72System.%DelphiInterface$45Dunitx.Internalinterfaces.ITestExecuteContext%xuix53System.%DelphiInterface$26Dunitx.Extensibility.ITest%x66System.%DelphiInterface$39Dunitx.Testframe80bE8DBKc5m
607870 [DUnitX.TestRunner][Testrunner.TDUnitXTestRunner.ExecuteTestSetupMethod$qqrx72System.%DelphiInterface$45Dunitx.Internalinterfaces.ITestExecuteContext%xuix60System.%DelphiInterface$33Dunitx.Extensibility.ITestFixture%x53System.%DelphiInterface$7n7pIA56nA1
607513 [DUnitX.TestRunner][Testrunner.TDUnitXTestRunner.ExecuteTests$qqrx72System.%DelphiInterface$45Dunitx.Internalinterfaces.ITestExecuteContext%xuix60System.%DelphiInterface$33Dunitx.Extensibility.ITestFixture%x62System.%DelphiInterface$35Dunitx.TSfr3igC6GY1
606BE8 [DUnitX.TestRunner][Testrunner.TDUnitXTestRunner.ExecuteFixtures$qqrx62System.%DelphiInterface$35Dunitx.Testframework.IFixtureResult%x72System.%DelphiInterface$45Dunitx.Internalinterfaces.ITestExecuteContext%xuix64System.%DelphiInterface$37DunwCT0JAspu9l
606C15 [DUnitX.TestRunner][Testrunner.TDUnitXTestRunner.ExecuteFixtures$qqrx62System.%DelphiInterface$35Dunitx.Testframework.IFixtureResult%x72System.%DelphiInterface$45Dunitx.Internalinterfaces.ITestExecuteContext%xuix64System.%DelphiInterface$37DunwCT0JAspu9l
606C15 [DUnitX.TestRunner][Testrunner.TDUnitXTestRunner.ExecuteFixtures$qqrx62System.%DelphiInterface$35Dunitx.Testframework.IFixtureResult%x72System.%DelphiInterface$45Dunitx.Internalinterfaces.ITestExecuteContext%xuix64System.%DelphiInterface$37DunwCT0JAspu9l
606C15 [DUnitX.TestRunner][Testrunner.TDUnitXTestRunner.ExecuteFixtures$qqrx62System.%DelphiInterface$35Dunitx.Testframework.IFixtureResult%x72System.%DelphiInterface$45Dunitx.Internalinterfaces.ITestExecuteContext%xuix64System.%DelphiInterface$37DunwCT0JAspu9l

The block is currently used for an object of class: TList<System.Pointer>

@vincentparrett
Copy link
Member

Is this still a problem with the current source?

@alexvulpe
Copy link
Author

Yes, it is.

@vincentparrett
Copy link
Member

Please submit a PR with a unit test that shows this and I'll take a stab at it.

@alexvulpe
Copy link
Author

alexvulpe commented Apr 16, 2020

How can I create a branch in order to put the unit test and create a PR?
I tried and failed because have no access to do it.

@vincentparrett
Copy link
Member

Fork the repository in Github, clone the fork to your machine.
In your clone, create a branch
https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging
add the unit test and then push your branch (git push), go to your fork in github and you will see it prompting you to create a pull request.

https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants