Comments (3)
It looks like we're overflowing the stack on MacOSX due to all foo[PATH_MAX] arrays allocated out of the stack.
This should fix it:
diff --git a/common/os_posix.cpp b/common/os_posix.cpp
index 98a790b..15999a9 100644
--- a/common/os_posix.cpp
+++ b/common/os_posix.cpp
@@ -67,7 +67,7 @@ ReleaseMutex(void)
bool
GetProcessName(char *str, size_t size)
{
- char szProcessPath[PATH_MAX + 1];
+ static char szProcessPath[PATH_MAX + 1];
char *lpProcessName;
// http://stackoverflow.com/questions/1023306/finding-current-executables-path-without-proc-self-exe
diff --git a/common/trace_local_writer.cpp b/common/trace_local_writer.cpp
index e560e49..299878a 100644
--- a/common/trace_local_writer.cpp
+++ b/common/trace_local_writer.cpp
@@ -77,7 +77,7 @@ LocalWriter::open(void) {
static unsigned dwCounter = 0;
const char *szExtension = "trace";
- char szFileName[PATH_MAX];
+ static char szFileName[PATH_MAX];
const char *lpFileName;
lpFileName = getenv("TRACE_FILE");
@@ -85,8 +85,8 @@ LocalWriter::open(void) {
strncpy(szFileName, lpFileName, PATH_MAX);
}
else {
- char szProcessName[PATH_MAX];
- char szCurrentDir[PATH_MAX];
+ static char szProcessName[PATH_MAX];
+ static char szCurrentDir[PATH_MAX];
OS::GetProcessName(szProcessName, PATH_MAX);
OS::GetCurrentDir(szCurrentDir, PATH_MAX);
from apitrace.
Formatting got broken. I'll try paste once again:
diff --git a/common/os_posix.cpp b/common/os_posix.cpp
index 98a790b..15999a9 100644
--- a/common/os_posix.cpp
+++ b/common/os_posix.cpp
@@ -67,7 +67,7 @@ ReleaseMutex(void)
bool
GetProcessName(char *str, size_t size)
{
- char szProcessPath[PATH_MAX + 1];
+ static char szProcessPath[PATH_MAX + 1];
char *lpProcessName;
// http://stackoverflow.com/questions/1023306/finding-current-executables-path-without-proc-self-exe
diff --git a/common/trace_local_writer.cpp b/common/trace_local_writer.cpp
index e560e49..299878a 100644
--- a/common/trace_local_writer.cpp
+++ b/common/trace_local_writer.cpp
@@ -77,7 +77,7 @@ LocalWriter::open(void) {
static unsigned dwCounter = 0;
const char *szExtension = "trace";
- char szFileName[PATH_MAX];
+ static char szFileName[PATH_MAX];
const char *lpFileName;
lpFileName = getenv("TRACE_FILE");
@@ -85,8 +85,8 @@ LocalWriter::open(void) {
strncpy(szFileName, lpFileName, PATH_MAX);
}
else {
- char szProcessName[PATH_MAX];
- char szCurrentDir[PATH_MAX];
+ static char szProcessName[PATH_MAX];
+ static char szCurrentDir[PATH_MAX];
OS::GetProcessName(szProcessName, PATH_MAX);
OS::GetCurrentDir(szCurrentDir, PATH_MAX);
I won't commit this immediately because static arrays are a bit unclean (subject to race conditions), but I don't want to use malloc here neither... I'll just have to think a bit more about this.
from apitrace.
This should be now fixed with commit 0a41c9b
from apitrace.
Related Issues (20)
- WINE applications do not produce any trace HOT 2
- GL game "Beyond All Reason" window overestimated by glretrace HOT 11
- Unvanquished fonts issues
- If I want to upgrade apitrace's support for OpenGL to version 4.6 HOT 1
- Replacement of shader via glDetachShader + glAttachShader leads to link error HOT 2
- eglretrace crashes on rayman2_gl trace
- Can Apitrace support retrace through EGL on Windows HOT 2
- loop option doesn't work for specific trace HOT 1
- retrace --loop crashes when VAO is created in setup frame and deleted in loop frame HOT 1
- Tellusim Upscaler (Star Wars) 20230513 trace doesn't work properly
- Failed to capture trace of wgf11filter HOT 1
- Build system complains about uncloned submodules for bundled dependencies even when using dependencies from system HOT 4
- Bug recording instanced draw calls with user arrays HOT 18
- [enhancement] replace zlib HOT 1
- Feature Request: Attach apitrace to Already Running Processes HOT 4
- During tracing gl-500-texture-cube-arb.exe, missing cube map HOT 2
- Wolfenstein: The Old Blood tracing broken due to abuse of GL_MAP_PERSISTENT_BIT mappings HOT 19
- trimming broken for some traces HOT 7
- capture/replay broken for indirect draws HOT 15
- Commit cff22f0 Introduces Segfault HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apitrace.