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
Explicit system signal handlers #776
Conversation
Threading issue likely originated from maintaining data structure integrity for random particle selection. Now removed list of pointers and shifted this functionality to ParticlePool, to avoid any accidental pointer invalidation.
Test for ability to set signal handlers at configure step, and generate static lookup table of error messages during configure step. Delete piped images if program is terminated abruptly.
As discussed in #758.
I'll take a look when I get the chance, but it might be a while before I
find the time. On my way back from Greece right now, and I'll have a fair
backlog to get through once back at my desk...
Can you explain what's not working on Windows? Does it fail to compile, or
does it fail to handle signals as expected at runtime?
And why the need to re-configure? Is it just to enable the feature, or is
there some actual configuration required?
|
It claims that some of the structures / functions used in constructing the handlers are not defined, despite having found the appropriate system header file. But there has been other weirdness associated with my Windows install so who knows if it's just me.
If certain systems (like mine) don't provide adequate support for constructing the signal handlers, then pulling such an update would cause compilation to fail, which would result in a lot of angry discussion forum posts. This is avoided by testing for support of the functionality in |
OK, sure, it it fails to compile on certain platforms, you'd need to deal with that. But wouldn't it be possible to prevent the use of signal handlers on Windows while we figure out how to get it working, and assume it's always supported on Linux and MacOSX? In which case all you'd need is the already-defined |
Possibly. But I don't know whether or not it works on different versions of Windows (I already know that the same MSYS installer file results in different installations on Windows 7 and Windows 8.1), it hasn't been tested on Mac, so I went for the direct testing approach without assumptions. If you'd rather do more widespread testing in the hope of not depending on a |
Yes, it would be worth checking on MacOSX - I don't expect any problems particularly, it's a UNIX system. Windows on the other hand will rely on some serious MinGW boilerplate code... |
On Windows, use the semi-depreciated signal() function rather than sigaction(). This also means that testing signal handling as part of the configure script is no longer necessary.
Use basic C functions and an atomic_flag in signal handling to reduce chances of further corruption.
Did some more tweaking on this since I want to include it in the upcoming tag. No longer requires re-running Remaining question is to do with standalone installations. While the signal symbol names should be consistent between systems, the integer codes aren't guaranteed to be. Therefore, if compiling on one system and running on another, incorrect error messages may be displayed. I could either add an environment variable flag to |
mrconvert: fix segfault for out of range coord
… into mrconvert_coord_segfault
Mrconvert coord non-negativity test
Fix multithreading issues in global tractography.
mrview: display extended gbtable in properties box
Mrtransform directions
This addresses the huge drop in performance observed with Eigen 3.3, as discussed in #833.
dwidenoise: add brackets to final recombine step
Package mrtrix update #834
mrtransform: apply the inverse transformation to DW gradients
Just thought I'd update this thread with what I've been trying. The hurdle right now is getting this to work on Windows. It's not a deal-breaker since it doesn't interfere with current behaviour, and basically doesn't change anything - temporaries don't get cleaned just as is the case now... But it would be nice to get it to work. So I've tried @Lestropie's Otherwise, we're still waiting on confirmation that this works on MacOSX... Anyone....? 😉 |
Sounds like on Windows it's the terminal emulator gobbling up the signal, so not something we're likely to have a quick solution to. But the code might as well sit there just in case. I might merge this into |
Not sure it's simple as the terminal eating it up. Git manages to catch the interrupt (says |
I'd seen more abstract descriptions of that type of solution. But because we're not waiting on user input via P.S. When you say "Git catches the interrupt", do you mean |
OK, clearly you've had a good look through this, it's a lot more complicated than it looks... Let's shelve and let them sort this out in due course.
That was Anyway, let's call it a day for now... |
Ah. I think the download is called "Git for Windows", but the shortcut you get in the Start Menu gets called "Git Bash". Whatevs. |
Awaiting confirmation from the supreme allied commander @jdtournier that we're going to go with this solution, and testing on Mac.
Unfortunately the handling doesn't work on my Windows laptop; hence testing the capability in
configure
and only enabling the feature if an environment variable is explicitly set (so compilation doesn't fail on such systems if the update is pulled butconfigure
is not re-run).Closes #758.