diff options
| author | ghost <andreas.monzner@multimedia-labs.de> | 2008-11-18 16:17:41 +0100 |
|---|---|---|
| committer | ghost <andreas.monzner@multimedia-labs.de> | 2008-11-18 16:17:41 +0100 |
| commit | 101e31a8ac8bc5dd6712f244356826dc082dc73d (patch) | |
| tree | 0a4e7d97c6b377616ab2c78b81df62483988b8d8 | |
| parent | ea644879586a9472041552d84dd7b7ebba29ec3e (diff) | |
| parent | d924772eeced2429c007e51ce6dcb50dadec2836 (diff) | |
| download | enigma2-101e31a8ac8bc5dd6712f244356826dc082dc73d.tar.gz enigma2-101e31a8ac8bc5dd6712f244356826dc082dc73d.zip | |
Merge branch 'master' of git.opendreambox.org:/git/enigma2
| -rw-r--r-- | lib/base/eerror.cpp | 12 | ||||
| -rw-r--r-- | lib/python/python.cpp | 16 | ||||
| -rw-r--r-- | main/bsod.cpp | 51 | ||||
| -rw-r--r-- | main/bsod.h | 2 | ||||
| -rw-r--r-- | main/enigma.cpp | 2 |
5 files changed, 45 insertions, 38 deletions
diff --git a/lib/base/eerror.cpp b/lib/base/eerror.cpp index 1e4d348f..4c4d6551 100644 --- a/lib/base/eerror.cpp +++ b/lib/base/eerror.cpp @@ -77,7 +77,7 @@ int logOutputConsole=1; static pthread_mutex_t DebugLock = PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP; -extern void bsodFatal(); +extern void bsodFatal(const char *component); void eFatal(const char* fmt, ...) { @@ -86,10 +86,12 @@ void eFatal(const char* fmt, ...) va_start(ap, fmt); vsnprintf(buf, 1024, fmt, ap); va_end(ap); - singleLock s(DebugLock); - logOutput(lvlFatal, "FATAL: " + std::string(buf) + "\n"); - fprintf(stderr, "FATAL: %s\n",buf ); - bsodFatal(); + { + singleLock s(DebugLock); + logOutput(lvlFatal, "FATAL: " + std::string(buf) + "\n"); + fprintf(stderr, "FATAL: %s\n",buf ); + } + bsodFatal("enigma2"); } #ifdef DEBUG diff --git a/lib/python/python.cpp b/lib/python/python.cpp index 50b66103..c5faeed4 100644 --- a/lib/python/python.cpp +++ b/lib/python/python.cpp @@ -5,7 +5,7 @@ extern "C" void init_enigma(); extern "C" void eBaseInit(void); extern "C" void eConsoleInit(void); -extern void bsodFatal(); +extern void bsodFatal(const char *component); #define SKIP_PART2 #include <lib/python/python.h> @@ -44,7 +44,7 @@ ePyObject::operator PyObject*() if (m_file) eDebug("last modified in file %s line %d from %d to %d", m_file, m_line, m_from, m_to); - bsodFatal(); + bsodFatal("enigma2, refcnt"); } return 0; } @@ -57,7 +57,7 @@ void ePyObject::incref(const char *file, int line) if (m_file) eDebug("last modified in file %s line %d from %d to %d", m_file, m_line, m_from, m_to); - bsodFatal(); + bsodFatal("enigma2, refcnt"); } if (m_erased || m_ob->ob_refcnt <= 0) { @@ -66,7 +66,7 @@ void ePyObject::incref(const char *file, int line) if (m_file) eDebug("last modified in file %s line %d from %d to %d", m_file, m_line, m_from, m_to); - bsodFatal(); + bsodFatal("enigma2, refcnt"); } if (m_ob->ob_refcnt == 0x7FFFFFFF) { @@ -75,7 +75,7 @@ void ePyObject::incref(const char *file, int line) if (m_file) eDebug("last modified in file %s line %d from %d to %d", m_file, m_line, m_from, m_to); - bsodFatal(); + bsodFatal("enigma2, refcnt"); } m_file = file; m_line = line; @@ -92,7 +92,7 @@ void ePyObject::decref(const char *file, int line) if (m_file) eDebug("last modified in file %s line %d from %d to %d", m_file, m_line, m_from, m_to); - bsodFatal(); + bsodFatal("enigma2, refcnt"); } if (m_erased || m_ob->ob_refcnt <= 0) { @@ -101,7 +101,7 @@ void ePyObject::decref(const char *file, int line) if (m_file) eDebug("last modified in file %s line %d from %d to %d", m_file, m_line, m_from, m_to); - bsodFatal(); + bsodFatal("enigma2, refcnt"); } m_file = file; m_line = line; @@ -207,7 +207,7 @@ int ePython::call(ePyObject pFunc, ePyObject pArgs) eDebug("(PyObject_CallObject(%s,%s) failed)", PyString_AS_STRING(FuncStr), PyString_AS_STRING(ArgStr)); Py_DECREF(FuncStr); Py_DECREF(ArgStr); - bsodFatal(); + bsodFatal(0); } } return res; diff --git a/main/bsod.cpp b/main/bsod.cpp index 173a2cce..583107d7 100644 --- a/main/bsod.cpp +++ b/main/bsod.cpp @@ -67,7 +67,7 @@ extern std::string getLogBuffer(); #define INFOFILE "/maintainer.info" -void bsodFatal() +void bsodFatal(const char *component) { char logfile[128]; sprintf(logfile, "/media/hdd/enigma2_crash_%u.log", (unsigned int)time(0)); @@ -81,30 +81,35 @@ void bsodFatal() char crash_emailaddr[256] = CRASH_EMAILADDR; char crash_component[256] = "enigma2"; - while ((start = lines.find("\n File \"", start)) != std::string::npos) + if (component) + snprintf(crash_component, 256, component); + else { - start += 9; - size_t end = lines.find("\"", start); - if (end == std::string::npos) - break; - end = lines.rfind("/", end); - if (end == std::string::npos) - break; - if (end - start >= (256 - strlen(INFOFILE))) - continue; - char filename[256]; - snprintf(filename, 256, "%s%s", lines.substr(start, end - start).c_str(), INFOFILE); - FILE *cf = fopen(filename, "r"); - if (cf) + while ((start = lines.find("\n File \"", start)) != std::string::npos) { - fgets(crash_emailaddr, sizeof crash_emailaddr, cf); - if (*crash_emailaddr && crash_emailaddr[strlen(crash_emailaddr)-1] == '\n') - crash_emailaddr[strlen(crash_emailaddr)-1] = 0; + start += 9; + size_t end = lines.find("\"", start); + if (end == std::string::npos) + break; + end = lines.rfind("/", end); + if (end == std::string::npos) + break; + if (end - start >= (256 - strlen(INFOFILE))) + continue; + char filename[256]; + snprintf(filename, 256, "%s%s", lines.substr(start, end - start).c_str(), INFOFILE); + FILE *cf = fopen(filename, "r"); + if (cf) + { + fgets(crash_emailaddr, sizeof crash_emailaddr, cf); + if (*crash_emailaddr && crash_emailaddr[strlen(crash_emailaddr)-1] == '\n') + crash_emailaddr[strlen(crash_emailaddr)-1] = 0; - fgets(crash_component, sizeof crash_component, cf); - if (*crash_component && crash_component[strlen(crash_component)-1] == '\n') - crash_component[strlen(crash_component)-1] = 0; - fclose(cf); + fgets(crash_component, sizeof crash_component, cf); + if (*crash_component && crash_component[strlen(crash_component)-1] == '\n') + crash_component[strlen(crash_component)-1] = 0; + fclose(cf); + } } } @@ -242,7 +247,7 @@ void handleFatalSignal(int signum, siginfo_t *si, void *ctx) oops(uc->uc_mcontext, signum == SIGSEGV || signum == SIGABRT); #endif eDebug("-------"); - bsodFatal(); + bsodFatal("enigma2, signal"); } void bsodCatchSignals() diff --git a/main/bsod.h b/main/bsod.h index aa8cfb74..4ee4c48b 100644 --- a/main/bsod.h +++ b/main/bsod.h @@ -3,6 +3,6 @@ void bsodLogInit(); void bsodCatchSignals(); -void bsodFatal(); +void bsodFatal(const char *component); #endif diff --git a/main/enigma.cpp b/main/enigma.cpp index 0893b035..98175c49 100644 --- a/main/enigma.cpp +++ b/main/enigma.cpp @@ -248,7 +248,7 @@ int main(int argc, char **argv) if (exit_code == 5) /* python crash */ { eDebug("(exit code 5)"); - bsodFatal(); + bsodFatal(0); } dsk.paint(); |
