Offre découverte Domaine.fr - .COM, .FR, ... 19 Euros/an
by Domaine.fr - Domaine.info
Cher Entrepreneur,
A l'occasion du lancement de sa version 3, Domaine.fr, vous invite à découvrir sa nouvelle interface révolutionnaire et intuitive, en profitant de l'offre exceptionnelle de 29 euros HT/an sur les enregistrements des extensions Génériques et Françaises (.COM, .FR, .NET, .ORG, .INFO, .BIZ).
Votre portefeuille de nom de domaine est un bien immateriel précieux telle une marque; sa gestion ou sa protection est essentielle pour le bon fonctionnement et la présence de votre présence internet. les outils innovants de domaine.fr ont été élaborés au fil de plus d'une decennie d'expérience de passionnés. Connectez-vous sur notre site d'information Domaine.info et posez vos questions à nos spécialistes gratuitement.
Rappel : Le .TEL est toujours à 19 euros HT/an.
Tous les détails sur les services inclus avec vos noms de domaine sont disponibles sur Domaine.fr
Retrouvez-nous sur :
Pour ne plus recevoir cette lettre de diffusion, envoyez un simple email à remove
Cher Entrepreneur,
A l'occasion du lancement de sa version 3, Domaine.fr, vous invite à découvrir sa nouvelle interface révolutionnaire et intuitive, en profitant de l'offre exceptionnelle de 29 euros HT/an sur les enregistrements des extensions Génériques et Françaises (.COM, .FR, .NET, .ORG, .INFO, .BIZ).
Votre portefeuille de nom de domaine est un bien immateriel précieux telle une marque; sa gestion ou sa protection est essentielle pour le bon fonctionnement et la présence de votre présence internet. les outils innovants de domaine.fr ont été élaborés au fil de plus d'une decennie d'expérience de passionnés. Connectez-vous sur notre site d'information Domaine.info et posez vos questions à nos spécialistes gratuitement.
Rappel : Le .TEL est toujours à 19 euros HT/an.
Tous les détails sur les services inclus avec vos noms de domaine sont disponibles sur Domaine.fr
Retrouvez-nous sur :
Pour ne plus recevoir cette lettre de diffusion, envoyez un simple email à remove
13 years, 8 months
[PATCH] get rid of std::string& as parameter
by Nikola Pajkovsky
Signed-off-by: Nikola Pajkovsky <npajkovs(a)redhat.com>
---
lib/plugins/CCpp.cpp | 111 +++++++++++++++++++++++++++++---------------------
1 files changed, 64 insertions(+), 47 deletions(-)
diff --git a/lib/plugins/CCpp.cpp b/lib/plugins/CCpp.cpp
index 2e8b917..c6eafe8 100644
--- a/lib/plugins/CCpp.cpp
+++ b/lib/plugins/CCpp.cpp
@@ -31,6 +31,7 @@
#include "Polkit.h"
#include "backtrace.h"
#include "CCpp_sha1.h"
+#include "strbuf.h"
using namespace std;
@@ -113,7 +114,7 @@ static string create_hash(const char *pInput)
}
/* Returns status. See `man 2 wait` for status information. */
-static int ExecVP(char **pArgs, uid_t uid, int redirect_stderr, string& pOutput)
+static char* exec_vp(char **args, uid_t uid, int redirect_stderr, int *status)
{
/* Nuke everything which may make setlocale() switch to non-POSIX locale:
* we need to avoid having gdb output in some obscure language.
@@ -136,7 +137,7 @@ static int ExecVP(char **pArgs, uid_t uid, int redirect_stderr, string& pOutput)
VERB1 flags &= ~EXECFLG_QUIET;
int pipeout[2];
- pid_t child = fork_execv_on_steroids(flags, pArgs, pipeout, (char**)unsetenv_vec, /*dir:*/ NULL, uid);
+ pid_t child = fork_execv_on_steroids(flags, args, pipeout, (char**)unsetenv_vec, /*dir:*/ NULL, uid);
/* We use this function to run gdb and unstrip. Bugs in gdb or corrupted
* coredumps were observed to cause gdb to enter infinite loop.
@@ -144,15 +145,16 @@ static int ExecVP(char **pArgs, uid_t uid, int redirect_stderr, string& pOutput)
*/
int t = time(NULL); /* int is enough, no need to use time_t */
int endtime = t + 60;
+
+ struct strbuf *buf_out = strbuf_new();
+
while (1)
{
int timeout = endtime - t;
if (timeout < 0)
{
kill(child, SIGKILL);
- pOutput += "\nTimeout exceeded: 60 second, killing ";
- pOutput += pArgs[0];
- pOutput += "\n";
+ strbuf_append_strf(buf_out, "\nTimeout exceeded: 60 second, killing %s\n", args[0]);
break;
}
@@ -167,20 +169,20 @@ static int ExecVP(char **pArgs, uid_t uid, int redirect_stderr, string& pOutput)
if (r <= 0)
break;
buff[r] = '\0';
- pOutput += buff;
+ strbuf_append_str(buf_out, buff);
t = time(NULL);
}
close(pipeout[0]);
- int status;
- waitpid(child, &status, 0); /* prevent having zombie child process */
+ int st;
+ waitpid(child, &st, 0); /* prevent having zombie child process */
+ if (status)
+ *status = st;
- return status;
+ return strbuf_free_nobuf(buf_out);
}
-static bool GetBacktrace(const char *pDebugDumpDir,
- const char *pDebugInfoDirs,
- string& pBacktrace)
+static char *get_backtrace(const char *pDebugDumpDir, const char *pDebugInfoDirs)
{
update_client(_("Generating backtrace"));
@@ -246,12 +248,10 @@ static bool GetBacktrace(const char *pDebugDumpDir,
* BINARY_FILE if it is newer (to at least avoid gdb complaining).
*/
args[4] = (char*)"-ex";
- string file = ssprintf("file %s", executable.c_str());
- args[5] = (char*)file.c_str();
+ args[5] = xasprintf("file %s", executable.c_str());
args[6] = (char*)"-ex";
- string corefile = ssprintf("core-file %s/"FILENAME_COREDUMP, pDebugDumpDir);
- args[7] = (char*)corefile.c_str();
+ args[7] = xasprintf("core-file %s/"FILENAME_COREDUMP, pDebugDumpDir);
args[8] = (char*)"-ex";
/*args[9] = ... see below */
@@ -271,16 +271,19 @@ static bool GetBacktrace(const char *pDebugDumpDir,
/* Get the backtrace, but try to cap its size */
/* Limit bt depth. With no limit, gdb sometimes OOMs the machine */
unsigned bt_depth = 2048;
- const char *thread_apply_all = "thread apply all ";
+ const char *thread_apply_all = "thread apply all";
const char *full = " full";
+ char *bt = NULL;
while (1)
{
- string cmd = ssprintf("%sbacktrace %u%s", thread_apply_all, bt_depth, full);
- args[9] = (char*)cmd.c_str();
- pBacktrace = "";
- ExecVP(args, xatoi_u(UID.c_str()), /*redirect_stderr:*/ 1, pBacktrace);
- if (bt_depth <= 64 || pBacktrace.size() < 256*1024)
- return true;
+ args[9] = xasprintf("%s backtrace %u%s", thread_apply_all, bt_depth, full);
+ bt = exec_vp(args, xatoi_u(UID.c_str()), /*redirect_stderr:*/ 1, NULL);
+ if (bt && (bt_depth <= 64 || strlen(bt) < 256*1024))
+ {
+ free(args[9]);
+ break;
+ }
+
bt_depth /= 2;
if (bt_depth <= 64 && thread_apply_all[0] != '\0')
{
@@ -294,7 +297,12 @@ static bool GetBacktrace(const char *pDebugDumpDir,
bt_depth = 256;
full = "";
}
+ free(bt);
+ free(args[9]);
}
+ free(args[5]);
+ free(args[7]);
+ return bt;
}
static void GetIndependentBuildIdPC(const char *unstrip_n_output,
@@ -324,14 +332,14 @@ static void GetIndependentBuildIdPC(const char *unstrip_n_output,
}
}
-static string run_unstrip_n(const char *pDebugDumpDir)
+static char* run_unstrip_n(const char *pDebugDumpDir)
{
string UID;
CDebugDump dd;
if (!dd.Open(pDebugDumpDir))
{
VERB1 log(_("Unable to open debug dump '%s'"), pDebugDumpDir);
- return string("");
+ return NULL;
}
dd.LoadText(CD_UID, UID);
@@ -343,20 +351,19 @@ static string run_unstrip_n(const char *pDebugDumpDir)
args[2] = (char*)"-n";
args[3] = NULL;
- string output;
- ExecVP(args, xatoi_u(UID.c_str()), /*redirect_stderr:*/ 0, output);
+ char *out = exec_vp(args, xatoi_u(UID.c_str()), /*redirect_stderr:*/ 0, NULL);
free(args[1]);
- return output;
+ return out;
}
/* Needs gdb feature from here: https://bugzilla.redhat.com/show_bug.cgi?id=528668
* It is slated to be in F12/RHEL6.
+ *
+ * returened value must be freed
*/
-static void InstallDebugInfos(const char *pDebugDumpDir,
- const char *debuginfo_dirs,
- string& build_ids)
+static char *install_debug_infos(const char *pDebugDumpDir, const char *debuginfo_dirs)
{
update_client(_("Starting the debuginfo installation"));
@@ -397,7 +404,7 @@ static void InstallDebugInfos(const char *pDebugDumpDir,
{
close(pipeout[0]);
waitpid(child, NULL, 0);
- return;
+ return NULL;
}
/* With 126 debuginfos I've seen lines 9k+ chars long...
@@ -405,15 +412,16 @@ static void InstallDebugInfos(const char *pDebugDumpDir,
* therefore we are using LARGE, but still limited buffer.
*/
char *buff = (char*) xmalloc(64*1024);
+
+ struct strbuf *buf_build_ids = strbuf_new();
+
while (fgets(buff, 64*1024, pipeout_fp))
{
strchrnul(buff, '\n')[0] = '\0';
if (strncmp(buff, "MISSING:", 8) == 0)
{
- build_ids += "Debuginfo absent: ";
- build_ids += buff + 8;
- build_ids += "\n";
+ strbuf_append_strf(buf_build_ids, "Debuginfo absent: %s\n", buff + 8);
continue;
}
@@ -422,6 +430,7 @@ static void InstallDebugInfos(const char *pDebugDumpDir,
{
p++;
}
+
if (*p)
{
VERB1 log("%s", buff);
@@ -443,6 +452,8 @@ static void InstallDebugInfos(const char *pDebugDumpDir,
{
error_msg("%s killed by signal %u", "abrt-debuginfo-install", (int)WTERMSIG(status));
}
+
+ return strbuf_free_nobuf(buf_build_ids);
}
static double get_dir_size(const char *dirname,
@@ -525,9 +536,10 @@ string CAnalyzerCCpp::GetLocalUUID(const char *pDebugDumpDir)
dd.LoadText(FILENAME_PACKAGE, package);
dd.Close();
- string unstrip_n_output = run_unstrip_n(pDebugDumpDir);
+ char *unstrip_n_output = run_unstrip_n(pDebugDumpDir);
string independentBuildIdPC;
- GetIndependentBuildIdPC(unstrip_n_output.c_str(), independentBuildIdPC);
+ GetIndependentBuildIdPC(unstrip_n_output, independentBuildIdPC);
+ free(unstrip_n_output);
/* package variable has "firefox-3.5.6-1.fc11[.1]" format */
/* Remove distro suffix and maybe least significant version number */
@@ -703,6 +715,7 @@ static bool DebuginfoCheckPolkit(uid_t uid)
{
perror_msg_and_die("fork");
}
+
if (child_pid == 0)
{
//child
@@ -760,32 +773,36 @@ void CAnalyzerCCpp::CreateReport(const char *pDebugDumpDir, int force)
dd.LoadText(CD_UID, UID);
dd.Close(); /* do not keep dir locked longer than needed */
- string build_ids;
+ char *build_ids;
if (m_bInstallDebugInfo && DebuginfoCheckPolkit(xatoi_u(UID.c_str())))
{
if (m_nDebugInfoCacheMB > 0)
trim_debuginfo_cache(m_nDebugInfoCacheMB);
- InstallDebugInfos(pDebugDumpDir, m_sDebugInfoDirs.c_str(), build_ids);
+ build_ids = install_debug_infos(pDebugDumpDir, m_sDebugInfoDirs.c_str());
}
else
VERB1 log(_("Skipping the debuginfo installation"));
/* Create and store backtrace. */
- string backtrace_str;
- GetBacktrace(pDebugDumpDir, m_sDebugInfoDirs.c_str(), backtrace_str);
+ char *backtrace_str = get_backtrace(pDebugDumpDir, m_sDebugInfoDirs.c_str());
+
+ char *bt_build_ids = xasprintf("%s%s", backtrace_str, build_ids);
+ free(build_ids);
+
if (!dd.Open(pDebugDumpDir))
{
VERB1 log(_("Unable to open debug dump '%s'"), pDebugDumpDir);
return;
}
-
- dd.SaveText(FILENAME_BACKTRACE, (backtrace_str + build_ids).c_str());
+ dd.SaveText(FILENAME_BACKTRACE, bt_build_ids);
+ free(bt_build_ids);
if (m_bMemoryMap)
dd.SaveText(FILENAME_MEMORYMAP, "memory map of the crashed C/C++ application, not implemented yet");
/* Compute and store UUID from the backtrace. */
- char *backtrace_cpy = xstrdup(backtrace_str.c_str());
+ char *backtrace_cpy = xstrdup(backtrace_str);
+
struct backtrace *backtrace = backtrace_parse(backtrace_cpy, false, false);
free(backtrace_cpy);
if (backtrace)
@@ -854,7 +871,7 @@ void CAnalyzerCCpp::CreateReport(const char *pDebugDumpDir, int force)
/* If we write and use a hand-written parser instead of the bison one,
the parser never fails, and it will be possible to get rid of
the independent_backtrace and backtrace_rate_old. */
- struct strbuf *ibt = independent_backtrace(backtrace_str.c_str());
+ struct strbuf *ibt = independent_backtrace(backtrace_str);
strbuf_prepend_str(ibt, executable.c_str());
strbuf_prepend_str(ibt, package.c_str());
dd.SaveText(FILENAME_GLOBAL_UUID, create_hash(ibt->buf).c_str());
@@ -862,9 +879,9 @@ void CAnalyzerCCpp::CreateReport(const char *pDebugDumpDir, int force)
/* Compute and store backtrace rating. */
/* Crash frame is not known so store nothing. */
- dd.SaveText(FILENAME_RATING, to_string(backtrace_rate_old(backtrace_str.c_str())).c_str());
+ dd.SaveText(FILENAME_RATING, to_string(backtrace_rate_old(backtrace_str)).c_str());
}
-
+ free(backtrace_str);
dd.Close();
}
--
1.7.1
13 years, 8 months
Re: [PATCH] GUI: Add accelerator key delete for delete button
by Roman Rakus
On 08/19/2010 04:40 PM, y(a)redhat.com wrote:
> From: Roman Rakus<rrakus(a)redhat.com>
>
> Delete button can be invoked by pressing delete key
>
> Signed-off-by: Roman Rakus<rrakus(a)redhat.com>
> ---
> src/gui/ccgui.glade | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/src/gui/ccgui.glade b/src/gui/ccgui.glade
> index 7d46c29..4f8c4f0 100644
> --- a/src/gui/ccgui.glade
> +++ b/src/gui/ccgui.glade
> @@ -533,6 +533,7 @@ Máirín Duffy<duffy(a)redhat.com></property>
> <property name="can_focus">True</property>
> <property name="receives_default">True</property>
> <property name="use_stock">True</property>
> +<accelerator key="Delete" signal="clicked"/>
> </widget>
> <packing>
> <property name="position">1</property>
Argh, sorry for bad email from. It should be rrakus(a)redhat.com
This patch adds accelerator key for Delete button in the main window of
abrt gui. The key is delete.
RR
13 years, 8 months
Formation Marches Publics en Région Lorraine
by Bernard TRUFFAUT Resp. Formation
MICRO VIDEO SOFT SYSTEMES 88100 STE MARGUERITE
Catalogue des Formations Marchés Publics en Région Lorraine
Les Marches Publics constituent une formidable opportunité d'affaires pour toutes les entreprises. Dans la période tendue que nous connaissons, je vous encourage à développer le niveau de compétence de vos équipes en profitant de notre offre.
Marches Publics: Inscrivez vous en Juillet* et profitez de la remise de 20%
L'essentiel du code des Marchés Publics
Permettre aux participants de bien connaître ses droits et ses devoirs lors de toutes les phases de la consultation ...
Appel d'Offres : la réponse électronique
Offrir aux participants d'acquérir toutes les compétences nécessaires pour déposer une réponse par internet sur la plateforme de dématérialisation ...
L'essentiel des aspects financiers des Marchés
Permettre aux participants de maîtriser les principales règles et concepts afférents aux aspects financiers ...
Marches-Securises et INTERBAT vous proposent les formations indispensables pour bien maîtriser tous les aspects des Marchés Publics, déjà suivies par 3000 stagiaires dans de nombreuses villes. Composez votre programme en 1 ou 2 ou 3 jours avec prise en charge possible, partielle ou totale, par l'OPCA de votre secteur d'activité. (Liste des OPCA ( "http://www.interbat-formations.fr/IFv2/index.php?module=opca" ))
( "http://www.interbat-formations.fr/IFv2/index.php?module=form_inscription&..." ) Ne tardez plus à vous former
Pré-Inscrivez vous maintenant et Profitez de 10% de remise soit 594 euros (code Prix_RENTREE_594)
A votre disposition au 06 61 26 10 97
Bernard TRUFFAUT Responsable Formation
Réussissons ensemble cette année 2010
www.marches-securises.fr ( "http://www.marches-securises.fr" ) www.interbat-formations.fr ( "http://www.interbat-formations.fr/" )
Cet email, qui vous est adressé, est conforme à la législation en vigueur et aux délibérations de la CNIL des 22 &30/3/2005.
sur la prospection par courrier électronique dans le cadre professionnel. Conformément à l'article 34 de la loi 78-17 du 6/1/78
relative à l'informatique, aux fichiers et aux libertés, vous disposez d'un droit d'accès de rectification vos données nominatives.
Pour ne plus recevoir d'information sur la bal [email] de la part d'Interbat-Formations Repondre "NON Merci" à ce mail
13 years, 8 months
[PATCH] get rid of std::string& as parameter
by Nikola Pajkovsky
Signed-off-by: Nikola Pajkovsky <npajkovs(a)redhat.com>
---
lib/plugins/CCpp.cpp | 108 +++++++++++++++++++++++++++++---------------------
1 files changed, 63 insertions(+), 45 deletions(-)
diff --git a/lib/plugins/CCpp.cpp b/lib/plugins/CCpp.cpp
index 629da66..fce78af 100644
--- a/lib/plugins/CCpp.cpp
+++ b/lib/plugins/CCpp.cpp
@@ -31,6 +31,7 @@
#include "Polkit.h"
#include "backtrace.h"
#include "CCpp_sha1.h"
+#include "strbuf.h"
using namespace std;
@@ -113,7 +114,7 @@ static string create_hash(const char *pInput)
}
/* Returns status. See `man 2 wait` for status information. */
-static int ExecVP(char **pArgs, uid_t uid, int redirect_stderr, string& pOutput)
+static char* exec_vp(char **args, uid_t uid, int redirect_stderr, int *status)
{
/* Nuke everything which may make setlocale() switch to non-POSIX locale:
* we need to avoid having gdb output in some obscure language.
@@ -136,7 +137,7 @@ static int ExecVP(char **pArgs, uid_t uid, int redirect_stderr, string& pOutput)
VERB1 flags &= ~EXECFLG_QUIET;
int pipeout[2];
- pid_t child = fork_execv_on_steroids(flags, pArgs, pipeout, (char**)unsetenv_vec, /*dir:*/ NULL, uid);
+ pid_t child = fork_execv_on_steroids(flags, args, pipeout, (char**)unsetenv_vec, /*dir:*/ NULL, uid);
/* We use this function to run gdb and unstrip. Bugs in gdb or corrupted
* coredumps were observed to cause gdb to enter infinite loop.
@@ -144,15 +145,16 @@ static int ExecVP(char **pArgs, uid_t uid, int redirect_stderr, string& pOutput)
*/
int t = time(NULL); /* int is enough, no need to use time_t */
int endtime = t + 60;
+
+ struct strbuf *buf_out = strbuf_new();
+
while (1)
{
int timeout = endtime - t;
if (timeout < 0)
{
kill(child, SIGKILL);
- pOutput += "\nTimeout exceeded: 60 second, killing ";
- pOutput += pArgs[0];
- pOutput += "\n";
+ strbuf_append_strf(buf_out, "\nTimeout exceeded: 60 second, killing %s\n", args[0]);
break;
}
@@ -167,20 +169,20 @@ static int ExecVP(char **pArgs, uid_t uid, int redirect_stderr, string& pOutput)
if (r <= 0)
break;
buff[r] = '\0';
- pOutput += buff;
+ strbuf_append_str(buf_out, buff);
t = time(NULL);
}
close(pipeout[0]);
- int status;
- waitpid(child, &status, 0); /* prevent having zombie child process */
+ int st;
+ waitpid(child, &st, 0); /* prevent having zombie child process */
+ if (status)
+ *status = st;
- return status;
+ return strbuf_free_nobuf(buf_out);
}
-static void GetBacktrace(const char *pDebugDumpDir,
- const char *pDebugInfoDirs,
- string& pBacktrace)
+static char *get_backtrace(const char *pDebugDumpDir, const char *pDebugInfoDirs)
{
update_client(_("Generating backtrace"));
@@ -242,12 +244,10 @@ static void GetBacktrace(const char *pDebugDumpDir,
* BINARY_FILE if it is newer (to at least avoid gdb complaining).
*/
args[4] = (char*)"-ex";
- string file = ssprintf("file %s", executable.c_str());
- args[5] = (char*)file.c_str();
+ args[5] = xasprintf("file %s", executable.c_str());
args[6] = (char*)"-ex";
- string corefile = ssprintf("core-file %s/"FILENAME_COREDUMP, pDebugDumpDir);
- args[7] = (char*)corefile.c_str();
+ args[7] = xasprintf("core-file %s/"FILENAME_COREDUMP, pDebugDumpDir);
args[8] = (char*)"-ex";
/*args[9] = ... see below */
@@ -267,16 +267,19 @@ static void GetBacktrace(const char *pDebugDumpDir,
/* Get the backtrace, but try to cap its size */
/* Limit bt depth. With no limit, gdb sometimes OOMs the machine */
unsigned bt_depth = 2048;
- const char *thread_apply_all = "thread apply all ";
+ const char *thread_apply_all = "thread apply all";
const char *full = " full";
+ char *bt = NULL;
while (1)
{
- string cmd = ssprintf("%sbacktrace %u%s", thread_apply_all, bt_depth, full);
- args[9] = (char*)cmd.c_str();
- pBacktrace = "";
- ExecVP(args, xatoi_u(UID.c_str()), /*redirect_stderr:*/ 1, pBacktrace);
- if (bt_depth <= 64 || pBacktrace.size() < 256*1024)
- return;
+ args[9] = xasprintf("%s backtrace %u%s", thread_apply_all, bt_depth, full);
+ bt = exec_vp(args, xatoi_u(UID.c_str()), /*redirect_stderr:*/ 1, NULL);
+ if (bt || bt_depth <= 64 || strlen(bt) < 256*1024)
+ {
+ free(args[9]);
+ break;
+ }
+
bt_depth /= 2;
if (bt_depth <= 64 && thread_apply_all[0] != '\0')
{
@@ -290,7 +293,12 @@ static void GetBacktrace(const char *pDebugDumpDir,
bt_depth = 256;
full = "";
}
+ free(bt);
+ free(args[9]);
}
+ free(args[5]);
+ free(args[7]);
+ return bt;
}
static void GetIndependentBuildIdPC(const char *unstrip_n_output,
@@ -320,7 +328,7 @@ static void GetIndependentBuildIdPC(const char *unstrip_n_output,
}
}
-static string run_unstrip_n(const char *pDebugDumpDir)
+static char* run_unstrip_n(const char *pDebugDumpDir)
{
string UID;
{
@@ -335,20 +343,19 @@ static string run_unstrip_n(const char *pDebugDumpDir)
args[2] = (char*)"-n";
args[3] = NULL;
- string output;
- ExecVP(args, xatoi_u(UID.c_str()), /*redirect_stderr:*/ 0, output);
+ char *out = exec_vp(args, xatoi_u(UID.c_str()), /*redirect_stderr:*/ 0, NULL);
free(args[1]);
- return output;
+ return out;
}
/* Needs gdb feature from here: https://bugzilla.redhat.com/show_bug.cgi?id=528668
* It is slated to be in F12/RHEL6.
+ *
+ * returened value must be freed
*/
-static void InstallDebugInfos(const char *pDebugDumpDir,
- const char *debuginfo_dirs,
- string& build_ids)
+static char *install_debug_infos(const char *pDebugDumpDir, const char *debuginfo_dirs)
{
update_client(_("Starting the debuginfo installation"));
@@ -389,7 +396,7 @@ static void InstallDebugInfos(const char *pDebugDumpDir,
{
close(pipeout[0]);
waitpid(child, NULL, 0);
- return;
+ return NULL;
}
/* With 126 debuginfos I've seen lines 9k+ chars long...
@@ -397,15 +404,16 @@ static void InstallDebugInfos(const char *pDebugDumpDir,
* therefore we are using LARGE, but still limited buffer.
*/
char *buff = (char*) xmalloc(64*1024);
+
+ struct strbuf *buf_build_ids = strbuf_new();
+
while (fgets(buff, 64*1024, pipeout_fp))
{
strchrnul(buff, '\n')[0] = '\0';
if (strncmp(buff, "MISSING:", 8) == 0)
{
- build_ids += "Debuginfo absent: ";
- build_ids += buff + 8;
- build_ids += "\n";
+ strbuf_append_strf(buf_build_ids, "Debuginfo absent: %s\n", buff + 8);
continue;
}
@@ -414,6 +422,7 @@ static void InstallDebugInfos(const char *pDebugDumpDir,
{
p++;
}
+
if (*p)
{
VERB1 log("%s", buff);
@@ -435,6 +444,8 @@ static void InstallDebugInfos(const char *pDebugDumpDir,
{
error_msg("%s killed by signal %u", "abrt-debuginfo-install", (int)WTERMSIG(status));
}
+
+ return strbuf_free_nobuf(buf_build_ids);
}
static double get_dir_size(const char *dirname,
@@ -513,9 +524,10 @@ string CAnalyzerCCpp::GetLocalUUID(const char *pDebugDumpDir)
dd.LoadText(FILENAME_PACKAGE, package);
}
- string unstrip_n_output = run_unstrip_n(pDebugDumpDir);
+ char *unstrip_n_output = run_unstrip_n(pDebugDumpDir);
string independentBuildIdPC;
- GetIndependentBuildIdPC(unstrip_n_output.c_str(), independentBuildIdPC);
+ GetIndependentBuildIdPC(unstrip_n_output, independentBuildIdPC);
+ free(unstrip_n_output);
/* package variable has "firefox-3.5.6-1.fc11[.1]" format */
/* Remove distro suffix and maybe least significant version number */
@@ -684,6 +696,7 @@ static bool DebuginfoCheckPolkit(uid_t uid)
{
perror_msg_and_die("fork");
}
+
if (child_pid == 0)
{
//child
@@ -737,27 +750,32 @@ void CAnalyzerCCpp::CreateReport(const char *pDebugDumpDir, int force)
dd.LoadText(CD_UID, UID);
dd.Close(); /* do not keep dir locked longer than needed */
- string build_ids;
+ char *build_ids;
if (m_bInstallDebugInfo && DebuginfoCheckPolkit(xatoi_u(UID.c_str())))
{
if (m_nDebugInfoCacheMB > 0)
trim_debuginfo_cache(m_nDebugInfoCacheMB);
- InstallDebugInfos(pDebugDumpDir, m_sDebugInfoDirs.c_str(), build_ids);
+ build_ids = install_debug_infos(pDebugDumpDir, m_sDebugInfoDirs.c_str());
}
else
VERB1 log(_("Skipping the debuginfo installation"));
/* Create and store backtrace. */
- string backtrace_str;
- GetBacktrace(pDebugDumpDir, m_sDebugInfoDirs.c_str(), backtrace_str);
+ char *backtrace_str = get_backtrace(pDebugDumpDir, m_sDebugInfoDirs.c_str());
+
+ char *bt_build_ids = xasprintf("%s%s", backtrace_str, build_ids);
+ free(build_ids);
+
dd.Open(pDebugDumpDir);
- dd.SaveText(FILENAME_BACKTRACE, (backtrace_str + build_ids).c_str());
+ dd.SaveText(FILENAME_BACKTRACE, bt_build_ids);
+ free(bt_build_ids);
if (m_bMemoryMap)
dd.SaveText(FILENAME_MEMORYMAP, "memory map of the crashed C/C++ application, not implemented yet");
/* Compute and store UUID from the backtrace. */
- char *backtrace_cpy = xstrdup(backtrace_str.c_str());
+ char *backtrace_cpy = xstrdup(backtrace_str);
+
struct backtrace *backtrace = backtrace_parse(backtrace_cpy, false, false);
free(backtrace_cpy);
if (backtrace)
@@ -826,7 +844,7 @@ void CAnalyzerCCpp::CreateReport(const char *pDebugDumpDir, int force)
/* If we write and use a hand-written parser instead of the bison one,
the parser never fails, and it will be possible to get rid of
the independent_backtrace and backtrace_rate_old. */
- struct strbuf *ibt = independent_backtrace(backtrace_str.c_str());
+ struct strbuf *ibt = independent_backtrace(backtrace_str);
strbuf_prepend_str(ibt, executable.c_str());
strbuf_prepend_str(ibt, package.c_str());
dd.SaveText(FILENAME_GLOBAL_UUID, create_hash(ibt->buf).c_str());
@@ -834,9 +852,9 @@ void CAnalyzerCCpp::CreateReport(const char *pDebugDumpDir, int force)
/* Compute and store backtrace rating. */
/* Crash frame is not known so store nothing. */
- dd.SaveText(FILENAME_RATING, to_string(backtrace_rate_old(backtrace_str.c_str())).c_str());
+ dd.SaveText(FILENAME_RATING, to_string(backtrace_rate_old(backtrace_str)).c_str());
}
-
+ free(backtrace_str);
dd.Close();
}
--
1.7.1
13 years, 8 months
Dünyanın Heryerine Hızlı ve Ekonomik Hava Kargo & Kurye Taşımacılığı
by Mps Rusya & Türki Cumhuriyetler Hızlı Paket Taşımacılığı A.Ş
MPS Express Dev Kampanya....
MPS Gift Hediye Kampanyasından Sizde Yararlanın...
Dünyanın 220 Ülkesinde Faliyet gösteren MPS Express Türkiyeden Dünyanın Heryerine Döküman Paket Koli ve İhracat Kargolarınızı en hızlı en ekonomik ve en güvenli şekilde taşıma hizmetini bir yenisini daha ekledi.Türkiyeden Rusya ve Ukrayna Ülkelerine göndereceğiniz her türlü kargolarınızı kg gözetmeksizin KAPIDAN - KAPIYA İmza karşılığı teslim ederek rakipsiz bir hizmet başlatmıştır.
Rusya & Ukrayna Paket Taşımacılığı
Varış ülkesinde gümrüğe tabi olsun olmasın numunelerinizi Rusya ve Ukrayna Ülkelerinde Rakipleri Gümrüğe bırakırken,MPS Express Müşterinizin kapısına teslim etmeyi taahüt ediyor.
Rusya ve Ukrayna Fuar Taşıma Hizmeti
MPS Express Fuar Taşıma hizmeti ile katılacağınız fuarlarda organizasyonlarınızın başarı ile sonuçlandırmanıza yardımcı olmak için sizi sadece satış odaklı kılabilmek ve katılacağınız etkinlik nerede olursa olsun MPS Express KALİTE VE DENEYİMİ VE HIZLI. Sizlere tam zamanlı organizasyonlarınızın her aşamasında üstlenerek müşterileriniz ile 10.yılında buluşturma devam ediyor...
Dünyanın Heryerine Hızlı ve Ekonomik Hava Kargo & Kurye Taşımacılığı
MPS Express Yurtdışına göndereceğiniz Tüm Kargolarınızda Dünyanın 220 Ülkesine Hızlı & Ekonomik güvenilir bir şekilde taşıma hizmeti sağlamaktadır.Dünya Çapında bir çok güçlü kuruluş ile işbirliği yapan MPS Express Türkiye genelinde Müşterilerine sunduğu kaliteli hizmet sayesinde 220 ülke ve özerk bölgede konumunu sürdürmektedir.MPS Express çeşitli ülkeler de en yaygın kuruluşlar işbirliği yapmayı tercih ederek müşterilerine lokal dağıtımda en dağıtım firmaları ile çalışma avantajları sağlamaktadır.
Hava Kargo
Türkiyeden Dünyanın her yerine ,Dünyanın her yerinden Havalimanı yada kapıdan kapıya havayolu taşımacılığı hizmetleri veren MPS Express Seçkin havayolu şirketleri ile Yapılan anlaşmalar sayesinde taşımalarda yer ve fiyat avantajları sağlamaktadır.MPS Express Sektöründe deneyimi ve çalışma anlayışı ile havayolu taşımacılığında Türkiyede öncü bir marka haline gelmiştir.İhracatta artan dış rekabetin ve uluslararası arenadaki alıcıların daha hızlı termin isteklerinin sonucu olarak oluşan kalite hizmet ve ekonomik çözümler ile talebini karşılayarak yatırımlarını tamamlamıştır.
Dünyanın Heryerine Hava Kargo Ürün ve Hizmetlerimiz Müşteri Hizmetleri .:+ 90 212 444 0 108
Havalimanından Havalimanı Taşıma Çözümleri sales(a)mpsglobalexpress.com www.mpsglobalexpress.com
Havalimanından Kapıya Taşıma Çözümleri info(a)mpsglobalexpress.com
Tehlikeli Madde Taşıma Çözümleri
Kapıdan Havalimanına Taşıma Çözümleri
Kapıdan Kapıya Taşıma Çözümleri
Gümrüklü & Gümrüksüz Kapı Teslimi
Yolcu beraberinde Kargo Teslim Çözümleri
Rusya ve Ukrayna Acil Kargo Çözümleri
-
13 years, 8 months
[PATCH] make HTTP uploads emit updates
by Denys Vlasenko
Patch was run-tested on a recent git.
It also applies to current git, but I can't test it:
current git is broken, abrtd segfaults immediately when I try to report
a crash through RHTSupport.
Please review.
--
vda
diff -x '*.po' -d -urpN abrt.7/lib/utils/abrt_curl.cpp abrt.8/lib/utils/abrt_curl.cpp
--- abrt.7/lib/utils/abrt_curl.cpp 2010-08-17 19:17:22.000000000 +0200
+++ abrt.8/lib/utils/abrt_curl.cpp 2010-08-17 19:18:07.162119995 +0200
@@ -154,6 +154,30 @@ save_headers(void *buffer_pv, size_t cou
return size;
}
+/* "read local data from a file" callback */
+static size_t fread_with_reporting(void *ptr, size_t size, size_t nmemb, void *userdata)
+{
+ static time_t last_t; // hack
+
+ FILE *fp = (FILE*)userdata;
+ time_t t = time(NULL);
+
+ // Report current file position every 16 seconds
+ if (!(t & 0xf) && last_t != t)
+ {
+ last_t = t;
+ off_t cur_pos = ftello(fp);
+ fseeko(fp, 0, SEEK_END);
+ off_t sz = ftello(fp);
+ fseeko(fp, cur_pos, SEEK_SET);
+ update_client(_("Uploading: %llu of %llu kbytes"),
+ (unsigned long long)cur_pos / 1024,
+ (unsigned long long)sz / 1024);
+ }
+
+ return fread(ptr, size, nmemb, fp);
+}
+
int
abrt_post(abrt_post_state_t *state,
const char *url,
@@ -217,14 +241,42 @@ abrt_post(abrt_post_state_t *state,
//FIXME:
perror_msg_and_die("can't open '%s'", data);
xcurl_easy_setopt_ptr(handle, CURLOPT_READDATA, data_file);
+ // Want to use custom read function
+ xcurl_easy_setopt_ptr(handle, CURLOPT_READFUNCTION, (const void*)fread_with_reporting);
} else if (data_size == ABRT_POST_DATA_FROMFILE_AS_FORM_DATA) {
// ...from a file, in multipart/formdata format
+ const char *basename = strrchr(data, '/');
+ if (basename) basename++;
+ else basename = data;
+#if 0
+ // Simple way, without custom reader function
CURLFORMcode curlform_err = curl_formadd(&post, &last,
- CURLFORM_PTRNAME, "file",
+ CURLFORM_PTRNAME, "file", // element name
CURLFORM_FILE, data, // filename to read from
CURLFORM_CONTENTTYPE, content_type,
- CURLFORM_FILENAME, data, // filename to put in the form
+ CURLFORM_FILENAME, basename, // filename to put in the form
+ CURLFORM_END);
+#else
+ data_file = fopen(data, "r");
+ if (!data_file)
+//FIXME:
+ perror_msg_and_die("can't open '%s'", data);
+ // Want to use custom read function
+ xcurl_easy_setopt_ptr(handle, CURLOPT_READFUNCTION, (const void*)fread_with_reporting);
+ // Need to know file size
+ fseeko(data_file, 0, SEEK_END);
+ off_t sz = ftello(data_file);
+ fseeko(data_file, 0, SEEK_SET);
+ // Create formdata
+ CURLFORMcode curlform_err = curl_formadd(&post, &last,
+ CURLFORM_PTRNAME, "file", // element name
+ // use CURLOPT_READFUNCTION for reading, pass data_file as its last param:
+ CURLFORM_STREAM, data_file,
+ CURLFORM_CONTENTSLENGTH, (long)sz, // a must if we use CURLFORM_STREAM option
+ CURLFORM_CONTENTTYPE, content_type,
+ CURLFORM_FILENAME, basename, // filename to put in the form
CURLFORM_END);
+#endif
if (curlform_err != 0)
//FIXME:
error_msg_and_die("out of memory or read error (curl_formadd error code: %d)", (int)curlform_err);
13 years, 8 months