Skip to content

Conversation

@sunny868
Copy link
Contributor

@sunny868 sunny868 commented Aug 4, 2020

define SIGSTOP 19 is just ok for architecture x86、arm、s390、powerpc and so on.
but others architecture has different values.
For architecture mips,you can see kernel source code arch/mips/include/uapi/asm/signal.h

@Dotnet-GitSync-Bot
Copy link
Collaborator

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@dnfadmin
Copy link

dnfadmin commented Aug 4, 2020

CLA assistant check
All CLA requirements met.

@sunny868
Copy link
Contributor Author

sunny868 commented Aug 4, 2020

I'm not sure it's the best way to redefine SIGSTOP for architecture mips in Interop.Kill.cs. Maybe we can redefine SIGSTOP in pal_process.c :

_int32_t SystemNative_Kill(int32_t pid, int32_t signal)
{
#ifdef __TARGET_MIPS64_
if( signal == 19)
signal = SIGSTOP;
#endif
return kill(pid, signal);
}

@sunny868
Copy link
Contributor Author

sunny868 commented Aug 4, 2020

The 4 failing has nothing to do with this PR.

 define SIGSTOP 19 is just ok for architecture x86、arm、s390、powerpc and so on.
 but others architecture has different values.
 For architecture mips,you can see kernel source code arch/mips/include/uapi/asm/signal.h
@ghost
Copy link

ghost commented Aug 4, 2020

Tagging subscribers to this area: @eiriktsarpalis
See info in area-owners.md if you want to be subscribed.

 define SIGSTOP 19 is just ok for architecture x86、arm、s390、powerpc and so on.
 but others architecture has different values.
 For architecture mips,you can see kernel source code arch/mips/include/uapi/asm/signal.h

 Co-Authored-By: hev <[email protected]>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be better to define PAL_... specific enum in pal_process.h (similar to other enums that exist there already). This enum should have just the few signals that we actually need, and this remapping can then be done unconditionally, without hardcoding of magic numbers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm worried that more signals will be added in Interop.Kill.cs (internal enum Signals:int{..}) later.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If that happens, both places will need to be updated. It is same with all other PAL enums.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Comment on lines 659 to 668
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
signal = SIGSTOP;
}
signal = SIGSTOP;
break;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this can even be:

    switch (signal)
    {
        case PAL_SIGKILL:
             signal = SIGKILL;
             break;

        case PAL_SIGSTOP:
             signal = SIGSTOP;
             break;

        default:
             assert_msg(false, "Unknown signal");
             break;
    }

And delete c_static_assert(PAL_SIGKILL == SIGKILL); at the top of the file. I have verified that clang optimizes the switch out when the remap-signal numbers match.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

define SIGSTOP 19 is just ok for architecture x86、arm、s390、powerpc and so on.
but others architecture has different values.
For architecture mips,you can see kernel source code arch/mips/include/uapi/asm/signal.h

Co-Authored-By: hev <[email protected]>
@sunny868
Copy link
Contributor Author

sunny868 commented Aug 6, 2020

Maybe The 11 failing has nothing to do with this PR.

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@jkotas jkotas merged commit 0f7370b into dotnet:master Aug 6, 2020
@sunny868 sunny868 deleted the mips_branch branch August 6, 2020 06:20
@safern
Copy link
Member

safern commented Aug 6, 2020

@jkotas it seems like this PR was merged with System.Diagnostics.Process test failures hitting the assert that was added as part of this PR:

/root/helix/work/workitem /root/helix/work/workitem
  Discovering: System.Diagnostics.Process.Tests (method display = ClassAndMethod, method display options = None)
  Discovered:  System.Diagnostics.Process.Tests (found 235 of 291 test cases)
  Starting:    System.Diagnostics.Process.Tests (parallel test collections = on, max threads = 2)
    System.Diagnostics.Tests.ProcessStartInfoTests.ShellExecute_Nano_Fails_Start [SKIP]
      Condition(s) not met: "IsWindowsNanoServer"
Linux
Linux
Linux
Linux
None of the following programs were installed on this machine: xdg-open,gnome-open,kfmclient.
/__w/1/s/src/libraries/Native/Unix/System.Native/pal_process.c (665): error 0: Unknown signal (false failed)
Assertion failed: false && "assert_msg failed" (/__w/1/s/src/libraries/Native/Unix/System.Native/pal_process.c: SystemNative_Kill: 665)
./RunTests.sh: line 161:    24 Aborted                 (core dumped) "$RUNTIME_PATH/dotnet" exec --runtimeconfig System.Diagnostics.Process.Tests.runtimeconfig.json --depsfile System.Diagnostics.Process.Tests.deps.json xunit.console.dll System.Diagnostics.Process.Tests.dll -xml testResults.xml -nologo -nocolor -notrait category=IgnoreForCI -notrait category=OuterLoop -notrait category=failing $RSP_FILE
/root/helix/work/workitem

safern added a commit that referenced this pull request Aug 6, 2020
@safern
Copy link
Member

safern commented Aug 6, 2020

I put up a revert here: #40470

@jkotas
Copy link
Member

jkotas commented Aug 6, 2020

I am sorry. Once I have seen the known problem "CannotRemoveAttribute : Attribute 'System.ComponentModel.TypeConverterAttribute' exists on 'System.ComponentModel.MarshalByValueComponent' " , I have stopped looking through all the failures.

@jkotas
Copy link
Member

jkotas commented Aug 6, 2020

@sunny868 Could you please resubmit with the fix?

@safern
Copy link
Member

safern commented Aug 6, 2020

I am sorry. Once I have seen the known problem "CannotRemoveAttribute : Attribute 'System.ComponentModel.TypeConverterAttribute' exists on 'System.ComponentModel.MarshalByValueComponent' " , I have stopped looking through all the failures.

Yeah it is understandable when CI is on the floor because of other things, that things like this could slip through. I'm working on fixing the ApiCompat problem.

safern added a commit that referenced this pull request Aug 6, 2020
@sunny868
Copy link
Contributor Author

sunny868 commented Aug 6, 2020

@sunny868 Could you please resubmit with the fix?

Sorry, I I forgot to reset value "Interop.Sys.Signals.None" to PAL_NONE . I'll resubmit it later.

@sunny868 sunny868 changed the title Define SIGSTOP 23 for architecture mips Redefine signal for architecture mips Aug 7, 2020
@sunny868
Copy link
Contributor Author

sunny868 commented Aug 7, 2020

@jkotas I have resubmit it ,please review : #40513

Jacksondr5 pushed a commit to Jacksondr5/runtime that referenced this pull request Aug 10, 2020
 define SIGSTOP 19 is just ok for architecture x86、arm、s390、powerpc and so on.
 but others architecture has different values.

 Co-Authored-By: hev <[email protected]>
Jacksondr5 pushed a commit to Jacksondr5/runtime that referenced this pull request Aug 10, 2020
@karelz karelz added this to the 5.0.0 milestone Aug 18, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants