Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
4,323
Issues
4,323
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
377
Merge Requests
377
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
035b8ebb
Commit
035b8ebb
authored
Mar 30, 2011
by
Simon Marlow
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a debug check for a non-empty FPU stack on x86 (see
#4914
)
parent
41147ad2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
0 deletions
+22
-0
rts/RtsStartup.c
rts/RtsStartup.c
+5
-0
rts/RtsUtils.c
rts/RtsUtils.c
+15
-0
rts/RtsUtils.h
rts/RtsUtils.h
+2
-0
No files found.
rts/RtsStartup.c
View file @
035b8ebb
...
@@ -345,6 +345,11 @@ hs_exit_(rtsBool wait_foreign)
...
@@ -345,6 +345,11 @@ hs_exit_(rtsBool wait_foreign)
OnExitHook
();
OnExitHook
();
// sanity check
#if defined(DEBUG)
checkFPUStack
();
#endif
// Free the full argv storage
// Free the full argv storage
freeFullProgArgv
();
freeFullProgArgv
();
...
...
rts/RtsUtils.c
View file @
035b8ebb
...
@@ -323,3 +323,18 @@ int rts_isProfiled(void)
...
@@ -323,3 +323,18 @@ int rts_isProfiled(void)
return
0
;
return
0
;
#endif
#endif
}
}
// Used for detecting a non-empty FPU stack on x86 (see #4914)
void
checkFPUStack
(
void
)
{
#ifdef x86_HOST_ARCH
static
unsigned
char
buf
[
108
];
asm
(
"FSAVE %0"
:
"=m"
(
buf
));
if
(
buf
[
8
]
!=
255
||
buf
[
9
]
!=
255
)
{
errorBelch
(
"NONEMPTY FPU Stack, TAG = %x %x
\n
"
,
buf
[
8
],
buf
[
9
]);
abort
();
}
#endif
}
rts/RtsUtils.h
View file @
035b8ebb
...
@@ -46,6 +46,8 @@ void printRtsInfo(void);
...
@@ -46,6 +46,8 @@ void printRtsInfo(void);
/* Alternate to raise(3) for threaded rts, for OpenBSD */
/* Alternate to raise(3) for threaded rts, for OpenBSD */
int
genericRaise
(
int
sig
);
int
genericRaise
(
int
sig
);
void
checkFPUStack
(
void
);
#include "EndPrivate.h"
#include "EndPrivate.h"
#endif
/* RTSUTILS_H */
#endif
/* RTSUTILS_H */
Herbert Valerio Riedel
🕺
@hvr
mentioned in commit
34eaf2b8
·
Dec 19, 2015
mentioned in commit
34eaf2b8
mentioned in commit 34eaf2b8d699c49ba367f26840052c8c9aa031b1
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment