Skip to content

Conversation

@ararslan
Copy link
Member

POSIX.1-2008 marks getitimer/setitimer obsolete in favor of timer_gettime/timer_settime. Additionally, POSIX.1-2017 marks SIGPROF obsolete. Thus we can make simply have FreeBSD use the same signals code paths as Linux, which already uses the timer API and uses SIGUSR1 rather than SIGPROF. The code conditional on the HAVE_ITIMER flag, as well as the flag itself, have been removed since they're no longer used.

Inexplicably fixes #48714 for me.

POSIX.1-2008 marks `getitimer`/`setitimer` obsolete in favor of
`timer_gettime`/`timer_settime`. Additionally, POSIX.1-2017 marks
`SIGPROF` obsolete. Thus we can make simply have FreeBSD use the same
signals code paths as Linux, which already uses the timer API and uses
`SIGUSR1` rather than `SIGPROF`.

The code conditional on the `HAVE_ITIMER` flag, as well as the flag
itself, have been removed since they're no longer used.
@ararslan
Copy link
Member Author

Weird, I did not get this locally:

cmdlineargs                                      (4) |         failed at 2023-03-21T02:00:25.487
Error During Test at /usr/home/julia/.buildkite-agent/builds/freebsd12-amdci6-1/julialang/julia-master/julia-044401cfcd/share/julia/test/cmdlineargs.jl:303
  Test threw exception
  Expression: string(cpu_threads) == read(`$exename --threads auto -e $code`, String) == read(`$exename --threads=auto -e $code`, String) == read(`$exename -tauto -e $code`, String) == read(`$exename -t auto -e $code`, String)
  failed process: Process(`/usr/home/julia/.buildkite-agent/builds/freebsd12-amdci6-1/julialang/julia-master/julia-044401cfcd/bin/julia -Cnative -J/usr/home/julia/.buildkite-agent/builds/freebsd12-amdci6-1/julialang/julia-master/julia-044401cfcd/lib/julia/sys.so --depwarn=error --check-bounds=yes -g1 --startup-file=no --startup-file=no --color=no -t auto -e 'print(Threads.threadpoolsize())'`, ProcessSignaled(6)) [0]
   
  Stacktrace:
   [1] pipeline_error
     @ ./process.jl:565 [inlined]
   [2] read(cmd::Cmd)
     @ Base ./process.jl:449
   [3] read(cmd::Cmd, #unused#::Type{String})
     @ Base ./process.jl:458
   [4] macro expansion
     @ /usr/home/julia/.buildkite-agent/builds/freebsd12-amdci6-1/julialang/julia-master/julia-044401cfcd/share/julia/stdlib/v1.10/Test/src/Test.jl:478 [inlined]
   [5] top-level scope
     @ /usr/home/julia/.buildkite-agent/builds/freebsd12-amdci6-1/julialang/julia-master/julia-044401cfcd/share/julia/test/cmdlineargs.jl:303

@giordano
Copy link
Member

We've seen that error on other platforms as well. CC @gbaraldi

@gbaraldi
Copy link
Member

Yeah, we usually get a segfault here when it errors, but it seems we got a sigabrt.

Copy link
Member

@vtjnash vtjnash left a comment

Choose a reason for hiding this comment

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

Do you want to use SIGPROF still, via setting:

    sigprof.sigev_signo = SIGPROF;

@ararslan
Copy link
Member Author

Do you want to use SIGPROF still

Nah, might as well just follow suit with what Linux is doing and use SIGUSR1 since it seems to work just fine and SIGPROF is apparently obsolete now. Also, I'm not sure why this works now when it was not working for me earlier as in our discussion in Slack, but ¯\_(ツ)_/¯

We've seen that error on other platforms as well.

Which ones? Is it sporadic or consistent? (I assume sporadic given that CI passed on other platforms in this PR.) We could try rerunning the FreeBSD tests and see whether it happens again.

Yeah, we usually get a segfault here when it errors, but it seems we got a sigabrt.

Huh. Well, I guess this isn't worse at least...

@vtjnash vtjnash merged commit 9c19f40 into master Mar 21, 2023
@vtjnash vtjnash deleted the aa/have-timer branch March 21, 2023 15:53
@ararslan
Copy link
Member Author

The cmdlineargs test failure didn't occur on the run triggered by the merge so I guess it's sporadic here as well

@giordano
Copy link
Member

I opened an issue about the cmdlineargs test failure: #49154

Xnartharax pushed a commit to Xnartharax/julia that referenced this pull request Apr 19, 2023
POSIX.1-2008 marks `getitimer`/`setitimer` obsolete in favor of
`timer_gettime`/`timer_settime`. Additionally, POSIX.1-2017 marks
`SIGPROF` obsolete. Thus we can make simply have FreeBSD use the same
signals code paths as Linux, which already uses the timer API and uses
`SIGUSR1` rather than `SIGPROF`.

The code conditional on the `HAVE_ITIMER` flag, as well as the flag
itself, have been removed since they're no longer used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Profile test fails on FreeBSD after 46571

4 participants