rubberduck-vba / Rubberduck

Every programmer needs a rubberduck. COM add-in for the VBA & VB6 IDE (VBE).
https://rubberduckvba.com
GNU General Public License v3.0
1.91k stars 299 forks source link

Can't work with office 2019 in PowerPoint #6017

Open tyysoft opened 2 years ago

tyysoft commented 2 years ago

Rubberduck version information The info below can be copy-paste-completed from the first lines of Rubberduck's log or the About box:

Rubberduck version [2.5.2.6119]
Operating System: [Windows 10 professional. Windows nt 10.0.19042.0 x64]
Host Product: [Microsoft office x64]
Host Version: [16.0.10389.20033]
Host Executable: [PowerPoint.exe]

Description Can not parse VBA code , click refresh button on menu, it end immediately, and tool bar shows "unexpected error"

To Reproduce Steps to reproduce the behavior:

  1. Open a pptm file
  2. Alt + F11 open the VBA Editor
  3. Click menu rubberduck->refresh
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Logfile Rubberduck generates extensive logging in TRACE-Level. If no log was created at %APPDATA%\Rubberduck\Logs, check your settings. Include this log for bug reports about the behavior of Rubberduck.

For some reason, can't upload log file, the key message is : Rubberduck.parsing.vba.parsecoordinator; unexpected exception thrown in parsing run . (Thread 45).; System.overflowexception: value for int16 is too big or small.

Additional context Add any other context about the problem here.

void285 commented 10 months ago

Same error here, log:

2023-11-08 17:34:03.7020;INFO-2.5.9.6304;Rubberduck.Common.LogLevelHelper;
    Rubberduck version 2.5.9.6304 loading:
    Operating System: Windows 10 Education 2009 x64 (Microsoft Windows NT 10.0.19045.0)
    Host Product: Microsoft Office 2013 x64
    Host Version: 15.0.5589.1000
    Host Executable: EXCEL.EXE;
2023-11-08 17:34:05.2053;INFO-2.5.9.6304;Rubberduck.Parsing.VBA.RubberduckParserState;RubberduckParserState.StateChanged invocation 22 sets status to 'Started'.;
2023-11-08 17:34:05.4800;INFO-2.5.9.6304;Rubberduck.Parsing.VBA.RubberduckParserState;RubberduckParserState.StateChanged invocation 23 sets status to 'LoadingReference'.;
2023-11-08 17:34:05.5839;INFO-2.5.9.6304;Rubberduck.Parsing.Common.ParsingStageTimer;Loaded ComProjects for user projects in 98ms.;
2023-11-08 17:34:05.6049;ERROR-2.5.9.6304;Rubberduck.Parsing.VBA.ParseCoordinator;Unexpected exception thrown in parsing run on thread 14.;System.OverflowException: value for int16 is too big or small.
   at System.Convert.ToInt16(Char value)
   at Rubberduck.Parsing.VBA.Extensions.StringExtensions.ToVbExpression(String managed, Boolean useConsts)
   at Rubberduck.Parsing.ComReflection.DeclarationsFromComProjectLoader.GetDeclarationsForModule(IComType module, QualifiedModuleName moduleName, ProjectDeclaration project)
   at Rubberduck.Parsing.ComReflection.DeclarationsFromComProjectLoader.LoadDeclarations(ComProject type, String projectId)
   at Rubberduck.Parsing.VBA.DeclarationResolving.UserComProjectSynchronizer.LoadProjects(IEnumerable`1 projectIds)
   at Rubberduck.Parsing.VBA.DeclarationResolving.UserComProjectSynchronizer.SyncUserComProjects()
   at Rubberduck.Parsing.VBA.ParseCoordinator.SyncDeclarationsFromUserComProjects(IReadOnlyCollection`1 toParse, CancellationToken token, HashSet`1 toReresolveReferences)
   at Rubberduck.Parsing.VBA.ParseCoordinator.ExecuteCommonParseActivities(IReadOnlyCollection`1 toParse, IReadOnlyCollection`1 toReresolveReferencesInput, IReadOnlyCollection`1 newProjectIds, CancellationToken token)
   at Rubberduck.Parsing.VBA.ParseCoordinator.ParseAllInternal(Object requestor, CancellationToken token)
   at Rubberduck.Parsing.VBA.ParseCoordinator.ParseAll(Object requestor)
2023-11-08 17:34:05.6149;INFO-2.5.9.6304;Rubberduck.Parsing.VBA.RubberduckParserState;RubberduckParserState.StateChanged invocation 24 sets status to 'UnexpectedError'.;
2023-11-08 17:34:05.6149;INFO-2.5.9.6304;Rubberduck.Parsing.VBA.ParseCoordinator;Parsing run on thread 14 completed in 411ms.;
MDoerner commented 10 months ago

Thanks for reporting.

There seems to be conversion from Char to int16 in that method, which is not safe. I will change that to the appropriate int32 later.

Vogel612 commented 9 months ago

I am assuming that since the fix by @MDoerner this issue has no longer been appearing, as such I am closing this issue. If the problem persists, please reopen the issue with a logfile from the latest version :)

void285 commented 9 months ago

Hi, I just installed the latest version, and found the problem still there.

2023-12-25 01:37:43.7279;INFO-2.5.9.6316;Rubberduck.Common.LogLevelHelper;
   Rubberduck version 2.5.9.6316 loading:
   Operating System: Windows 10 Education 2009 x64 (Microsoft Windows NT 10.0.19045.0)
   Host Product: Microsoft Office 2013 x64
   Host Version: 15.0.5589.1000
   Host Executable: EXCEL.EXE;

2023-12-25 01:39:56.2759;INFO-2.5.9.6316;Rubberduck.Parsing.VBA.RubberduckParserState;RubberduckParserState.StateChanged invocation 31 sets status to 'Started'.;
2023-12-25 01:39:56.3410;INFO-2.5.9.6316;Rubberduck.Parsing.VBA.RubberduckParserState;RubberduckParserState.StateChanged invocation 32 sets status to 'LoadingReference'.;
2023-12-25 01:39:56.3510;INFO-2.5.9.6316;Rubberduck.Parsing.Common.ParsingStageTimer;Loaded ComProjects for user projects in 5ms.;
2023-12-25 01:39:56.3510;ERROR-2.5.9.6316;Rubberduck.Parsing.VBA.ParseCoordinator;Unexpected exception thrown in parsing run on thread 6.;System.OverflowException: value for int16 is too big or small.
   at System.Convert.ToInt16(Char value)
   at Rubberduck.Parsing.VBA.Extensions.StringExtensions.ToVbExpression(String managed, Boolean useConsts)
   at Rubberduck.Parsing.ComReflection.DeclarationsFromComProjectLoader.GetDeclarationsForModule(IComType module, QualifiedModuleName moduleName, ProjectDeclaration project)
   at Rubberduck.Parsing.ComReflection.DeclarationsFromComProjectLoader.LoadDeclarations(ComProject type, String projectId)
   at Rubberduck.Parsing.VBA.DeclarationResolving.UserComProjectSynchronizer.LoadProjects(IEnumerable`1 projectIds)
   at Rubberduck.Parsing.VBA.DeclarationResolving.UserComProjectSynchronizer.SyncUserComProjects()
   at Rubberduck.Parsing.VBA.ParseCoordinator.SyncDeclarationsFromUserComProjects(IReadOnlyCollection`1 toParse, CancellationToken token, HashSet`1 toReresolveReferences)
   at Rubberduck.Parsing.VBA.ParseCoordinator.ExecuteCommonParseActivities(IReadOnlyCollection`1 toParse, IReadOnlyCollection`1 toReresolveReferencesInput, IReadOnlyCollection`1 newProjectIds, CancellationToken token)
   at Rubberduck.Parsing.VBA.ParseCoordinator.ParseAllInternal(Object requestor, CancellationToken token)
   at Rubberduck.Parsing.VBA.ParseCoordinator.ParseAll(Object requestor)
2023-12-25 01:39:56.3510;INFO-2.5.9.6316;Rubberduck.Parsing.VBA.RubberduckParserState;RubberduckParserState.StateChanged invocation 33 sets status to 'UnexpectedError'.;
2023-12-25 01:39:56.3590;INFO-2.5.9.6316;Rubberduck.Parsing.VBA.ParseCoordinator;Parsing run on thread 6 completed in 83ms.;
retailcoder commented 9 months ago

System.OverflowException: value for int16 is too big or small.

Different host and system, but there must be another invalid pointer somewhere.