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

[Desktop] Test failure: PlatformHandler_HttpClientHandlerTest/ AllowAutoRedirect_True_ValidateNewMethodUsedOnRedirection #25740

Closed
danmoseley opened this issue Apr 3, 2018 · 2 comments
Labels
area-System.Net.Http test-bug Problem in test source code (most likely) test-run-desktop Test failures in .NET Framework "Desktop" test runs (running CoreFX test assets)
Milestone

Comments

@danmoseley
Copy link
Member

Failed on NETFX CI leg:

      System.Net.Http.Functional.Tests.PlatformHandler_HttpClientHandlerTest.AllowAutoRedirect_True_ValidateNewMethodUsedOnRedirection(statusCode: 307, oldMethod: "GET", newMethod: "GET") [FAIL]
        Canceled: 
        Expected: False
        Actual:   True
        Stack Trace:
             at System.Net.Http.Functional.Tests.HttpClientHandlerTest.<>c__DisplayClass50_2.<<AllowAutoRedirect_True_ValidateNewMethodUsedOnRedirection>b__1>d.MoveNext()
          --- End of stack trace from previous location where exception was thrown ---
             at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
             at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
             at System.Net.Test.Common.LoopbackServer.<CreateServerAsync>d__9.MoveNext()
          --- End of stack trace from previous location where exception was thrown ---
             at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
             at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
             at System.Net.Http.Functional.Tests.HttpClientHandlerTest.<>c__DisplayClass50_1.<<AllowAutoRedirect_True_ValidateNewMethodUsedOnRedirection>b__0>d.MoveNext()
          --- End of stack trace from previous location where exception was thrown ---
             at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
             at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
             at System.Net.Test.Common.LoopbackServer.<CreateServerAsync>d__9.MoveNext()
          --- End of stack trace from previous location where exception was thrown ---
             at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
             at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
             at System.Net.Http.Functional.Tests.HttpClientHandlerTest.<AllowAutoRedirect_True_ValidateNewMethodUsedOnRedirection>d__50.MoveNext()
          --- End of stack trace from previous location where exception was thrown ---
             at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
             at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
          --- End of stack trace from previous location where exception was thrown ---
             at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
             at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
          --- End of stack trace from previous location where exception was thrown ---
             at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
             at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
@karelz karelz changed the title PlatformHandler_HttpClientHandlerTest.AllowAutoRedirect_True_ValidateNewMethodUsedOnRedirection(statusCode: 307, oldMethod: "GET", newMethod: "GET") failed on NETFX CI leg [Desktop] Test failure: PlatformHandler_HttpClientHandlerTest/ AllowAutoRedirect_True_ValidateNewMethodUsedOnRedirection May 6, 2018
@davidsh
Copy link
Contributor

davidsh commented May 12, 2018

The test is failing here:
https://github.com/dotnet/corefx/blob/344c31c7ba9bc171bbab31167acdd279e9f6027c/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.cs#L777

The request seems to have been canceled. This is all using the loopback server. It's likely that some delay is happening starting these async tasks and HttpClient cancelled the request after the default 100 seconds.

@davidsh
Copy link
Contributor

davidsh commented May 12, 2018

We haven't seen this failure lately. So, I'm closing this issue.

@davidsh davidsh closed this as completed May 12, 2018
@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the 3.0 milestone Jan 31, 2020
eerhardt pushed a commit to eerhardt/runtime that referenced this issue Jan 31, 2020
Fix unhandled exception line number issues

There are a few paths to get the place (DebugStackTrace::DebugStackTraceElement::InitPass2) where
the offset/ip needs an adjustment:

1) The System.Diagnostics.StackTrace constructors that take an exception object. The stack trace in
   the exception object is used (from the _stackTrace field).
2) Processing an unhandled exception for display (ExceptionTracker::ProcessOSExceptionNotification).
3) The System.Diagnostics.StackTrace constructors that don't take an exception object that get the
   stack trace of the current thread.

For cases dotnet#1 and dotnet#2 the StackTraceInfo/StackTraceElement structs are built when the stack trace
for an exception is generated and is put in the private _stackTrace Exception object field. The
IP in each StackTraceElement is decremented for hardware exceptions and not for software exceptions
because the CrawlFrame isInterrupted/hasFaulted fields are not initialized (always false). This is
backwards for h/w exceptions leaf node frames but really can't be changed to be compatible with
other code in the runtime and SOS.

The fIsLastFrameFromForeignStackTrace BOOL in the StackTraceElement/DebugStackTraceElement structs
have been replaced with INT "flags" field defined by the StackTraceElementFlags enum. There is a new
flag that is set (STEF_IP_ADJUSTED) if the IP has been already adjusted/decremented. This flag is
used to adjust the native offset when it is converted to an IL offset for source/line number lookup
in DebugStackTraceElement::InitPass2().

When the stack trace for an exception is rendered to a string (via the GetStackFramesInternal FCALL)
the internal GetStackFramesData/DebugStackTraceElement structs are initialized. This new "flags"
field is passed from the StackTraceElement to the DebugStackTraceElement struct.

For case dotnet#3 all this happens in the GetStackFramesInternal FCALL called from the managed constructor
building the GetStackFramesData/DebugStackTraceElement structs directly.

Fixes issues dotnet#27765 and dotnet#25740.

Fix IL offset map search.
@ghost ghost locked as resolved and limited conversation to collaborators Dec 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Net.Http test-bug Problem in test source code (most likely) test-run-desktop Test failures in .NET Framework "Desktop" test runs (running CoreFX test assets)
Projects
None yet
Development

No branches or pull requests

3 participants