[Valgrind-developers] valgrind: r7266 - trunk
Author: sewardj Date: 2007-12-02 13:37:18 + (Sun, 02 Dec 2007) New Revision: 7266 Log: Set version to 3.3.0-RC1. Modified: trunk/configure.in Modified: trunk/configure.in === --- trunk/configure.in 2007-12-02 02:08:17 UTC (rev 7265) +++ trunk/configure.in 2007-12-02 13:37:18 UTC (rev 7266) @@ -8,7 +8,7 @@ #### # Process this file with autoconf to produce a configure script. -AC_INIT(Valgrind, 3.3.0.SVN, [EMAIL PROTECTED]) +AC_INIT(Valgrind, 3.3.0-RC1, [EMAIL PROTECTED]) AC_CONFIG_SRCDIR(coregrind/m_main.c) AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7267 - trunk/coregrind/m_debuginfo
Author: sewardj Date: 2007-12-02 22:03:43 + (Sun, 02 Dec 2007) New Revision: 7267 Log: Back out r7210 ("Fix completely bogus implementation of VG_(seginfo_sect_kind).") as it breaks DRD and possible Callgrind. The segment kind identification code is basically broken for non-text segments, but requires fixing at a higher level than this. See discussion on valgrind-developers, 20 March 07, "Bug in VG_(seginfo_sect_kind) ?" Modified: trunk/coregrind/m_debuginfo/debuginfo.c Modified: trunk/coregrind/m_debuginfo/debuginfo.c === --- trunk/coregrind/m_debuginfo/debuginfo.c 2007-12-02 13:37:18 UTC (rev 7266) +++ trunk/coregrind/m_debuginfo/debuginfo.c 2007-12-02 22:03:43 UTC (rev 7267) @@ -1263,43 +1263,36 @@ VgSectKind VG_(seginfo_sect_kind)(Addr a) { - SegInfo* si; + SegInfo* si; VgSectKind ret = Vg_SectUnknown; for (si = segInfo_list; si != NULL; si = si->next) { - if (a >= si->text_start_avma && a < si->text_start_avma + si->text_size) { - ret = Vg_SectText; - break; - } - if (a >= si->data_start_avma && a < si->data_start_avma + si->data_size) { - ret = Vg_SectData; - break; - } - if (a >= si->bss_start_avma && a < si->bss_start_avma + si->bss_size) { - ret = Vg_SectBSS; - break; - } - if (a >= si->plt_start_avma && a < si->plt_start_avma + si->plt_size) { - ret = Vg_SectPLT; - break; - } - if (a >= si->got_start_avma && a < si->got_start_avma + si->got_size) { - ret = Vg_SectGOT; - break; - } - } + if (a >= si->text_start_avma + && a < si->text_start_avma + si->text_size) { - if (si != NULL) - vg_assert(ret != Vg_SectUnknown); +if (0) + VG_(printf)( + "addr=%p si=%p %s got=%p %d plt=%p %d data=%p %d bss=%p %d\n", + a, si, si->filename, + si->got_start_avma, si->got_size, + si->plt_start_avma, si->plt_size, + si->data_start_avma, si->data_size, + si->bss_start_avma, si->bss_size); - if (0 && si) { - VG_(printf)( - "addr=%p si=%p %s got=%p %d plt=%p %d data=%p %d bss=%p %d\n", - a, si, si->filename, - si->got_start_avma, si->got_size, - si->plt_start_avma, si->plt_size, - si->data_start_avma, si->data_size, - si->bss_start_avma, si->bss_size); +ret = Vg_SectText; + +if (a >= si->data_start_avma && a < si->data_start_avma + si->data_size) + ret = Vg_SectData; +else + if (a >= si->bss_start_avma && a < si->bss_start_avma + si->bss_size) + ret = Vg_SectBSS; +else + if (a >= si->plt_start_avma && a < si->plt_start_avma + si->plt_size) + ret = Vg_SectPLT; +else + if (a >= si->got_start_avma && a < si->got_start_avma + si->got_size) + ret = Vg_SectGOT; + } } return ret; - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7268 - trunk
Author: sewardj Date: 2007-12-02 22:15:31 + (Sun, 02 Dec 2007) New Revision: 7268 Log: Finalise 3.3.0.RC1. Modified: trunk/NEWS trunk/configure.in Modified: trunk/NEWS === --- trunk/NEWS 2007-12-02 22:03:43 UTC (rev 7267) +++ trunk/NEWS 2007-12-02 22:15:31 UTC (rev 7268) @@ -218,8 +218,8 @@ abstractified, particularly with respect to support for non-Linux OSs. -(3.3.0RC1: XX Dec 2007, vex r, valgrind r). -(3.3.0:XX Dec 2006, vex r, valgrind r). +(3.3.0.RC1: 2 Dec 2007, vex r1803, valgrind r7268). +(3.3.0: X Dec 2006, vex r, valgrind r). Modified: trunk/configure.in === --- trunk/configure.in 2007-12-02 22:03:43 UTC (rev 7267) +++ trunk/configure.in 2007-12-02 22:15:31 UTC (rev 7268) @@ -8,7 +8,7 @@ #### # Process this file with autoconf to produce a configure script. -AC_INIT(Valgrind, 3.3.0-RC1, [EMAIL PROTECTED]) +AC_INIT(Valgrind, 3.3.0.RC1, [EMAIL PROTECTED]) AC_CONFIG_SRCDIR(coregrind/m_main.c) AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7269 - trunk/massif
Author: njn Date: 2007-12-03 21:29:22 + (Mon, 03 Dec 2007) New Revision: 7269 Log: Comment-only change. Modified: trunk/massif/ms_main.c Modified: trunk/massif/ms_main.c === --- trunk/massif/ms_main.c 2007-12-02 22:15:31 UTC (rev 7268) +++ trunk/massif/ms_main.c 2007-12-03 21:29:22 UTC (rev 7269) @@ -52,6 +52,9 @@ // - Options like --alloc-fn='operator new(unsigned, std::nothrow_t const&)' // don't work in a .valgrindrc file or in $VALGRIND_OPTS. // m_commandline.c:add_args_from_string() needs to respect single quotes. +// - With --stack=yes, want to add a stack trace for detailed snapshots so +// it's clear where/why the peak is occurring. (Mattieu Castet) Also, +// possibly useful even with --stack=no? (Andi Yin) // // Performance: // - To run the benchmarks: - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7271 - trunk/massif
Author: njn Date: 2007-12-04 03:27:40 + (Tue, 04 Dec 2007) New Revision: 7271 Log: tweak message Modified: trunk/massif/ms_main.c Modified: trunk/massif/ms_main.c === --- trunk/massif/ms_main.c 2007-12-04 03:15:23 UTC (rev 7270) +++ trunk/massif/ms_main.c 2007-12-04 03:27:40 UTC (rev 7271) @@ -915,13 +915,13 @@ VG_(message)(Vg_UserMsg, "Warning: Malformed stack trace detected. In Massif's output,"); VG_(message)(Vg_UserMsg, -"Warning: the size of an entry's child entries may not sum up"); +" the size of an entry's child entries may not sum up"); VG_(message)(Vg_UserMsg, -"Warning: to the entry's size as they normally do."); +" to the entry's size as they normally do."); n_moans++; if (3 == n_moans) VG_(message)(Vg_UserMsg, - "Warning: (And Massif now won't warn about this again.)"); + " (And Massif now won't warn about this again.)"); } } return xpt; - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7270 - trunk/massif
Author: njn Date: 2007-12-04 03:15:23 + (Tue, 04 Dec 2007) New Revision: 7270 Log: Two changes: - Be more robust in the face of malformed stack traces. This avoids some potential assertion errors (which have affected prior versions of Massif), but unfortunately reduces the amount of sanity-checking that can be done on XTrees. - Get white-space printing right in output file. Non-functional change, just makes output files easier to read. Modified: trunk/massif/ms_main.c Modified: trunk/massif/ms_main.c === --- trunk/massif/ms_main.c 2007-12-03 21:29:22 UTC (rev 7269) +++ trunk/massif/ms_main.c 2007-12-04 03:15:23 UTC (rev 7270) @@ -465,6 +465,9 @@ // | v v| // child1 child2 // +// (Note that malformed stack traces can lead to difficulties. See the +// comment at the bottom of get_XCon.) +// // XTrees and XPts are mirrored by SXTrees and SXPts, where the 'S' is short // for "saved". When the XTree is duplicated for a snapshot, we duplicate // it as an SXTree, which is similar but omits some things it does not need, @@ -612,7 +615,7 @@ static SXPt* dup_XTree(XPt* xpt, SizeT total_szB) { Int i, n_sig_children, n_insig_children, n_child_sxpts; - SizeT insig_children_szB, sig_child_threshold_szB; + SizeT sig_child_threshold_szB; SXPt* sxpt; // Number of XPt children Action for SXPT @@ -657,21 +660,23 @@ // Create the SXPt's children. if (n_child_sxpts > 0) { Int j; - SizeT sig_children_szB = 0; + SizeT sig_children_szB = 0, insig_children_szB = 0; sxpt->Sig.children = VG_(malloc)(n_child_sxpts * sizeof(SXPt*)); - // Duplicate the significant children. + // Duplicate the significant children. (Nb: sig_children_szB + + // insig_children_szB doesn't necessarily equal xpt->szB.) j = 0; for (i = 0; i < xpt->n_children; i++) { if (xpt->children[i]->szB >= sig_child_threshold_szB) { sxpt->Sig.children[j++] = dup_XTree(xpt->children[i], total_szB); -sig_children_szB += xpt->children[i]->szB; +sig_children_szB += xpt->children[i]->szB; + } else { +insig_children_szB += xpt->children[i]->szB; } } // Create the SXPt for the insignificant children, if any, and put it // in the last child entry. - insig_children_szB = sxpt->szB - sig_children_szB; if (n_insig_children > 0) { // Nb: We 'n_sxpt_allocs' here because creating an Insig SXPt // doesn't involve a call to dup_XTree(). @@ -719,8 +724,6 @@ // ms_expensive_sanity_check. static void sanity_check_XTree(XPt* xpt, XPt* parent) { - Int i; - tl_assert(xpt != NULL); // Check back-pointer. @@ -730,16 +733,8 @@ // Check children counts look sane. tl_assert(xpt->n_children <= xpt->max_children); - // Check the sum of any children szBs equals the XPt's szB. Check the - // children at the same time. - if (xpt->n_children > 0) { - SizeT children_sum_szB = 0; - for (i = 0; i < xpt->n_children; i++) { - sanity_check_XTree(xpt->children[i], xpt); - children_sum_szB += xpt->children[i]->szB; - } - tl_assert(children_sum_szB == xpt->szB); - } + // Unfortunately, xpt's size is not necessarily equal to the sum of xpt's + // children's sizes. See comment at the bottom of get_XCon. } // Sanity checking: we check SXTrees (which are in snapshots) after @@ -756,12 +751,9 @@ switch (sxpt->tag) { case SigSXPt: { if (sxpt->Sig.n_children > 0) { - SizeT children_sum_szB = 0; for (i = 0; i < sxpt->Sig.n_children; i++) { sanity_check_SXTree(sxpt->Sig.children[i]); -children_sum_szB += sxpt->Sig.children[i]->szB; } - tl_assert(children_sum_szB == sxpt->szB); } break; } @@ -893,7 +885,45 @@ } } } - tl_assert(0 == xpt->n_children); // Must be bottom-XPt + + // [Note: several comments refer to this comment. Do not delete it + // without updating them.] + // + // A complication... If all stack traces were well-formed, then the + // returned xpt would always be a bottom-XPt. As a consequence, an XPt's + // size would always be equal to the sum of its children's sizes, which + // is an excellent sanity check. + // + // Unfortunately, stack traces occasionally are malformed, ie. truncated. + // This allows a stack trace to be a sub-trace of another, eg. a/b/c is a + // sub-trace of a/b/c/d. So we can't assume this xpt is a bottom-XPt; + // nor can we do sanity check an XPt's size against its children's sizes. + // This is annoying, but must be dealt with. (Older versions of Massif + // had this assertion in, and it was reported to fail by real users a + // couple of times.) Even more annoyingly, I can't come up with a simple + // test case tha
[Valgrind-developers] valgrind: r7272 - trunk/callgrind/docs
Author: weidendo Date: 2007-12-04 10:09:24 + (Tue, 04 Dec 2007) New Revision: 7272 Log: Update old (and wrong) parts of callgrind documentation. This obviously was already wrong in 3.2.x :-( * Old --fn-recursion=... / --fn-caller=... options are called --separate-recs=... / --separate-callers=... since quite some time for consistency with e.g. --separate-threads=yes. Error noted from bug 153335. * Function specifications support wildcards since quite some time; specification of a prefix only does not work, but the full function has to match. This was needed to allow to specify 'foo' without also specifying 'foo1'. * The script 'callgrind' does not exist since merging into valgrind. * Rename callgrind from being a 'heavyweight' to a 'call graph' profiler, similar to the description in the quick start overview. Modified: trunk/callgrind/docs/cl-manual.xml Modified: trunk/callgrind/docs/cl-manual.xml === --- trunk/callgrind/docs/cl-manual.xml 2007-12-04 03:27:40 UTC (rev 7271) +++ trunk/callgrind/docs/cl-manual.xml 2007-12-04 10:09:24 UTC (rev 7272) @@ -4,13 +4,13 @@ [ %cl-entities; ]> -Callgrind: a heavyweight profiler +Callgrind: a call graph profiler Overview -Callgrind is profiling tool that can +Callgrind is a profiling tool that can construct a call graph for a program's run. By default, the collected data consists of the number of instructions executed, their relationship @@ -65,7 +65,7 @@ Cachegrind collects flat profile data: event counts (data reads, cache misses, etc.) are attributed directly to the function they -occurred in. This simple cost attribution mechanism is sometimes +occurred in. This cost attribution mechanism is called self or exclusive attribution. @@ -115,7 +115,7 @@ (the -g flag), but with optimization turned on. To start a profile run for a program, execute: - callgrind [callgrind options] your-program [program options] + valgrind --tool=callgrind [callgrind options] your-program [program options] While the simulation is running, you can observe execution with @@ -277,16 +277,17 @@ - Dumping at enter/leave of all functions whose name - starts with funcprefix. Use the - option =funcprefix - and =funcprefix. + Dumping at enter/leave of specified functions. + Use the + option =function + and =function. To zero cost counters before entering a function, use - =funcprefix. - The prefix method for specifying function names was chosen to - ease the use with C++: you don't have to specify full - signatures. You can specify these options multiple - times for different function prefixes. + =function. + You can specify these options multiple times for different + functions. Function specifications support wildcards: eg. use + ='foo*' to + generate dumps before entering any function starting with + foo. @@ -344,17 +345,15 @@ In addition to enabling instrumentation, you must also enable event collection for the parts of your program you are interested in. By default, event collection is enabled everywhere. - You can limit collection to specific function(s) + You can limit collection to a specific function by using - =funcprefix. + =function. This will toggle the collection state on entering and leaving the specified functions. When this option is in effect, the default collection state at program start is "off". Only events happening while running - inside of functions starting with funcprefix will - be collected. Recursive - calls of functions with funcprefix do not trigger - any action. + inside of the given function will be collected. Recursive + calls of the given function do not trigger any action. It is important to note that with instrumentation switched off, the cache simulator cannot see any memory access events, and thus, any @@ -441,7 +440,7 @@ also skips any call information from and to an ignored function, and thus can break a cycle. Candidates for this typically are dispatcher functions in event driven code. The option to ignore calls to a function is - =funcprefix. Aside from + =function. Aside from possibly breaking cycles, this is used in Callgrind to skip trampoline functions in the PLT sections for calls to functions in shared libraries. You can see the difference @@ -451,22 +450,22 @@ If you have a recursive function, you can distinguish the first 10 recursion levels by specifying - =funcprefix. + =function. Or for all functions with - =10, but this will + =10, but this will give you much bigger profile data files. In the profile data, you will see the recursion levels of "func" as the different functions with names "func", "func'2", "func'3" and so on. If you have call chains "A > B > C" and "A > C > B"
[Valgrind-developers] valgrind: r7273 - trunk/coregrind/m_syswrap
Author: sewardj Date: 2007-12-04 16:12:54 + (Tue, 04 Dec 2007) New Revision: 7273 Log: Handle semaphore-related syscalls. Modified: trunk/coregrind/m_syswrap/syswrap-ppc64-aix5.c Modified: trunk/coregrind/m_syswrap/syswrap-ppc64-aix5.c === --- trunk/coregrind/m_syswrap/syswrap-ppc64-aix5.c 2007-12-04 10:09:24 UTC (rev 7272) +++ trunk/coregrind/m_syswrap/syswrap-ppc64-aix5.c 2007-12-04 16:12:54 UTC (rev 7273) @@ -661,6 +661,7 @@ AIXX_(__NR_AIX5__pause, sys__pause), AIXXY(__NR_AIX5__poll, sys__poll), AIXX_(__NR_AIX5__select,sys__select), +AIXX_(__NR_AIX5__sem_wait, sys__sem_wait), AIXXY(__NR_AIX5__sigaction, sys__sigaction), AIXX_(__NR_AIX5__thread_self, sys__thread_self), AIXX_(__NR_AIX5_access, sys_access), @@ -721,6 +722,8 @@ AIXX_(__NR_AIX5_privcheck, sys_privcheck), AIXX_(__NR_AIX5_rename, sys_rename), AIXXY(__NR_AIX5_sbrk, sys_sbrk), +AIXXY(__NR_AIX5_sem_init, sys_sem_init), +AIXXY(__NR_AIX5_sem_post, sys_sem_post), AIXX_(__NR_AIX5_send, sys_send), AIXX_(__NR_AIX5_setgid, sys_setgid), AIXX_(__NR_AIX5_setsockopt, sys_setsockopt), - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] vex: r1804 - trunk/priv/host-ppc
Author: sewardj Date: 2007-12-04 19:04:17 + (Tue, 04 Dec 2007) New Revision: 1804 Log: Generate code to handle 64-bit integer loads and stores on 32-bit targets, as this is needed by Massif in Valgrind 3.3.0. Modified: trunk/priv/host-ppc/isel.c Modified: trunk/priv/host-ppc/isel.c === --- trunk/priv/host-ppc/isel.c 2007-11-27 00:11:13 UTC (rev 1803) +++ trunk/priv/host-ppc/isel.c 2007-12-04 19:04:17 UTC (rev 1804) @@ -2552,6 +2552,23 @@ vassert(e); vassert(typeOfIRExpr(env->type_env,e) == Ity_I64); + /* 64-bit load */ + if (e->tag == Iex_Load) { + HReg tLo= newVRegI(env); + HReg tHi= newVRegI(env); + HReg r_addr = iselWordExpr_R(env, e->Iex.Load.addr); + vassert(!env->mode64); + addInstr(env, PPCInstr_Load( 4/*byte-load*/, + tHi, PPCAMode_IR( 0, r_addr ), + False/*32-bit insn please*/) ); + addInstr(env, PPCInstr_Load( 4/*byte-load*/, + tLo, PPCAMode_IR( 4, r_addr ), + False/*32-bit insn please*/) ); + *rHi = tHi; + *rLo = tLo; + return; + } + /* 64-bit literal */ if (e->tag == Iex_Const) { ULong w64 = e->Iex.Const.con->Ico.U64; @@ -3668,7 +3685,6 @@ /* - STORE - */ case Ist_Store: { - PPCAMode* am_addr; IRTypetya = typeOfIRExpr(env->type_env, stmt->Ist.Store.addr); IRTypetyd = typeOfIRExpr(env->type_env, stmt->Ist.Store.data); IREndness end = stmt->Ist.Store.end; @@ -3678,32 +3694,56 @@ ( mode64 && (tya != Ity_I64)) ) goto stmt_fail; - am_addr = iselWordExpr_AMode(env, stmt->Ist.Store.addr, tyd/*of xfer*/); if (tyd == Ity_I8 || tyd == Ity_I16 || tyd == Ity_I32 || (mode64 && (tyd == Ity_I64))) { + PPCAMode* am_addr += iselWordExpr_AMode(env, stmt->Ist.Store.addr, tyd/*of xfer*/); HReg r_src = iselWordExpr_R(env, stmt->Ist.Store.data); addInstr(env, PPCInstr_Store( toUChar(sizeofIRType(tyd)), - am_addr, r_src, mode64 )); + am_addr, r_src, mode64 )); return; } if (tyd == Ity_F64) { + PPCAMode* am_addr += iselWordExpr_AMode(env, stmt->Ist.Store.addr, tyd/*of xfer*/); HReg fr_src = iselDblExpr(env, stmt->Ist.Store.data); addInstr(env, PPCInstr_FpLdSt(False/*store*/, 8, fr_src, am_addr)); return; } if (tyd == Ity_F32) { + PPCAMode* am_addr += iselWordExpr_AMode(env, stmt->Ist.Store.addr, tyd/*of xfer*/); HReg fr_src = iselFltExpr(env, stmt->Ist.Store.data); addInstr(env, PPCInstr_FpLdSt(False/*store*/, 4, fr_src, am_addr)); return; } if (tyd == Ity_V128) { + PPCAMode* am_addr += iselWordExpr_AMode(env, stmt->Ist.Store.addr, tyd/*of xfer*/); HReg v_src = iselVecExpr(env, stmt->Ist.Store.data); addInstr(env, PPCInstr_AvLdSt(False/*store*/, 16, v_src, am_addr)); return; } + if (tyd == Ity_I64 && !mode64) { + /* Just calculate the address in the register. Life is too +short to arse around trying and possibly failing to adjust +the offset in a 'reg+offset' style amode. */ + HReg rHi32, rLo32; + HReg r_addr = iselWordExpr_R(env, stmt->Ist.Store.addr); + iselInt64Expr( &rHi32, &rLo32, env, stmt->Ist.Store.data ); + addInstr(env, PPCInstr_Store( 4/*byte-store*/, + PPCAMode_IR( 0, r_addr ), + rHi32, + False/*32-bit insn please*/) ); + addInstr(env, PPCInstr_Store( 4/*byte-store*/, + PPCAMode_IR( 4, r_addr ), + rLo32, + False/*32-bit insn please*/) ); + return; + } break; } - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7274 - in trunk: . memcheck memcheck/tests
Author: njn Date: 2007-12-04 21:18:06 + (Tue, 04 Dec 2007) New Revision: 7274 Log: Remove client requests that were deprecated in 3.2.0. Modified: trunk/NEWS trunk/memcheck/memcheck.h trunk/memcheck/tests/leak-pool.c trunk/memcheck/tests/sh-mem-random.c Modified: trunk/NEWS === --- trunk/NEWS 2007-12-04 16:12:54 UTC (rev 7273) +++ trunk/NEWS 2007-12-04 21:18:06 UTC (rev 7274) @@ -128,6 +128,16 @@ they just return 3 (as before). Also, SET_VBITS doesn't report definedness errors if any of the V bits are undefined. +- The following Memcheck client requests have been removed: +VALGRIND_MAKE_NOACCESS +VALGRIND_MAKE_WRITABLE +VALGRIND_MAKE_READABLE +VALGRIND_CHECK_WRITABLE +VALGRIND_CHECK_READABLE +VALGRIND_CHECK_DEFINED + They were deprecated in 3.2.0, when equivalent but better-named client + requests were added. See the 3.2.0 release notes for more details. + - The behaviour of the tool Lackey has changed slightly. First, the output from --trace-mem has been made more compact, to reduce the size of the traces. Second, a new option --trace-superblocks has been added, which Modified: trunk/memcheck/memcheck.h === --- trunk/memcheck/memcheck.h 2007-12-04 16:12:54 UTC (rev 7273) +++ trunk/memcheck/memcheck.h 2007-12-04 21:18:06 UTC (rev 7274) @@ -131,18 +131,6 @@ _qzz_res;\ })) -/* This is the old name for VALGRIND_MAKE_MEM_NOACCESS. Deprecated. */ -#define VALGRIND_MAKE_NOACCESS(_qzz_addr,_qzz_len) \ - VALGRIND_MAKE_MEM_NOACCESS(_qzz_addr,_qzz_len) - -/* This is the old name for VALGRIND_MAKE_MEM_UNDEFINED. Deprecated. */ -#define VALGRIND_MAKE_WRITABLE(_qzz_addr,_qzz_len) \ - VALGRIND_MAKE_MEM_UNDEFINED(_qzz_addr,_qzz_len) - -/* This is the old name for VALGRIND_MAKE_MEM_DEFINED. Deprecated. */ -#define VALGRIND_MAKE_READABLE(_qzz_addr,_qzz_len) \ - VALGRIND_MAKE_MEM_DEFINED(_qzz_addr,_qzz_len) - /* Similar to VALGRIND_MAKE_MEM_DEFINED except that addressability is not altered: bytes which are addressable are marked as defined, but those which are not addressable are left unchanged. */ @@ -214,19 +202,7 @@ (volatile unsigned char *)&(__lvalue), \ (unsigned int)(sizeof (__lvalue))) -/* This is the old name for VALGRIND_CHECK_MEM_IS_ADDRESSABLE. Deprecated. */ -#define VALGRIND_CHECK_WRITABLE(_qzz_addr,_qzz_len) \ - VALGRIND_CHECK_MEM_IS_ADDRESSABLE(_qzz_addr,_qzz_len) -/* This is the old name for VALGRIND_CHECK_MEM_IS_DEFINED. Deprecated. */ -#define VALGRIND_CHECK_READABLE(_qzz_addr,_qzz_len) \ - VALGRIND_CHECK_MEM_IS_DEFINED(_qzz_addr,_qzz_len) - -/* This is the old name for VALGRIND_CHECK_VALUE_IS_DEFINED. Deprecated. */ -#define VALGRIND_CHECK_DEFINED(__lvalue) \ - VALGRIND_CHECK_VALUE_IS_DEFINED(__lvalue) - - /* Do a memory leak check mid-execution. */ #define VALGRIND_DO_LEAK_CHECK \ {unsigned int _qzz_res; \ Modified: trunk/memcheck/tests/leak-pool.c === --- trunk/memcheck/tests/leak-pool.c2007-12-04 16:12:54 UTC (rev 7273) +++ trunk/memcheck/tests/leak-pool.c2007-12-04 21:18:06 UTC (rev 7274) @@ -40,7 +40,7 @@ assert(p->buf); memset(p->buf, 0, p->allocated); VALGRIND_CREATE_MEMPOOL(p, 0, 0); - VALGRIND_MAKE_NOACCESS(p->buf, p->allocated); + VALGRIND_MAKE_MEM_NOACCESS(p->buf, p->allocated); return p; } Modified: trunk/memcheck/tests/sh-mem-random.c === --- trunk/memcheck/tests/sh-mem-random.c2007-12-04 16:12:54 UTC (rev 7273) +++ trunk/memcheck/tests/sh-mem-random.c2007-12-04 21:18:06 UTC (rev 7274) @@ -40,7 +40,7 @@ U8 mask = 0; U8 shres; U8 res = 0xULL, res2; - VALGRIND_MAKE_WRITABLE(&res, 8); + VALGRIND_MAKE_MEM_UNDEFINED(&res, 8); assert(1 == size || 2 == size || 4 == size || 8 == size); for (i = 0; i < size; i++) { @@ -55,7 +55,7 @@ VALGRIND_GET_VBITS(&res, &shres, 8); res2 = res; - VALGRIND_MAKE_READABLE(&res2, 8); // avoid the 'undefined' warning + VALGRIND_MAKE_MEM_DEFINED(&res2, 8); // avoid the 'undefined' warning assert(res2 == shres); return res; } @@ -63,7 +63,7 @@ U1 make_defined ( U1 x ) { volatile U1 xx = x; - VALGRIND_MAKE_READABLE(&xx, 1); + VALGRIND_MAKE_MEM_DEFINED(&xx, 1); return xx; } - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it si
[Valgrind-developers] valgrind: r7275 - in trunk: . exp-drd exp-drd/docs exp-drd/tests
Author: sewardj Date: 2007-12-04 21:27:18 + (Tue, 04 Dec 2007) New Revision: 7275 Log: DRD changes (Bart Van Assche) * Add docs: exp-drd/docs/README.txt * Added one drd suppression pattern, and cleaned up the suppression file. * All regression tests now pass on x86_64 and i386, including sigalrm. * Updated TODO.txt file. * pth_create_chain test is now started with 100 threads instead of 10 -- 10 was not enough. * DRD no longer exits on PPC32 and PPC64 but just prints a warning message before it starts. Added: trunk/exp-drd/docs/README.txt Modified: trunk/NEWS trunk/exp-drd/TODO.txt trunk/exp-drd/docs/Makefile.am trunk/exp-drd/drd_main.c trunk/exp-drd/drd_thread.c trunk/exp-drd/drd_thread.h trunk/exp-drd/tests/pth_create_chain.vgtest trunk/glibc-2.X-drd.supp Modified: trunk/NEWS === --- trunk/NEWS 2007-12-04 21:18:06 UTC (rev 7274) +++ trunk/NEWS 2007-12-04 21:27:18 UTC (rev 7275) @@ -1,7 +1,6 @@ Release 3.3.0 (7 December 2007) ~~~ - 3.3.0 is a feature release with many significant improvements and the usual collection of bug fixes. This release supports X86/Linux, AMD64/Linux, PPC32/Linux and PPC64/Linux. Support for recent distros @@ -50,7 +49,7 @@ exp-omega/docs/omega_introduction.txt. * exp-DRD: a data race detector based on the happens-before -relation. See exp-drd/TODO.txt. +relation. See exp-drd/docs/README.txt. - Scalability improvements for very large programs, particularly those which have a million or more malloc'd blocks in use at once. These Modified: trunk/exp-drd/TODO.txt === --- trunk/exp-drd/TODO.txt 2007-12-04 21:18:06 UTC (rev 7274) +++ trunk/exp-drd/TODO.txt 2007-12-04 21:27:18 UTC (rev 7275) @@ -4,13 +4,16 @@ Data-race detection algorithm ~ -- Implement glibc version detection in drd_main.c. +- Rename drd_preloaded.c into drd_intercepts.c. +- Propose on the Valgrind developers mailing list to add scripts + "run-in-place" and "debug-in-place". - Implement segment merging, such that the number of segments per thread remains limited even when there is no synchronization between threads. - Find out why a race is reported on std::string::string(std::string const&) (stc test case 16). - Make sure that drd supports more than 256 mutexes. - Performance testing and tuning. +- pthread semaphore support. - pthread rwlock state tracking and support. - pthread barrier state tracking and support. - mutexes: support for pthread_mutex_timedlock() (recently added to the POSIX @@ -42,15 +45,12 @@ Known bugs ~~ -- Gets killed by the OOM handler for some applications, e.g. knode and - OpenOffice. -- [AMD64] Reports "Allocation context: unknown" for BSS symbols on AMD64 - (works fine on X86). This is a bug in Valgrind's debug info reader - -- VG_(find_seginfo)() returns NULL for BSS symbols on AMD64. Not yet in +- Gets killed by the OOM handler for realistically sized applications, + e.g. knode and OpenOffice. +- [x86_64] Reports "Allocation context: unknown" for BSS symbols on AMD64 + (works fine on i386). This is a bug in Valgrind's debug info reader + -- VG_(find_seginfo)() returns NULL for BSS symbols on x86_64. Not yet in the KDE bug tracking system. -- False positives are reported when a signal is sent via pthread_kill() from - one thread to another (bug 152728). -- Crashes (cause not known): VALGRIND_LIB=$PWD/.in_place coregrind/valgrind --tool=exp-drd --trace-mem=yes /bin/ls Known performance issues: - According to cachegrind, VG_(OSet_Next)() is taking up most CPU cycles. Modified: trunk/exp-drd/docs/Makefile.am === --- trunk/exp-drd/docs/Makefile.am 2007-12-04 21:18:06 UTC (rev 7274) +++ trunk/exp-drd/docs/Makefile.am 2007-12-04 21:27:18 UTC (rev 7275) @@ -1 +1 @@ -#EXTRA_DIST = drd-manual.xml +EXTRA_DIST = README.txt Added: trunk/exp-drd/docs/README.txt === --- trunk/exp-drd/docs/README.txt (rev 0) +++ trunk/exp-drd/docs/README.txt 2007-12-04 21:27:18 UTC (rev 7275) @@ -0,0 +1,83 @@ +DRD: a Data Race Detector += + +Last update: December 3, 2007 by Bart Van Assche. + + +The Difficulty of Multithreading Programming + +Multithreading is a concept to model multiple concurrent activities within a +single process. Since the invention of the multithreading concept, there is an +ongoing debate about which way to model concurrent activities is better -- +multithreading or message passing. This debate exists because +multithreaded programming is error prone: multithreaded programs can exhibit +data races and/or deadlocks. Despite these risks multithreaded
[Valgrind-developers] valgrind: r7276 - trunk/massif/docs
Author: njn Date: 2007-12-04 21:35:55 + (Tue, 04 Dec 2007) New Revision: 7276 Log: Minor Massif docs clarifications. Modified: trunk/massif/docs/ms-manual.xml Modified: trunk/massif/docs/ms-manual.xml === --- trunk/massif/docs/ms-manual.xml 2007-12-04 21:27:18 UTC (rev 7275) +++ trunk/massif/docs/ms-manual.xml 2007-12-04 21:35:55 UTC (rev 7276) @@ -427,9 +427,38 @@ point in the program into a single tree, which gives a complete picture of how and why all heap memory was allocated. -The final part of the output is similar: +Note that the tree entries correspond not to functions, but to +individual code locations. For example, if function A +calls malloc, and function B calls +A twice, once on line 10 and once on line 11, then +the two calls will result in two distinct stack traces in the tree. In +contrast, if B calls A repeatedly +from line 15 (e.g. due to a loop), then each of those calls will be +represented by the same stack trace in the tree. +Note also that tree entry with children in the example satisfies an +invariant: the entry's size is equal to the sum of its children's sizes. +For example, the first entry has size 20,000B, and its children have sizes +10,000B, 8,000B, and 2,000B. In general, this invariant almost always +holds. However, in rare circumstances stack traces can be malformed, in +which case a stack trace can be a sub-trace of another stack trace. This +means that some entries in the tree may not satisfy the invariant -- the +entry's size will be greater than the sum of its children's sizes. Massif +can sometimes detect when this happens; if it does, it issues a +warning: + + +However, Massif does not detect and warn about every such occurrence. +Fortunately, malformed stack traces are rare in practice. + +Returning now to ms_print's output, the final part is similar: + +
[Valgrind-developers] valgrind: r7277 - trunk/memcheck/tests
Author: sewardj Date: 2007-12-05 01:19:20 + (Wed, 05 Dec 2007) New Revision: 7277 Log: Update expected outputs. Use new naming scheme now permitted by tests/vg_regtest. Added: trunk/memcheck/tests/malloc_free_fill.stderr.exp-glibc25-amd64 trunk/memcheck/tests/malloc_free_fill.stderr.exp-glibc25-x86 Removed: trunk/memcheck/tests/malloc_free_fill.stderr.exp Modified: trunk/memcheck/tests/Makefile.am Modified: trunk/memcheck/tests/Makefile.am === --- trunk/memcheck/tests/Makefile.am2007-12-04 21:35:55 UTC (rev 7276) +++ trunk/memcheck/tests/Makefile.am2007-12-05 01:19:20 UTC (rev 7277) @@ -67,7 +67,8 @@ long_namespace_xml.vgtest long_namespace_xml.stdout.exp \ long_namespace_xml.stderr.exp \ malloc_free_fill.vgtest malloc_free_fill.stdout.exp \ - malloc_free_fill.stderr.exp \ + malloc_free_fill.stderr.exp-glibc25-amd64 \ + malloc_free_fill.stderr.exp-glibc25-x86 \ malloc_usable.stderr.exp malloc_usable.vgtest \ malloc1.stderr.exp malloc1.vgtest \ malloc2.stderr.exp malloc2.vgtest \ Deleted: trunk/memcheck/tests/malloc_free_fill.stderr.exp === --- trunk/memcheck/tests/malloc_free_fill.stderr.exp2007-12-04 21:35:55 UTC (rev 7276) +++ trunk/memcheck/tests/malloc_free_fill.stderr.exp2007-12-05 01:19:20 UTC (rev 7277) @@ -1,57 +0,0 @@ - -test simple malloc/free: -Use of uninitialised value of size 8 - at 0x: _itoa_word (in /...libc...) - by 0x: ... - by 0x: ... - by 0x: ... - by 0x: ... - by 0x: main (malloc_free_fill.c:17) - -Conditional jump or move depends on uninitialised value(s) - at 0x: _itoa_word (in /...libc...) - by 0x: ... - by 0x: ... - by 0x: ... - by 0x: ... - by 0x: main (malloc_free_fill.c:17) - -Conditional jump or move depends on uninitialised value(s) - at 0x: vfprintf (in /...libc...) - by 0x: ... - by 0x: ... - by 0x: ... - by 0x: main (malloc_free_fill.c:17) -(should be malloc-filled) a[4] = - -Invalid read of size 4 - at 0x: main (malloc_free_fill.c:20) - Address 0x is 20 bytes inside a block of size 40 free'd - at 0x: free (vg_replace_malloc.c:...) - by 0x: main (malloc_free_fill.c:19) -(should be free-filled) a[5] = -test realloc-larger: -(should be malloc-filled)r[25] = - -Invalid read of size 4 - at 0x: main (malloc_free_fill.c:33) - Address 0x is 104 bytes inside a block of size 120 free'd - at 0x: realloc (vg_replace_malloc.c:...) - by 0x: main (malloc_free_fill.c:31) -(should be free-filled) oldr[26] = -(should be malloc-filled)r[35] = -test realloc-smaller: -(should be malloc-filled)r[25] = - -Invalid read of size 4 - at 0x: main (malloc_free_fill.c:49) - Address 0x is not stack'd, malloc'd or (recently) free'd -(should be free-filled) oldr[26] = -test calloc: -(should be zero) a[42] = 0 - -ERROR SUMMARY: 67 errors from 6 contexts (suppressed: 0 from 0) -malloc/free: in use at exit: 0 bytes in 0 blocks. -malloc/free: 6 allocs, 6 frees, 920 bytes allocated. -For a detailed leak analysis, rerun with: --leak-check=yes -For counts of detected errors, rerun with: -v Copied: trunk/memcheck/tests/malloc_free_fill.stderr.exp-glibc25-amd64 (from rev 7276, trunk/memcheck/tests/malloc_free_fill.stderr.exp) === --- trunk/memcheck/tests/malloc_free_fill.stderr.exp-glibc25-amd64 (rev 0) +++ trunk/memcheck/tests/malloc_free_fill.stderr.exp-glibc25-amd64 2007-12-05 01:19:20 UTC (rev 7277) @@ -0,0 +1,57 @@ + +test simple malloc/free: +Use of uninitialised value of size 8 + at 0x: _itoa_word (in /...libc...) + by 0x: ... + by 0x: ... + by 0x: ... + by 0x: ... + by 0x: main (malloc_free_fill.c:17) + +Conditional jump or move depends on uninitialised value(s) + at 0x: _itoa_word (in /...libc...) + by 0x: ... + by 0x: ... + by 0x: ... + by 0x: ... + by 0x: main (malloc_free_fill.c:17) + +Conditional jump or move depends on uninitialised value(s) + at 0x: vfprintf (in /...libc...) + by 0x: ... + by 0x: ... + by 0x: ... + by 0x: main (malloc_free_fill.c:17) +(should be malloc-filled) a[4] = + +Invalid read of size 4 + at 0x: main (malloc_free_fill.c:20) + Address 0x is 20 bytes inside a block of size 40 free'd + at 0x: free (vg_replace_malloc.c:...) + by 0x: main (malloc_free_fill.c:19) +(should be fr
[Valgrind-developers] valgrind: r7278 - trunk/exp-omega
Author: sewardj Date: 2007-12-05 01:31:42 + (Wed, 05 Dec 2007) New Revision: 7278 Log: Rename a header file. Added: trunk/exp-omega/exp-omega.h Removed: trunk/exp-omega/omega.h Modified: trunk/exp-omega/Makefile.am trunk/exp-omega/o_main.c trunk/exp-omega/o_replace_memops.c Modified: trunk/exp-omega/Makefile.am === --- trunk/exp-omega/Makefile.am 2007-12-05 01:19:20 UTC (rev 7277) +++ trunk/exp-omega/Makefile.am 2007-12-05 01:31:42 UTC (rev 7278) @@ -130,7 +130,7 @@ oincludedir = $(includedir)/valgrind -oinclude_HEADERS = omega.h +oinclude_HEADERS = exp-omega.h noinst_HEADERS = Copied: trunk/exp-omega/exp-omega.h (from rev 7276, trunk/exp-omega/omega.h) === --- trunk/exp-omega/exp-omega.h (rev 0) +++ trunk/exp-omega/exp-omega.h 2007-12-05 01:31:42 UTC (rev 7278) @@ -0,0 +1,61 @@ + +/**/ +/*--- Definitions needing to be shared between source files. ---*/ +/*--- omega.h ---*/ +/**/ + +/* + This file is part of Omega, a Valgrind tool for instantly detecting + memory leaks. + + Copyright (C) 2006-2007 Bryan "Brain Murders" Meredith + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307, USA. + + The GNU General Public License is contained in the file COPYING. + + The current maintainer is Rich Coe <[EMAIL PROTECTED]>. +*/ + +#ifndef __omega_h +#define __omega_h + +#include "valgrind.h" + +/* +** Setup client request calls so we can track entering and leaving main(). +*/ +typedef +enum { + VG_USERREQ__ENTERING_MAIN = VG_USERREQ_TOOL_BASE('O','M'), + VG_USERREQ__LEAVING_MAIN +} Vg_OmegaClientRequest; + +#define VALGRIND_DO_ENTER_MAIN \ + {unsigned int _qzz_res; \ +VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \ +VG_USERREQ__ENTERING_MAIN, \ +0, 0, 0, 0, 0); \ + } + +#define VALGRIND_DO_LEAVE_MAIN \ + {unsigned int _qzz_res; \ +VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \ +VG_USERREQ__LEAVING_MAIN,\ +0, 0, 0, 0, 0); \ + } + +#endif Modified: trunk/exp-omega/o_main.c === --- trunk/exp-omega/o_main.c2007-12-05 01:19:20 UTC (rev 7277) +++ trunk/exp-omega/o_main.c2007-12-05 01:31:42 UTC (rev 7278) @@ -63,7 +63,7 @@ #include "libvex_guest_offsets.h" -#include "omega.h" +#include "exp-omega.h" /* ** A little sanity in a mad, mad world. Modified: trunk/exp-omega/o_replace_memops.c === --- trunk/exp-omega/o_replace_memops.c 2007-12-05 01:19:20 UTC (rev 7277) +++ trunk/exp-omega/o_replace_memops.c 2007-12-05 01:31:42 UTC (rev 7278) @@ -37,7 +37,7 @@ #include #include "pub_tool_basics.h" #include "valgrind.h" -#include "omega.h" +#include "exp-omega.h" /* - We have our own versions of these functions so that we can correctly Deleted: trunk/exp-omega/omega.h === --- trunk/exp-omega/omega.h 2007-12-05 01:19:20 UTC (rev 7277) +++ trunk/exp-omega/omega.h 2007-12-05 01:31:42 UTC (rev 7278) @@ -1,61 +0,0 @@ - -/**/ -/*--- Definitions needing to be shared between source files. ---*/ -/*--- omega.h ---*/ -/**/ - -/* - This file is part of Omega, a Valgrind tool for instantly detecting - memory leaks. - - Copyright (C) 2006-2007 Bryan "Brain Murders" Meredith - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General
[Valgrind-developers] valgrind: r7279 - in trunk: docs/xml include
Author: njn Date: 2007-12-05 21:51:50 + (Wed, 05 Dec 2007) New Revision: 7279 Log: Document flakiness of NON_SIMD_CALL* in comments and the manual. Modified: trunk/docs/xml/manual-core-adv.xml trunk/include/valgrind.h Modified: trunk/docs/xml/manual-core-adv.xml === --- trunk/docs/xml/manual-core-adv.xml 2007-12-05 01:31:42 UTC (rev 7278) +++ trunk/docs/xml/manual-core-adv.xml 2007-12-05 21:51:50 UTC (rev 7279) @@ -200,7 +200,14 @@ client programs. Warning: Only use these if you -really know what you are doing. +really know what you are doing. They aren't +entirely reliable, and can cause Valgrind to crash. +Generally, your prospects of these working are made higher if the called +function does not refer to any global variables, and does not refer to any +libc or other functions (printf et al). Any kind of entanglement with libc +or dynamic linking is likely to have a bad outcome, for tricky reasons +which we've grappled with a lot in the past. + Modified: trunk/include/valgrind.h === --- trunk/include/valgrind.h2007-12-05 01:31:42 UTC (rev 7278) +++ trunk/include/valgrind.h2007-12-05 21:51:50 UTC (rev 7279) @@ -3715,6 +3715,15 @@ Word f(Word tid, Word arg1, Word arg2) where "Word" is a word-sized type. + + Note that these client requests are not entirely reliable. For example, + if you call a function with them that subsequently calls printf(), + there's a high chance Valgrind will crash. Generally, your prospects of + these working are made higher if the called function does not refer to + any global variables, and does not refer to any libc or other functions + (printf et al). Any kind of entanglement with libc or dynamic linking is + likely to have a bad outcome, for tricky reasons which we've grappled + with a lot in the past. */ #define VALGRIND_NON_SIMD_CALL0(_qyy_fn) \ __extension__ \ - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7282 - trunk
Author: sewardj Date: 2007-12-06 02:15:16 + (Thu, 06 Dec 2007) New Revision: 7282 Log: --> 3.3.0.RC2. Modified: trunk/NEWS trunk/configure.in /usr/local/etc/subversion//commit-email.pl: `/usr/local/bin/svnlook diff /home/svn/repos/valgrind -r 7282' failed with this output: Modified: trunk/NEWS === --- trunk/NEWS 2007-12-06 02:13:37 UTC (rev 7281) +++ trunk/NEWS 2007-12-06 02:15:16 UTC (rev 7282) @@ -228,6 +228,7 @@ OSs. (3.3.0.RC1: 2 Dec 2007, vex r1803, valgrind r7268). +(3.3.0.RC2: 5 Dec 2007, vex r1804, valgrind r7282). (3.3.0: X Dec 2006, vex r, valgrind r). Modified: trunk/configure.in === --- trunk/configure.in 2007-12-06 02:13:37 UTC (rev 7281) +++ trunk/configure.in 2007-12-06 02:15:16 UTC (rev 7282) @@ -8,7 +8,7 @@ #### # Process this file with autoconf to produce a configure script. -AC_INIT(Valgrind, 3.3.0.RC1, [EMAIL PROTECTED]) +AC_INIT(Valgrind, 3.3.0.RC2, [EMAIL PROTECTED]) AC_CONFIG_SRCDIR(coregrind/m_main.c) AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE svnlook: Can't open directory '/tmp/svnlook.3': Not a directory - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7281 - trunk
Author: sewardj Date: 2007-12-06 02:13:37 + (Thu, 06 Dec 2007) New Revision: 7281 Log: Update. Modified: trunk/ACKNOWLEDGEMENTS /usr/local/etc/subversion//commit-email.pl: `/usr/local/bin/svnlook diff /home/svn/repos/valgrind -r 7281' failed with this output: Modified: trunk/ACKNOWLEDGEMENTS === --- trunk/ACKNOWLEDGEMENTS 2007-12-06 01:58:05 UTC (rev 7280) +++ trunk/ACKNOWLEDGEMENTS 2007-12-06 02:13:37 UTC (rev 7281) @@ -60,5 +60,9 @@ for use in Valgrind. Michael Matz and Simon Hausmann modified the GNU binutils demangler(s) for use in Valgrind. -And lots and lots of other people sent bug reports, patches, and very -helpful feedback. +Many, many people sent bug reports, patches, and helpful feedback. + +Development of Valgrind was supported in part by the Tri-Lab Partners +(Lawrence Livermore National Laboratory, Los Alamos National +Laboratory, and Sandia National Laboratories) of the U.S. Department +of Energy's Advanced Simulation & Computing (ASC) Program. svnlook: Can't open directory '/tmp/svnlook.2': Not a directory - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7280 - trunk
Author: sewardj Date: 2007-12-06 01:58:05 + (Thu, 06 Dec 2007) New Revision: 7280 Log: Another supp. Modified: trunk/glibc-2.34567-NPTL-helgrind.supp /usr/local/etc/subversion//commit-email.pl: `/usr/local/bin/svnlook diff /home/svn/repos/valgrind -r 7280' failed with this output: Modified: trunk/glibc-2.34567-NPTL-helgrind.supp === --- trunk/glibc-2.34567-NPTL-helgrind.supp 2007-12-05 21:51:50 UTC (rev 7279) +++ trunk/glibc-2.34567-NPTL-helgrind.supp 2007-12-06 01:58:05 UTC (rev 7280) @@ -346,6 +346,13 @@ obj:/lib*/ld-2.3.*so } { + helgrind-glibc23-003 + Helgrind:Race + obj:/lib*/ld-2.3.*so + obj:/lib*/libc-2.3.*so + obj:/lib*/libc-2.3.*so +} +{ helgrind-glibc23-004 Helgrind:Race obj:/lib*/libc-2.3.*so svnlook: Can't open directory '/tmp/svnlook.1': Not a directory - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7283 - in trunk: coregrind include
Author: sewardj Date: 2007-12-09 02:08:42 + (Sun, 09 Dec 2007) New Revision: 7283 Log: Don't do comparisons of (signed) Words by merely subtracting them, as this does not always produce correct results. Instead use a slower but correct method. Fixes #147545. (Nick Nethercote, Tom Hughes et al) Modified: trunk/coregrind/m_oset.c trunk/include/pub_tool_oset.h Modified: trunk/coregrind/m_oset.c === --- trunk/coregrind/m_oset.c2007-12-06 02:15:16 UTC (rev 7282) +++ trunk/coregrind/m_oset.c2007-12-09 02:08:42 UTC (rev 7283) @@ -175,7 +175,17 @@ // Compare the first word of each element. Inlining is *crucial*. static inline Word fast_cmp(void* k, AvlNode* n) { - return ( *(Word*)k - *(Word*)elem_of_node(n) ); + Word w1 = *(Word*)k; + Word w2 = *(Word*)elem_of_node(n); + // In previous versions, we tried to do this faster by doing + // "return w1 - w2". But it didn't work reliably, because the + // complete result of subtracting two N-bit numbers is an N+1-bit + // number, and what the caller is interested in is the sign of + // the complete N+1-bit result. The branching version is slightly + // slower, but safer and easier to understand. + if (w1 > w2) return 1; + if (w1 < w2) return -1; + return 0; } // Compare a key and an element. Inlining is *crucial*. @@ -490,22 +500,23 @@ while (True) { if (curr == NULL) return NULL; cmpres = slow_cmp(t, k, curr); - if (cmpres < 0) curr = curr->left; else - if (cmpres > 0) curr = curr->right; else - return curr; + if (cmpres < 0) curr = curr->left; + else if (cmpres > 0) curr = curr->right; + else return curr; } } else { // Fast-track special case. We use the no-check version of // elem_of_node because it saves about 10% on lookup time. This // shouldn't be very dangerous because each node will have been // checked on insertion. - Word kk = *(Word*)k; + Word w1 = *(Word*)k; + Word w2; while (True) { if (curr == NULL) return NULL; - cmpres = kk - *(Word*)elem_of_node_no_check(curr); - if (cmpres < 0) curr = curr->left; else - if (cmpres > 0) curr = curr->right; else - return curr; + w2 = *(Word*)elem_of_node_no_check(curr); + if (w1 < w2) curr = curr->left; + else if (w1 > w2) curr = curr->right; + else return curr; } } } Modified: trunk/include/pub_tool_oset.h === --- trunk/include/pub_tool_oset.h 2007-12-06 02:15:16 UTC (rev 7282) +++ trunk/include/pub_tool_oset.h 2007-12-09 02:08:42 UTC (rev 7283) @@ -72,7 +72,7 @@ typedef struct _OSet OSet; -// - Cmp: returns -1, 0 or 1 if key is <=, == or >= elem. +// - Cmp: returns -1, 0 or 1 if key is <, == or > elem. // - Alloc: allocates a chunk of memory. // - Free: frees a chunk of memory allocated with Alloc. - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7284 - trunk/helgrind
Author: sewardj Date: 2007-12-09 02:14:35 + (Sun, 09 Dec 2007) New Revision: 7284 Log: Don't do comparisons of (signed) Words by merely subtracting them, as this does not always produce correct results. Instead use a slower but correct method. Analogous fix to that applied to m_oset.c by r7283. Modified: trunk/helgrind/hg_wordfm.c Modified: trunk/helgrind/hg_wordfm.c === --- trunk/helgrind/hg_wordfm.c 2007-12-09 02:08:42 UTC (rev 7283) +++ trunk/helgrind/hg_wordfm.c 2007-12-09 02:14:35 UTC (rev 7284) @@ -142,6 +142,15 @@ + (nd->child[1] ? size_avl_nonNull(nd->child[1]) : 0); } +/* Signedly compare w1 and w2. If w1 < w2, produce a negative number; + if w1 > w2 produce a positive number, and if w1 == w2 produce + zero. */ +static inline Word cmp_signed_Words ( Word w1, Word w2 ) { + if (w1 < w2) return -1; + if (w1 > w2) return 1; + return 0; +} + /* Insert element a into the AVL tree t. Returns True if the depth of the tree has grown. If element with that key is already present, just copy a->val to existing node, first returning old ->val field @@ -169,7 +178,8 @@ } cmpres = kCmp ? /*boxed*/ kCmp( (*rootp)->key, a->key ) - : /*unboxed*/ ((Word)(*rootp)->key) - ((Word)a->key); + : /*unboxed*/ cmp_signed_Words( (Word)(*rootp)->key, + (Word)a->key ); if (cmpres > 0) { /* insert into the left subtree */ @@ -257,7 +267,8 @@ Bool ch; Word cmpres; cmpres = kCmp ? /*boxed*/ kCmp( (*rootp)->key, a->key ) - : /*unboxed*/ ((Word)(*rootp)->key) - ((Word)a->key); + : /*unboxed*/ cmp_signed_Words( (Word)(*rootp)->key, + (Word)a->key ); if (cmpres > 0){ /* remove from the left subtree */ @@ -382,23 +393,23 @@ { if (kCmp) { /* Boxed comparisons */ - Word cmpres; + Word cmpresS; while (True) { if (t == NULL) return NULL; - cmpres = kCmp(t->key, k); - if (cmpres > 0) t = t->child[0]; else - if (cmpres < 0) t = t->child[1]; else + cmpresS = kCmp(t->key, k); + if (cmpresS > 0) t = t->child[0]; else + if (cmpresS < 0) t = t->child[1]; else return t; } } else { /* Unboxed comparisons */ - Word cmpres; /* signed */ + Word cmpresS; /* signed */ UWord cmpresU; /* unsigned */ while (True) { if (t == NULL) return NULL; /* unlikely ==> predictable */ - cmpres = ((Word)t->key) - ((Word)k); - if (cmpres == 0) return t; /* unlikely ==> predictable */ - cmpresU = (UWord)cmpres; + cmpresS = cmp_signed_Words( (Word)t->key, (Word)k ); + if (cmpresS == 0) return t; /* unlikely ==> predictable */ + cmpresU = (UWord)cmpresS; cmpresU >>=/*unsigned*/ (8 * sizeof(cmpresU) - 1); t = t->child[cmpresU]; } - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7285 - trunk/exp-drd/tests
Author: sewardj Date: 2007-12-09 02:21:22 + (Sun, 09 Dec 2007) New Revision: 7285 Log: Add missing file to tarball. Modified: trunk/exp-drd/tests/Makefile.am Modified: trunk/exp-drd/tests/Makefile.am === --- trunk/exp-drd/tests/Makefile.am 2007-12-09 02:14:35 UTC (rev 7284) +++ trunk/exp-drd/tests/Makefile.am 2007-12-09 02:21:22 UTC (rev 7285) @@ -12,6 +12,7 @@ EXTRA_DIST = $(noinst_SCRIPTS) \ fp_race.vgtest \ fp_race.stdout.exp fp_race.stderr.exp \ + fp_race.stderr.exp2 \ fp_race2.vgtest \ fp_race2.stdout.exp fp_race2.stderr.exp \ pth_broadcast.vgtest\ - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7286 - trunk
Author: sewardj Date: 2007-12-09 02:22:55 + (Sun, 09 Dec 2007) New Revision: 7286 Log: Another supp. Modified: trunk/glibc-2.34567-NPTL-helgrind.supp Modified: trunk/glibc-2.34567-NPTL-helgrind.supp === --- trunk/glibc-2.34567-NPTL-helgrind.supp 2007-12-09 02:21:22 UTC (rev 7285) +++ trunk/glibc-2.34567-NPTL-helgrind.supp 2007-12-09 02:22:55 UTC (rev 7286) @@ -167,6 +167,13 @@ obj:/lib*/libc-2.7.*so } { + helgrind-glibc27-005 + Helgrind:Race + obj:/lib*/libpthread-2.7.*so + obj:/lib*/libpthread-2.7.*so + obj:/lib*/libpthread-2.7.*so +} +{ helgrind-glibc27-011 Helgrind:Race obj:/lib*/libc-2.7.*so @@ -214,6 +221,13 @@ obj:/lib*/libc-2.6.*so } { + helgrind-glibc26-005 + Helgrind:Race + obj:/lib*/libpthread-2.6.*so + obj:/lib*/libpthread-2.6.*so + obj:/lib*/libpthread-2.6.*so +} +{ helgrind-glibc26-006 Helgrind:Race obj:/lib*/libpthread-2.6.*so - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7287 - trunk
Author: sewardj Date: 2007-12-09 02:24:02 + (Sun, 09 Dec 2007) New Revision: 7287 Log: Finalise distro docs for 3.3.0. Modified: trunk/ACKNOWLEDGEMENTS trunk/NEWS trunk/README trunk/README_PACKAGERS Modified: trunk/ACKNOWLEDGEMENTS === --- trunk/ACKNOWLEDGEMENTS 2007-12-09 02:22:55 UTC (rev 7286) +++ trunk/ACKNOWLEDGEMENTS 2007-12-09 02:24:02 UTC (rev 7287) @@ -60,6 +60,9 @@ for use in Valgrind. Michael Matz and Simon Hausmann modified the GNU binutils demangler(s) for use in Valgrind. +David Woodhouse and Tom Hughes have helped out with test and build +machines over the course of many releases. + Many, many people sent bug reports, patches, and helpful feedback. Development of Valgrind was supported in part by the Tri-Lab Partners Modified: trunk/NEWS === --- trunk/NEWS 2007-12-09 02:22:55 UTC (rev 7286) +++ trunk/NEWS 2007-12-09 02:24:02 UTC (rev 7287) @@ -185,6 +185,7 @@ 146781 Adding support for private futexes 147325 valgrind internal error on syscall (SYS_io_destroy, 0) 147498 amd64->IR: 0xF0 0xF 0xB0 0xF (lock cmpxchg %cl,(%rdi)) + 147545 Memcheck: mc_main.c:817 (get_sec_vbits8): Assertion 'n' failed. 147628 SALC opcode 0xd6 unimplemented 147825 crash on amd64-linux with gcc 4.2 and glibc 2.6 (CFI) 148174 Incorrect type of freed_list_volume causes assertion [...] Modified: trunk/README === --- trunk/README2007-12-09 02:22:55 UTC (rev 7286) +++ trunk/README2007-12-09 02:24:02 UTC (rev 7287) @@ -21,8 +21,11 @@ also perform detailed profiling, to speed up and reduce memory use of your programs. -The Valgrind distribution currently includes four tools: a memory error -detector, a thread error detector, a cache profiler and a heap profiler. +The Valgrind distribution currently includes five production grade +tools: a memory error detector, a thread error detector, a cache +profiler, a call graph profiler and a heap profiler. Experimental +tools are also included. They are distinguished by the "exp-" prefix +on their names. To give you an idea of what Valgrind tools do, when a program is run under the supervision of Memcheck, the memory error detector tool, all Modified: trunk/README_PACKAGERS === --- trunk/README_PACKAGERS 2007-12-09 02:22:55 UTC (rev 7286) +++ trunk/README_PACKAGERS 2007-12-09 02:24:02 UTC (rev 7287) @@ -1,11 +1,36 @@ +These notes were significantly updated on 6 Dec 2007 for the Valgrind +3.3.0 release. + Greetings, packaging person! This information is aimed at people building binary distributions of Valgrind. -Thanks for taking the time and effort to make a binary distribution -of Valgrind. The following notes may save you some trouble. +Thanks for taking the time and effort to make a binary distribution of +Valgrind. The following notes may save you some trouble. +-- Do not ship your Linux distro with a completely stripped + /lib/ld.so. At least leave the debugging symbol names on -- line + number info isn't necessary. If you don't want to leave symbols on + ld.so, alternatively you can have your distro install ld.so's + debuginfo package by default, or make ld.so.debuginfo be a + requirement of your Valgrind RPM/DEB/whatever. + + Reason for this is that Valgrind's Memcheck tool needs to intercept + calls to, and provide replacements for, some symbols in ld.so at + startup (most importantly strlen). If it cannot do that, Memcheck + shows a large number of false positives due to the highly optimised + strlen (etc) routines in ld.so. This has caused some trouble in + the past. As of version 3.3.0, on some targets (ppc32-linux, + ppc64-linux), Memcheck will simply stop at startup (and print an + error message) if such symbols are not present, because it is + infeasible to continue. + + It's not like this is going to cost you much space. We only need + the symbols for ld.so (a few K at most). Not the debug info and + not any debuginfo or extra symbols for any other libraries. + + -- (Unfortunate but true) When you configure to build with the --prefix=/foo/bar/xyzzy option, the prefix /foo/bar/xyzzy gets baked into valgrind. The consequence is that you _must_ install @@ -16,9 +41,10 @@ So you can't build a relocatable RPM / whatever from Valgrind. --- Don't strip the debug info off stage2 or libpthread.so. - Valgrind will still work if you do, but it will generate less - helpful error messages. Here's an example: +-- Don't strip the debug info off lib/valgrind/$platform/vgpreload*.so + in the installation tree. Either Valgrind won't work at all, or it + will still work if you do, but will generate less helpful error + messages. Here's an example:
[Valgrind-developers] valgrind: r7288 - trunk
Author: sewardj Date: 2007-12-09 02:25:44 + (Sun, 09 Dec 2007) New Revision: 7288 Log: Third time lucky, perhaps. Modified: trunk/NEWS trunk/configure.in Modified: trunk/NEWS === --- trunk/NEWS 2007-12-09 02:24:02 UTC (rev 7287) +++ trunk/NEWS 2007-12-09 02:25:44 UTC (rev 7288) @@ -230,6 +230,7 @@ (3.3.0.RC1: 2 Dec 2007, vex r1803, valgrind r7268). (3.3.0.RC2: 5 Dec 2007, vex r1804, valgrind r7282). +(3.3.0.RC3: 9 Dec 2007, vex r1804, valgrind r7288). (3.3.0: X Dec 2006, vex r, valgrind r). Modified: trunk/configure.in === --- trunk/configure.in 2007-12-09 02:24:02 UTC (rev 7287) +++ trunk/configure.in 2007-12-09 02:25:44 UTC (rev 7288) @@ -8,7 +8,7 @@ #### # Process this file with autoconf to produce a configure script. -AC_INIT(Valgrind, 3.3.0.RC2, [EMAIL PROTECTED]) +AC_INIT(Valgrind, 3.3.0.RC3, [EMAIL PROTECTED]) AC_CONFIG_SRCDIR(coregrind/m_main.c) AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7289 - trunk
Author: sewardj Date: 2007-12-10 22:17:42 + (Mon, 10 Dec 2007) New Revision: 7289 Log: Finalise 3.3.0. Modified: trunk/NEWS trunk/configure.in Modified: trunk/NEWS === --- trunk/NEWS 2007-12-09 02:25:44 UTC (rev 7288) +++ trunk/NEWS 2007-12-10 22:17:42 UTC (rev 7289) @@ -228,10 +228,10 @@ abstractified, particularly with respect to support for non-Linux OSs. -(3.3.0.RC1: 2 Dec 2007, vex r1803, valgrind r7268). -(3.3.0.RC2: 5 Dec 2007, vex r1804, valgrind r7282). -(3.3.0.RC3: 9 Dec 2007, vex r1804, valgrind r7288). -(3.3.0: X Dec 2006, vex r, valgrind r). +(3.3.0.RC1: 2 Dec 2007, vex r1803, valgrind r7268). +(3.3.0.RC2: 5 Dec 2007, vex r1804, valgrind r7282). +(3.3.0.RC3: 9 Dec 2007, vex r1804, valgrind r7288). +(3.3.0: 10 Dec 2006, vex r1804, valgrind r7289). Modified: trunk/configure.in === --- trunk/configure.in 2007-12-09 02:25:44 UTC (rev 7288) +++ trunk/configure.in 2007-12-10 22:17:42 UTC (rev 7289) @@ -8,7 +8,7 @@ #### # Process this file with autoconf to produce a configure script. -AC_INIT(Valgrind, 3.3.0.RC3, [EMAIL PROTECTED]) +AC_INIT(Valgrind, 3.3.0, [EMAIL PROTECTED]) AC_CONFIG_SRCDIR(coregrind/m_main.c) AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7290 - trunk
Author: sewardj Date: 2007-12-10 22:21:14 + (Mon, 10 Dec 2007) New Revision: 7290 Log: Duh. Sigh. etc. Modified: trunk/NEWS Modified: trunk/NEWS === --- trunk/NEWS 2007-12-10 22:17:42 UTC (rev 7289) +++ trunk/NEWS 2007-12-10 22:21:14 UTC (rev 7290) @@ -231,7 +231,7 @@ (3.3.0.RC1: 2 Dec 2007, vex r1803, valgrind r7268). (3.3.0.RC2: 5 Dec 2007, vex r1804, valgrind r7282). (3.3.0.RC3: 9 Dec 2007, vex r1804, valgrind r7288). -(3.3.0: 10 Dec 2006, vex r1804, valgrind r7289). +(3.3.0: 10 Dec 2007, vex r1804, valgrind r7290). - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7291 - tags
Author: sewardj Date: 2007-12-11 00:34:27 + (Tue, 11 Dec 2007) New Revision: 7291 Log: Tag 3.3.0 (copy of trunk r7290) Added: tags/VALGRIND_3_3_0/ Copied: tags/VALGRIND_3_3_0 (from rev 7290, trunk) - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7292 - branches
Author: sewardj Date: 2007-12-11 00:37:47 + (Tue, 11 Dec 2007) New Revision: 7292 Log: Create the 3.3.X stable branch (copy of trunk r7290) Added: branches/VALGRIND_3_3_BRANCH/ Copied: branches/VALGRIND_3_3_BRANCH (from rev 7290, trunk) - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] vex: r1805 - tags
Author: sewardj Date: 2007-12-11 00:40:20 + (Tue, 11 Dec 2007) New Revision: 1805 Log: Tag for Valgrind 3.3.0 (copy of trunk r1804) Added: tags/VEX_3_3_0/ Copied: tags/VEX_3_3_0 (from rev 1804, trunk) - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] vex: r1806 - branches
Author: sewardj Date: 2007-12-11 00:41:57 + (Tue, 11 Dec 2007) New Revision: 1806 Log: Create stable branch associated with Valgrind 3.3.X (copy of trunk r1804) --This line, and those below, will be ignored-- AVEX_3_3_BRANCH Added: branches/VEX_3_3_BRANCH/ Copied: branches/VEX_3_3_BRANCH (from rev 1804, trunk) - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7293 - tags/VALGRIND_3_3_0
Author: sewardj Date: 2007-12-11 00:46:20 + (Tue, 11 Dec 2007) New Revision: 7293 Log: Swizzle external. Modified: tags/VALGRIND_3_3_0/ Property changes on: tags/VALGRIND_3_3_0 ___ Name: svn:externals - VEX svn://svn.valgrind.org/vex/trunk + VEX svn://svn.valgrind.org/vex/tags/VEX_3_3_0 - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7294 - branches/VALGRIND_3_3_BRANCH
Author: sewardj Date: 2007-12-11 00:47:48 + (Tue, 11 Dec 2007) New Revision: 7294 Log: Swizzle external. Modified: branches/VALGRIND_3_3_BRANCH/ Property changes on: branches/VALGRIND_3_3_BRANCH ___ Name: svn:externals - VEX svn://svn.valgrind.org/vex/trunk + VEX svn://svn.valgrind.org/vex/branches/VEX_3_3_BRANCH - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7295 - trunk/docs/internals
Author: sewardj Date: 2007-12-11 00:49:33 + (Tue, 11 Dec 2007) New Revision: 7295 Log: Update notes on repo-mangling. Modified: trunk/docs/internals/release-HOWTO.txt Modified: trunk/docs/internals/release-HOWTO.txt === --- trunk/docs/internals/release-HOWTO.txt 2007-12-11 00:47:48 UTC (rev 7294) +++ trunk/docs/internals/release-HOWTO.txt 2007-12-11 00:49:33 UTC (rev 7295) @@ -134,20 +134,20 @@ branches too. Useful examples: cd valgrind -svn copy trunk tags/VALGRIND_3_1_0 -svn copy trunk branches/VALGRIND_3_1_BRANCH +svn copy trunk tags/VALGRIND_3_3_0 +svn copy trunk branches/VALGRIND_3_3_BRANCH cd vex -svn copy trunk tags/VEX_3_1_0 -svn copy trunk branches/VEX_3_1_BRANCH +svn copy trunk tags/VEX_3_3_0 +svn copy trunk branches/VEX_3_3_BRANCH cd valgrind -cd VALGRIND_3_1_0 +cd tags/VALGRIND_3_3_0 svn propset svn:externals \ - "VEX svn://svn.valgrind.org/vex/tags/VEX_3_1_0" . -cd VALGRIND_3_1_BRANCH + "VEX svn://svn.valgrind.org/vex/tags/VEX_3_3_0" . +cd branches/VALGRIND_3_3_BRANCH svn propset svn:externals \ - "VEX svn://svn.valgrind.org/vex/branches/VEX_3_1_BRANCH" . + "VEX svn://svn.valgrind.org/vex/branches/VEX_3_3_BRANCH" . - Update website: - Put the tarball up. - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7296 - trunk
Author: sewardj Date: 2007-12-11 00:50:54 + (Tue, 11 Dec 2007) New Revision: 7296 Log: Bop version. Modified: trunk/configure.in Modified: trunk/configure.in === --- trunk/configure.in 2007-12-11 00:49:33 UTC (rev 7295) +++ trunk/configure.in 2007-12-11 00:50:54 UTC (rev 7296) @@ -8,7 +8,7 @@ #### # Process this file with autoconf to produce a configure script. -AC_INIT(Valgrind, 3.3.0, [EMAIL PROTECTED]) +AC_INIT(Valgrind, 3.4.0.SVN, [EMAIL PROTECTED]) AC_CONFIG_SRCDIR(coregrind/m_main.c) AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7297 - branches/VALGRIND_3_3_BRANCH
Author: sewardj Date: 2007-12-11 01:03:22 + (Tue, 11 Dec 2007) New Revision: 7297 Log: Bop version. Modified: branches/VALGRIND_3_3_BRANCH/configure.in Modified: branches/VALGRIND_3_3_BRANCH/configure.in === --- branches/VALGRIND_3_3_BRANCH/configure.in 2007-12-11 00:50:54 UTC (rev 7296) +++ branches/VALGRIND_3_3_BRANCH/configure.in 2007-12-11 01:03:22 UTC (rev 7297) @@ -8,7 +8,7 @@ #### # Process this file with autoconf to produce a configure script. -AC_INIT(Valgrind, 3.3.0, [EMAIL PROTECTED]) +AC_INIT(Valgrind, 3.3.1.SVN, [EMAIL PROTECTED]) AC_CONFIG_SRCDIR(coregrind/m_main.c) AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind-www r339 - in trunk: . docs/manual downloads php
Author: sewardj Date: 2007-12-11 02:45:52 + (Tue, 11 Dec 2007) New Revision: 339 Log: Update for 3.3.0, including putting the manual on-line. Modified: trunk/docs/manual/FAQ.html trunk/docs/manual/QuickStart.html trunk/docs/manual/cg-manual.html trunk/docs/manual/cl-format.html trunk/docs/manual/cl-manual.html trunk/docs/manual/dist.acknowledge.html trunk/docs/manual/dist.authors.html trunk/docs/manual/dist.html trunk/docs/manual/dist.install.html trunk/docs/manual/dist.news.html trunk/docs/manual/dist.readme-developers.html trunk/docs/manual/dist.readme-missing.html trunk/docs/manual/dist.readme-packagers.html trunk/docs/manual/dist.readme.html trunk/docs/manual/faq.html trunk/docs/manual/hg-manual.html trunk/docs/manual/index.html trunk/docs/manual/license.gfdl.html trunk/docs/manual/license.gpl.html trunk/docs/manual/licenses.html trunk/docs/manual/lk-manual.html trunk/docs/manual/manual-core.html trunk/docs/manual/manual-intro.html trunk/docs/manual/manual.html trunk/docs/manual/mc-manual.html trunk/docs/manual/ms-manual.html trunk/docs/manual/nl-manual.html trunk/docs/manual/quick-start.html trunk/docs/manual/tech-docs.html trunk/docs/manual/valgrind_manual.html.tar.bz2 trunk/docs/manual/valgrind_manual.pdf trunk/docs/manual/valgrind_manual.ps.bz2 trunk/docs/manual/writing-tools.html trunk/downloads/current.html trunk/index.html trunk/php/.htconfx [... diff too large to include ...] - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind-www r340 - trunk/downloads
Author: sewardj Date: 2007-12-11 02:58:35 + (Tue, 11 Dec 2007) New Revision: 340 Log: Move 3.2.3 to the old-releases area. Modified: trunk/downloads/current.html trunk/downloads/old.html Modified: trunk/downloads/current.html === --- trunk/downloads/current.html2007-12-11 02:45:52 UTC (rev 339) +++ trunk/downloads/current.html2007-12-11 02:58:35 UTC (rev 340) @@ -39,29 +39,7 @@ AIX5.3, and many minor refinements. - - - - Valkyrie 1.2.0 Modified: trunk/downloads/old.html === --- trunk/downloads/old.html2007-12-11 02:45:52 UTC (rev 339) +++ trunk/downloads/old.html2007-12-11 02:58:35 UTC (rev 340) @@ -12,7 +12,25 @@ + +valgrind-3.2.3 + +valgrind 3.2.3 (tar.bz2) +[4016Kb] - 29 January 2007. +For {x86,amd64,ppc32,ppc64}-linux. +md5: 978847992b136c8d8cb5c6559a91df1c + + +3.2.3 is almost identical to 3.2.2, but fixes a regression that +unfortunately crept into 3.2.2. The regression causes an assertion +failure in Valgrind when running certain obscure SSE code fragments +on x86-linux and amd64-linux. Please do not use (or package) 3.2.2; +instead use 3.2.3. + + + + valgrind-3.2.2 valgrind 3.2.2 (tar.bz2) - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind-www r341 - trunk/docs
Author: sewardj Date: 2007-12-11 03:07:29 + (Tue, 11 Dec 2007) New Revision: 341 Log: Connect to 3.3.0 stuff. Modified: trunk/docs/index.html Modified: trunk/docs/index.html === --- trunk/docs/index.html 2007-12-11 02:58:35 UTC (rev 340) +++ trunk/docs/index.html 2007-12-11 03:07:29 UTC (rev 341) @@ -3,17 +3,25 @@ Valgrind Documentation -Release 3.1.0 November 25 2005 -Copyright � 2000-2005 +Release 3.3.0 7 December 2007 +Copyright � 2000-2007 AUTHORS -Permission is granted to copy, distribute and/or - modify this document under the terms of the GNU Free Documentation License, - Version 1.2 or any later version published by the Free Software Foundation; - with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover - Texts. A copy of the license is included in the section entitled - The GNU Free Documentation License. +Permission is granted to copy, distribute and/or modify +this document under the terms of the GNU Free Documentation +License, Version 1.2 or any later version published by the +Free Software Foundation; with no Invariant Sections, with no +Front-Cover Texts, and with no Back-Cover Texts. A copy of +the license is included in the section entitled +The GNU Free Documentation License. + +This is the top level of Valgrind's documentation tree. +The documentation is contained in six logically separate +documents, as listed in the following Table of Contents. To +get started quickly, read the Valgrind Quick Start Guide. For +full documentation on Valgrind, read the Valgrind User Manual. + - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind-www r342 - trunk/docs/manual
Author: sewardj Date: 2007-12-11 03:10:44 + (Tue, 11 Dec 2007) New Revision: 342 Log: Add new chapter. Added: trunk/docs/manual/manual-core-adv.html Added: trunk/docs/manual/manual-core-adv.html === --- trunk/docs/manual/manual-core-adv.html (rev 0) +++ trunk/docs/manual/manual-core-adv.html 2007-12-11 03:10:44 UTC (rev 342) @@ -0,0 +1,569 @@ + + + +3.�Using and understanding the Valgrind core: Advanced Topics + + + + + + + + + + + + +Valgrind User Manual + + + + +3.�Using and understanding the Valgrind core: Advanced Topics + +Table of Contents + +3.1. The Client Request mechanism +3.2. Function wrapping + +3.2.1. A Simple Example +3.2.2. Wrapping Specifications +3.2.3. Wrapping Semantics +3.2.4. Debugging +3.2.5. Limitations - control flow +3.2.6. Limitations - original function signatures +3.2.7. Examples + + + +This chapter describes advanced aspects of the Valgrind core +services, which are mostly of interest to power users who wish to +customise and modify Valgrind's default behaviours in certain useful +ways. The subjects covered are: + +The "Client Request" mechanism +Function Wrapping + + + +3.1.�The Client Request mechanism +Valgrind has a trapdoor mechanism via which the client +program can pass all manner of requests and queries to Valgrind +and the current tool. Internally, this is used extensively to +make malloc, free, etc, work, although you don't see that. +For your convenience, a subset of these so-called client +requests is provided to allow you to tell Valgrind facts about +the behaviour of your program, and also to make queries. +In particular, your program can tell Valgrind about changes in +memory range permissions that Valgrind would not otherwise know +about, and so allows clients to get Valgrind to do arbitrary +custom checks. +Clients need to include a header file to make this work. +Which header file depends on which client requests you use. Some +client requests are handled by the core, and are defined in the +header file valgrind/valgrind.h. Tool-specific +header files are named after the tool, e.g. +valgrind/memcheck.h. All header files can be found +in the include/valgrind directory of wherever Valgrind +was installed. +The macros in these header files have the magical property +that they generate code in-line which Valgrind can spot. +However, the code does nothing when not run on Valgrind, so you +are not forced to run your program under Valgrind just because you +use the macros in this file. Also, you are not required to link your +program with any extra supporting libraries. +The code added to your binary has negligible performance impact: +on x86, amd64, ppc32 and ppc64, the overhead is 6 simple integer instructions +and is probably undetectable except in tight loops. +However, if you really wish to compile out the client requests, you can +compile with -DNVALGRIND (analogous to +-DNDEBUG's effect on +assert()). + +You are encouraged to copy the valgrind/*.h headers +into your project's include directory, so your program doesn't have a +compile-time dependency on Valgrind being installed. The Valgrind headers, +unlike most of the rest of the code, are under a BSD-style license so you may +include them without worrying about license incompatibility. +Here is a brief description of the macros available in +valgrind.h, which work with more than one +tool (see the tool-specific documentation for explanations of the +tool-specific macros). + +RUNNING_ON_VALGRIND: +Returns 1 if running on Valgrind, 0 if running on the +real CPU. If you are running Valgrind on itself, returns the +number of layers of Valgrind emulation you're running on. + +VALGRIND_DISCARD_TRANSLATIONS: + +Discards translations of code in the specified address +range. Useful if you are debugging a JIT compiler or some other +dynamic code generation system. After this call, attempts to +execute code in the invalidated address range will cause +Valgrind to make new translations of that code, which is +probably the semantics you want. Note that code invalidations +are expensive because finding all the relevant translations +quickly is very difficult. So try not to call it often. +Note that you can be clever about +this: you only need to call it when an area which previously +contained code is overwritten with new code. You can choose +to write code into fresh memory, and just call this +occasionally to discard large chunks of old code all at +once. + +Alternatively, for transparent self-modifying-code support, +use--smc-check=all, or run +on ppc32/Linux or ppc64/Linux. + + +VALGRIND_COUNT_ERRORS: +Returns the number of errors found so far by Valgrind. Can be +useful in test harness code when combined with the +--log-fd=-1 option; this runs Valgrind silently, +but the client program can
[Valgrind-developers] valgrind: r7298 - in trunk: cachegrind/tests/x86 exp-drd exp-drd/docs exp-drd/tests exp-omega exp-omega/docs exp-omega/tests helgrind helgrind/docs helgrind/tests massif massif/p
Author: rjwalsh Date: 2007-12-12 03:16:52 + (Wed, 12 Dec 2007) New Revision: 7298 Log: Update ignores. Modified: trunk/cachegrind/tests/x86/ trunk/exp-drd/ trunk/exp-drd/docs/ trunk/exp-drd/tests/ trunk/exp-omega/ trunk/exp-omega/docs/ trunk/exp-omega/tests/ trunk/helgrind/ trunk/helgrind/docs/ trunk/helgrind/tests/ trunk/massif/ trunk/massif/perf/ trunk/massif/tests/ trunk/memcheck/tests/ trunk/none/tests/amd64/ Property changes on: trunk/cachegrind/tests/x86 ___ Name: svn:ignore - Makefile.in Makefile fpu-28-108 cachegrind.out cachegrind.out.* *.stdout.diff *.stderr.diff *.stdout.out *.stderr.out + cachegrind.out cachegrind.out.* .deps fpu-28-108 Makefile Makefile.in *.stderr.diff *.stderr.out *.stdout.diff *.stdout.out Property changes on: trunk/exp-drd ___ Name: svn:ignore + .deps exp-drd-amd64-linux Makefile Makefile.in vgpreload_exp-drd-amd64-linux.so Property changes on: trunk/exp-drd/docs ___ Name: svn:ignore + .deps Makefile Makefile.in Property changes on: trunk/exp-drd/tests ___ Name: svn:ignore + .deps fp_race Makefile Makefile.in pth_broadcast pth_cond_race pth_create_chain pth_detached sigalrm Property changes on: trunk/exp-omega ___ Name: svn:ignore + .deps exp-omega-amd64-linux Makefile Makefile.in vgpreload_exp-omega-amd64-linux.so Property changes on: trunk/exp-omega/docs ___ Name: svn:ignore + .deps Makefile Makefile.in Property changes on: trunk/exp-omega/tests ___ Name: svn:ignore + block1 block2 block3 .deps Makefile Makefile.in overwrite1 overwrite2 overwrite3 overwrite4 overwrite5 scope1 scope2 scope3 scope4 scope5 scope6 shadow1 static1 Property changes on: trunk/helgrind ___ Name: svn:ignore + .deps helgrind-amd64-linux Makefile Makefile.in vgpreload_helgrind-amd64-linux.so Property changes on: trunk/helgrind/docs ___ Name: svn:ignore + Makefile Makefile.in Property changes on: trunk/helgrind/tests ___ Name: svn:ignore + .deps hg01_all_ok hg02_deadlock hg03_inherit hg04_race hg05_race2 hg06_readshared Makefile Makefile.in tc01_simple_race tc02_simple_tls tc03_re_excl tc04_free_lock tc05_simple_race tc06_two_races tc07_hbl1 tc08_hbl2 tc09_bad_unlock tc10_rec_lock tc11_XCHG tc12_rwl_trivial tc13_laog1 tc14_laog_dinphils tc15_laog_lockdel tc16_byterace tc17_sembar tc18_semabuse tc19_shadowmem tc20_verifywrap tc20_verifywrap.stderr.diff tc20_verifywrap.stderr.out tc21_pthonce tc22_exit_w_lock tc22_exit_w_lock.stderr.diff tc22_exit_w_lock.stderr.out tc23_bogus_condwait tc24_nonzero_sem Property changes on: trunk/massif ___ Name: svn:ignore - .deps Makefile Makefile.in massif-amd64-linux massif-ppc32-linux massif-ppc64-linux massif-x86-linux *.so + .deps Makefile Makefile.in massif-amd64-linux massif-ppc32-linux massif-ppc64-linux massif-x86-linux ms_print *.so Property changes on: trunk/massif/perf ___ Name: svn:ignore + .deps Makefile Makefile.in many-xpts Property changes on: trunk/massif/tests ___ Name: svn:ignore - basic_malloc .deps Makefile.in Makefile massif.*.hp massif.*.aux massif.*.ps massif.*.txt massif.*.html *.stdout.diff *.stderr.diff *.stdout.out *.stderr.out + alloc-fns basic basic_malloc big-alloc culling1 culling2 custom_alloc deep .deps ignoring insig long-time Makefile Makefile.in massif.*.aux massif.*.hp massif.*.html massif.*.ps massif.*.txt new-cpp null one overloaded-new peak realloc *.stderr.diff *.stderr.out *.stdout.diff *.stdout.out thresholds zero Property changes on: trunk/memcheck/tests ___ Name: svn:ignore - addressable badaddrvalue badfree badjump badjump2 badloop badpoll badrw brk brk2 buflen_check clientperm clientstackperm custom_alloc deep_templates .deps describe-block dir doublefree erringfds error_counts errs1 execve execve2 exitprog filter_leak_check_size filter_stderr fprw fwrite hello inits inline leak-0 leak-cycle leakotron leak-pool leak-regroot leak-tree long_namespace_xml Makefile Makefile.in malloc1 malloc2 malloc3 malloc_usable manuel1 manuel2 manuel3 match-overrun memalign2 memalign_test memcmptest mempool metadata
[Valgrind-developers] valgrind: r7299 - trunk/helgrind
Author: sewardj Date: 2007-12-12 11:42:33 + (Wed, 12 Dec 2007) New Revision: 7299 Log: Fix stupid error spotted by by Konstantin Serebryany. Modified: trunk/helgrind/hg_main.c Modified: trunk/helgrind/hg_main.c === --- trunk/helgrind/hg_main.c2007-12-12 03:16:52 UTC (rev 7298) +++ trunk/helgrind/hg_main.c2007-12-12 11:42:33 UTC (rev 7299) @@ -582,7 +582,7 @@ static Thread* mk_Thread ( SegmentID csegid ) { static Int indx = 1; - Thread* thread = hg_zalloc( sizeof(Lock) ); + Thread* thread = hg_zalloc( sizeof(Thread) ); thread->locksetA = HG_(emptyWS)( univ_lsets ); thread->locksetW = HG_(emptyWS)( univ_lsets ); thread->csegid = csegid; - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7300 - in trunk/coregrind: . m_initimg
Author: sewardj Date: 2007-12-15 22:13:05 + (Sat, 15 Dec 2007) New Revision: 7300 Log: When allocating space for the client stack on Linux, take notice of the --max-stackframe value. This makes it possible to run programs with very large (primary) stack requirements simply by specifying --max-stackframe. Modified: trunk/coregrind/m_initimg/initimg-linux.c trunk/coregrind/m_main.c trunk/coregrind/m_stacktrace.c Modified: trunk/coregrind/m_initimg/initimg-linux.c === --- trunk/coregrind/m_initimg/initimg-linux.c 2007-12-12 11:42:33 UTC (rev 7299) +++ trunk/coregrind/m_initimg/initimg-linux.c 2007-12-15 22:13:05 UTC (rev 7300) @@ -859,13 +859,25 @@ // p: fix_environment() [for 'env'] //-- { + /* When allocating space for the client stack on Linux, take + notice of the --max-stackframe value. This makes it possible + to run programs with very large (primary) stack requirements + simply by specifying --max-stackframe. */ void* init_sp = iicii.argv - 1; SizeT m1 = 1024 * 1024; SizeT m16 = 16 * m1; + SizeT msf = VG_(clo_max_stackframe) + m1; VG_(debugLog)(1, "initimg", "Setup client stack\n"); + /* For the max stack size, use the client's stack rlimit, but + clamp it to between 1M and 16M. */ iifii.clstack_max_size = (SizeT)VG_(client_rlimit_stack).rlim_cur; if (iifii.clstack_max_size < m1) iifii.clstack_max_size = m1; if (iifii.clstack_max_size > m16) iifii.clstack_max_size = m16; + /* However, if --max-stackframe= is specified, and the given + value (+ 1 M for spare) exceeds the current setting, use the + max-stackframe input instead. */ + + if (iifii.clstack_max_size < msf) iifii.clstack_max_size = msf; iifii.clstack_max_size = VG_PGROUNDUP(iifii.clstack_max_size); iifii.initial_client_SP @@ -877,11 +889,15 @@ VG_(debugLog)(2, "initimg", "Client info: " - "initial_IP=%p initial_SP=%p initial_TOC=%p brk_base=%p\n", + "initial_IP=%p initial_TOC=%p brk_base=%p\n", (void*)(iifii.initial_client_IP), - (void*)(iifii.initial_client_SP), (void*)(iifii.initial_client_TOC), (void*)VG_(brk_base) ); + VG_(debugLog)(2, "initimg", + "Client info: " + "initial_SP=%p max_stack_size=%ld\n", + (void*)(iifii.initial_client_SP), + (SizeT)iifii.clstack_max_size ); } //-- Modified: trunk/coregrind/m_main.c === --- trunk/coregrind/m_main.c2007-12-12 11:42:33 UTC (rev 7299) +++ trunk/coregrind/m_main.c2007-12-15 22:13:05 UTC (rev 7300) @@ -244,7 +244,8 @@ /* Peer at previously set up VG_(args_for_valgrind) and extract any - request for help and also the tool name. */ + request for help and also the tool name, and also set up + VG_(clo_max_stackframe). */ static void get_helprequest_and_toolname ( Int* need_help, HChar** tool ) { @@ -276,7 +277,13 @@ // here. } else if (VG_CLO_STREQN(7, str, "--tool=")) { *tool = &str[7]; - } + + // Set up VG_(clo_max_stackframe). This is needed by + // VG_(ii_create_image), which happens before + // process_command_line_options(). + } else VG_NUM_CLO (str, "--max-stackframe", + VG_(clo_max_stackframe)); + } } @@ -368,6 +375,9 @@ else VG_BOOL_CLO(arg, "--error-limit", VG_(clo_error_limit)) else VG_NUM_CLO (arg, "--error-exitcode", VG_(clo_error_exitcode)) else VG_BOOL_CLO(arg, "--show-emwarns", VG_(clo_show_emwarns)) + /* Already done in get_helprequest_and_toolname, but we need to + redundantly handle it again, so the flag does not get + rejected as invalid. */ else VG_NUM_CLO (arg, "--max-stackframe", VG_(clo_max_stackframe)) else VG_BOOL_CLO(arg, "--run-libc-freeres", VG_(clo_run_libc_freeres)) else VG_BOOL_CLO(arg, "--show-below-main", VG_(clo_show_below_main)) Modified: trunk/coregrind/m_stacktrace.c === --- trunk/coregrind/m_stacktrace.c 2007-12-12 11:42:33 UTC (rev 7299) +++ trunk/coregrind/m_stacktrace.c 2007-12-15 22:13:05 UTC (rev 7300) @@ -97,11 +97,9 @@ /* Assertion broken before main() is reached in pthreaded programs; the * offending stack traces only have one item. --njn, 2002-aug-16 */ /* vg_assert(fp_min <= fp_max);*/ - - if (fp_min + VG_(clo_max_stackframe) <= fp_max) { - /* If the stack is ridiculously big, don't p
[Valgrind-developers] valgrind: r7301 - trunk/coregrind/m_initimg
Author: sewardj Date: 2007-12-15 23:08:35 + (Sat, 15 Dec 2007) New Revision: 7301 Log: Print a nice message if allocation of the stack fails, rather than just asserting. Modified: trunk/coregrind/m_initimg/initimg-linux.c Modified: trunk/coregrind/m_initimg/initimg-linux.c === --- trunk/coregrind/m_initimg/initimg-linux.c 2007-12-15 22:13:05 UTC (rev 7300) +++ trunk/coregrind/m_initimg/initimg-linux.c 2007-12-15 23:08:35 UTC (rev 7301) @@ -44,6 +44,7 @@ #include "pub_core_machine.h" #include "pub_core_ume.h" #include "pub_core_options.h" +#include "pub_core_syscall.h" #include "pub_core_tooliface.h" /* VG_TRACK */ #include "pub_core_threadstate.h" /* ThreadArchState */ #include "pub_core_initimg.h" /* self */ @@ -572,19 +573,32 @@ /* Create a shrinkable reservation followed by an anonymous segment. Together these constitute a growdown stack. */ + res = VG_(mk_SysRes_Error)(0); ok = VG_(am_create_reservation)( resvn_start, resvn_size -inner_HACK, SmUpper, anon_size +inner_HACK ); + if (ok) { +/* allocate a stack - mmap enough space for the stack */ +res = VG_(am_mmap_anon_fixed_client)( + anon_start -inner_HACK, + anon_size +inner_HACK, +VKI_PROT_READ|VKI_PROT_WRITE|VKI_PROT_EXEC + ); + } + if ((!ok) || res.isError) { +/* Allocation of the stack failed. We have to stop. */ +VG_(printf)("valgrind: " +"I failed to allocate space for the application's stack.\n"); +VG_(printf)("valgrind: " +"This may be the result of a very large --max-stackframe=\n"); +VG_(printf)("valgrind: setting. Cannot continue. Sorry.\n\n"); +VG_(exit)(0); + } + vg_assert(ok); - /* allocate a stack - mmap enough space for the stack */ - res = VG_(am_mmap_anon_fixed_client)( - anon_start -inner_HACK, - anon_size +inner_HACK, - VKI_PROT_READ|VKI_PROT_WRITE|VKI_PROT_EXEC - ); vg_assert(!res.isError); } - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7302 - in trunk: coregrind coregrind/m_initimg coregrind/m_scheduler docs/xml memcheck/tests none/tests
Author: sewardj Date: 2007-12-18 01:49:23 + (Tue, 18 Dec 2007) New Revision: 7302 Log: Improve handling of programs which require very large main thread stacks. Instead of hardwiring the main thread stack to a max of 16MB and segfaulting the app beyond that point, allow the user to specify the main stack size using the new flag --main-stacksize=. If said flag is not present, the current default, which is "MIN(16GB, current ulimit -s value)", is used. Modified: trunk/coregrind/m_initimg/initimg-linux.c trunk/coregrind/m_main.c trunk/coregrind/m_options.c trunk/coregrind/m_scheduler/scheduler.c trunk/coregrind/m_signals.c trunk/coregrind/pub_core_options.h trunk/docs/xml/manual-core.xml trunk/memcheck/tests/addressable.stderr.exp trunk/memcheck/tests/badjump.stderr.exp trunk/memcheck/tests/describe-block.stderr.exp trunk/memcheck/tests/match-overrun.stderr.exp trunk/memcheck/tests/supp_unknown.stderr.exp trunk/none/tests/blockfault.stderr.exp trunk/none/tests/cmdline1.stdout.exp trunk/none/tests/cmdline2.stdout.exp Modified: trunk/coregrind/m_initimg/initimg-linux.c === --- trunk/coregrind/m_initimg/initimg-linux.c 2007-12-15 23:08:35 UTC (rev 7301) +++ trunk/coregrind/m_initimg/initimg-linux.c 2007-12-18 01:49:23 UTC (rev 7302) @@ -593,7 +593,7 @@ VG_(printf)("valgrind: " "I failed to allocate space for the application's stack.\n"); VG_(printf)("valgrind: " -"This may be the result of a very large --max-stackframe=\n"); +"This may be the result of a very large --main-stacksize=\n"); VG_(printf)("valgrind: setting. Cannot continue. Sorry.\n\n"); VG_(exit)(0); } @@ -874,25 +874,28 @@ //-- { /* When allocating space for the client stack on Linux, take - notice of the --max-stackframe value. This makes it possible + notice of the --main-stacksize value. This makes it possible to run programs with very large (primary) stack requirements - simply by specifying --max-stackframe. */ + simply by specifying --main-stacksize. */ + /* Logic is as follows: + - by default, use the client's current stack rlimit + - if that exceeds 16M, clamp to 16M + - if a larger --main-stacksize value is specified, use that instead + - in all situations, the minimum allowed stack size is 1M + */ void* init_sp = iicii.argv - 1; SizeT m1 = 1024 * 1024; SizeT m16 = 16 * m1; - SizeT msf = VG_(clo_max_stackframe) + m1; - VG_(debugLog)(1, "initimg", "Setup client stack\n"); - /* For the max stack size, use the client's stack rlimit, but - clamp it to between 1M and 16M. */ - iifii.clstack_max_size = (SizeT)VG_(client_rlimit_stack).rlim_cur; - if (iifii.clstack_max_size < m1) iifii.clstack_max_size = m1; - if (iifii.clstack_max_size > m16) iifii.clstack_max_size = m16; - /* However, if --max-stackframe= is specified, and the given - value (+ 1 M for spare) exceeds the current setting, use the - max-stackframe input instead. */ + SizeT szB = (SizeT)VG_(client_rlimit_stack).rlim_cur; + if (szB < m1) szB = m1; + if (szB > m16) szB = m16; + if (VG_(clo_main_stacksize) > 0) szB = VG_(clo_main_stacksize); + if (szB < m1) szB = m1; + szB = VG_PGROUNDUP(szB); + VG_(debugLog)(1, "initimg", + "Setup client stack: size will be %ld\n", szB); - if (iifii.clstack_max_size < msf) iifii.clstack_max_size = msf; - iifii.clstack_max_size = VG_PGROUNDUP(iifii.clstack_max_size); + iifii.clstack_max_size = szB; iifii.initial_client_SP = setup_client_stack( init_sp, env, Modified: trunk/coregrind/m_main.c === --- trunk/coregrind/m_main.c2007-12-15 23:08:35 UTC (rev 7301) +++ trunk/coregrind/m_main.c2007-12-18 01:49:23 UTC (rev 7302) @@ -149,6 +149,8 @@ "--input-fd= file descriptor for input [0=stdin]\n" "--max-stackframe= assume stack switch for SP changes larger\n" " than bytes [200]\n" +"--main-stacksize= set size of main thread's stack (in bytes)\n" +" [use current 'ulimit' value]\n" "\n"; Char* usage2 = @@ -243,11 +245,22 @@ } -/* Peer at previously set up VG_(args_for_valgrind) and extract any - request for help and also the tool name, and also set up - VG_(clo_max_stackframe). */ +/* Peer at previously set up VG_(args_for_valgrind) and do some + minimal command line processing that must happen early on: -static void get_helprequest_and_toolname ( Int* need_help, HChar** tool ) + - show the version string, if requested (-v) +
[Valgrind-developers] valgrind: r7303 - trunk/memcheck/tests
Author: sewardj Date: 2007-12-19 11:01:13 + (Wed, 19 Dec 2007) New Revision: 7303 Log: Add a couple of regtests for large stack frame management. Added: trunk/memcheck/tests/lsframe1.c trunk/memcheck/tests/lsframe1.stderr.exp trunk/memcheck/tests/lsframe1.stdout.exp trunk/memcheck/tests/lsframe1.vgtest trunk/memcheck/tests/lsframe2.c trunk/memcheck/tests/lsframe2.stderr.exp trunk/memcheck/tests/lsframe2.stdout.exp trunk/memcheck/tests/lsframe2.vgtest Modified: trunk/memcheck/tests/Makefile.am Modified: trunk/memcheck/tests/Makefile.am === --- trunk/memcheck/tests/Makefile.am2007-12-18 01:49:23 UTC (rev 7302) +++ trunk/memcheck/tests/Makefile.am2007-12-19 11:01:13 UTC (rev 7303) @@ -66,6 +66,8 @@ leakotron.vgtest leakotron.stdout.exp leakotron.stderr.exp \ long_namespace_xml.vgtest long_namespace_xml.stdout.exp \ long_namespace_xml.stderr.exp \ + lsframe1.vgtest lsframe1.stdout.exp lsframe1.stderr.exp \ + lsframe2.vgtest lsframe2.stdout.exp lsframe2.stderr.exp \ malloc_free_fill.vgtest malloc_free_fill.stdout.exp \ malloc_free_fill.stderr.exp-glibc25-amd64 \ malloc_free_fill.stderr.exp-glibc25-x86 \ @@ -160,6 +162,7 @@ fprw fwrite hello inits inline \ leak-0 leak-cycle leak-pool leak-tree leak-regroot leakotron \ long_namespace_xml \ + lsframe1 lsframe2 \ malloc_free_fill \ malloc_usable malloc1 malloc2 malloc3 manuel1 manuel2 manuel3 \ match-overrun \ Added: trunk/memcheck/tests/lsframe1.c === --- trunk/memcheck/tests/lsframe1.c (rev 0) +++ trunk/memcheck/tests/lsframe1.c 2007-12-19 11:01:13 UTC (rev 7303) @@ -0,0 +1,26 @@ + +/* Demonstrate Memcheck correctly handling a 64M array on the stack. + Requires --max-stackframe=67108884 or above. And since it + generates a very large stack, --main-stacksize=6720 + (approximately) is also required. */ + +#include + +#define N_MBYTES 64 + +#define N_INTS ((N_MBYTES * 1048576) / sizeof(int)) + + +int main ( void ) +{ + int i, sum; + int arr[N_INTS]; + fprintf(stderr, "lsframe1: start\n"); + for (i = 0; i < N_INTS; i++) + arr[i] = i; + sum = 0; + for (i = 0; i < N_INTS; i++) + sum += arr[i]; + fprintf(stderr, "lsframe1: done, result is %d\n", sum); + return 0; +} Added: trunk/memcheck/tests/lsframe1.stderr.exp === --- trunk/memcheck/tests/lsframe1.stderr.exp(rev 0) +++ trunk/memcheck/tests/lsframe1.stderr.exp2007-12-19 11:01:13 UTC (rev 7303) @@ -0,0 +1,9 @@ + +lsframe1: start +lsframe1: done, result is -8388608 + +ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) +malloc/free: in use at exit: 0 bytes in 0 blocks. +malloc/free: 0 allocs, 0 frees, 0 bytes allocated. +For a detailed leak analysis, rerun with: --leak-check=yes +For counts of detected errors, rerun with: -v Added: trunk/memcheck/tests/lsframe1.stdout.exp === Added: trunk/memcheck/tests/lsframe1.vgtest === --- trunk/memcheck/tests/lsframe1.vgtest(rev 0) +++ trunk/memcheck/tests/lsframe1.vgtest2007-12-19 11:01:13 UTC (rev 7303) @@ -0,0 +1,2 @@ +prog: lsframe1 +vgopts: --main-stacksize=6720 --max-stackframe=6720 Added: trunk/memcheck/tests/lsframe2.c === --- trunk/memcheck/tests/lsframe2.c (rev 0) +++ trunk/memcheck/tests/lsframe2.c 2007-12-19 11:01:13 UTC (rev 7303) @@ -0,0 +1,34 @@ + +/* Demonstrate Memcheck correctly handling chain of 64 recursive + calls, each of which allocates a 1 M array on the stack. Requires + --main-stacksize=67117057 (on amd64-linux) or above, but works fine + if you specify that. */ + +#include + +#define N_MBYTES 64 + +#define N_INTS_PER_MBYTE (1048576 / sizeof(int)) + +int rec ( int depth ) +{ + int i, zzz; + int arr[N_INTS_PER_MBYTE]; + if (depth == 0) return 0; + for (i = 0; i < N_INTS_PER_MBYTE; i++) + arr[i] = i * depth; + zzz = rec(depth-1); + for (i = 0; i < N_INTS_PER_MBYTE; i++) + zzz += arr[i]; + return zzz; +} + + +int main ( void ) +{ + int sum; + fprintf(stderr, "lsframe2: start\n"); + sum = rec(N_MBYTES); + fprintf(stderr, "lsframe2: done, result is %d\n", sum); + return 0; +} Added: trunk/memcheck/tests/lsframe2.stderr.exp === --- trunk/memcheck/tests/lsframe2.stderr.exp(rev 0) +++ trunk/memcheck/tests/lsframe2.stderr.exp2007-12-19 11:01:13 UTC (rev 7303) @@ -0,0 +1,9 @@ + +lsframe2: start +lsfr
[Valgrind-developers] valgrind: r7304 - in trunk: coregrind include
Author: sewardj Date: 2007-12-21 01:24:59 + (Fri, 21 Dec 2007) New Revision: 7304 Log: Add a new method VG_(record_depth_1_ExeContext), a trivial derivative of VG_(record_ExeContext), which just records the first stack frame but does not attempt to unwind the (guest) stack. This is useful in situations where we suspect unwinding the stack might cause a segfault. Use this in m_signals, when getting a backtrace following a guest segfault. Modified: trunk/coregrind/m_execontext.c trunk/coregrind/m_signals.c trunk/include/pub_tool_execontext.h Modified: trunk/coregrind/m_execontext.c === --- trunk/coregrind/m_execontext.c 2007-12-19 11:01:13 UTC (rev 7303) +++ trunk/coregrind/m_execontext.c 2007-12-21 01:24:59 UTC (rev 7304) @@ -30,12 +30,15 @@ #include "pub_core_basics.h" #include "pub_core_debuglog.h" -#include "pub_core_execontext.h"// self #include "pub_core_libcassert.h" #include "pub_core_libcprint.h" // For VG_(message)() #include "pub_core_mallocfree.h" #include "pub_core_options.h" #include "pub_core_stacktrace.h" +#include "pub_core_machine.h" // VG_(get_IP) +#include "pub_core_vki.h" // To keep pub_core_threadstate.h happy +#include "pub_core_threadstate.h" // VG_(is_valid_tid) +#include "pub_core_execontext.h"// self /**/ /*--- Low-level ExeContext storage.---*/ @@ -277,7 +280,8 @@ ec_htab_size_idx++; } -ExeContext* VG_(record_ExeContext) ( ThreadId tid, Word first_ip_delta ) +static ExeContext* record_ExeContext_wrk ( ThreadId tid, Word first_ip_delta, + Bool first_ip_only ) { Int i; Addrips[VG_DEEPEST_BACKTRACE]; @@ -297,8 +301,15 @@ vg_assert(VG_(clo_backtrace_size) >= 1 && VG_(clo_backtrace_size) <= VG_DEEPEST_BACKTRACE); - n_ips = VG_(get_StackTrace)( tid, ips, VG_(clo_backtrace_size), -first_ip_delta ); + if (first_ip_only) { + vg_assert(VG_(is_valid_tid)(tid)); + n_ips = 1; + ips[0] = VG_(get_IP)(tid); + } else { + n_ips = VG_(get_StackTrace)( tid, ips, VG_(clo_backtrace_size), + first_ip_delta ); + } + tl_assert(n_ips >= 1 && n_ips <= VG_(clo_backtrace_size)); /* Now figure out if we've seen this one before. First hash it so @@ -378,6 +389,17 @@ return new_ec; } +ExeContext* VG_(record_ExeContext)( ThreadId tid, Word first_ip_delta ) { + return record_ExeContext_wrk( tid, first_ip_delta, + False/*!first_ip_only*/ ); +} + +ExeContext* VG_(record_depth_1_ExeContext)( ThreadId tid ) { + return record_ExeContext_wrk( tid, 0/*first_ip_delta*/, + True/*first_ip_only*/ ); +} + + StackTrace VG_(extract_StackTrace) ( ExeContext* e ) { return e->ips; Modified: trunk/coregrind/m_signals.c === --- trunk/coregrind/m_signals.c 2007-12-19 11:01:13 UTC (rev 7303) +++ trunk/coregrind/m_signals.c 2007-12-21 01:24:59 UTC (rev 7304) @@ -1275,7 +1275,7 @@ case VKI_BUS_OBJERR: event = "Hardware error"; break; } break; -} +} /* switch (sigNo) */ if (event != NULL) { if (haveaddr) @@ -1285,11 +1285,17 @@ VG_(message)(Vg_UserMsg, " %s", event); } } - - if (tid != VG_INVALID_THREADID) { - VG_(get_and_pp_StackTrace)(tid, VG_(clo_backtrace_size)); + /* Print a stack trace. Be cautious if the thread's SP is in an + obviously stupid place (not mapped readable) that would + likely cause a segfault. */ + if (VG_(is_valid_tid)(tid)) { + ExeContext* ec = VG_(am_is_valid_for_client) + (VG_(get_SP)(tid), sizeof(Addr), VKI_PROT_READ) +? VG_(record_ExeContext)( tid, 0/*first_ip_delta*/ ) + : VG_(record_depth_1_ExeContext)( tid ); + vg_assert(ec); + VG_(pp_ExeContext)( ec ); } - if (sigNo == VKI_SIGSEGV && info && info->si_code > VKI_SI_USER && info->si_code == VKI_SEGV_MAPERR) { Modified: trunk/include/pub_tool_execontext.h === --- trunk/include/pub_tool_execontext.h 2007-12-19 11:01:13 UTC (rev 7303) +++ trunk/include/pub_tool_execontext.h 2007-12-21 01:24:59 UTC (rev 7304) @@ -57,6 +57,15 @@ extern ExeContext* VG_(record_ExeContext) ( ThreadId tid, Word first_ip_delta ); +// Trivial version of VG_(record_ExeContext), which just records the +// thread's current program counter but does not do any stack +// unwinding. This is useful in some rare cases when we suspect the +// stack migh
[Valgrind-developers] valgrind: r7305 - in trunk/coregrind: . m_sigframe
Author: tom Date: 2007-12-21 10:24:24 + (Fri, 21 Dec 2007) New Revision: 7305 Log: Propagate the ucontext information with a received signal to the signal frame constructors and use it (on x86 and amd64) to fill in the trap number in the signal context information. Needed for wine which likes to look at the trap number... Modified: trunk/coregrind/m_sigframe/sigframe-amd64-linux.c trunk/coregrind/m_sigframe/sigframe-ppc32-aix5.c trunk/coregrind/m_sigframe/sigframe-ppc32-linux.c trunk/coregrind/m_sigframe/sigframe-ppc64-aix5.c trunk/coregrind/m_sigframe/sigframe-ppc64-linux.c trunk/coregrind/m_sigframe/sigframe-x86-linux.c trunk/coregrind/m_signals.c trunk/coregrind/pub_core_sigframe.h Modified: trunk/coregrind/m_sigframe/sigframe-amd64-linux.c === --- trunk/coregrind/m_sigframe/sigframe-amd64-linux.c 2007-12-21 01:24:59 UTC (rev 7304) +++ trunk/coregrind/m_sigframe/sigframe-amd64-linux.c 2007-12-21 10:24:24 UTC (rev 7305) @@ -320,7 +320,7 @@ bits of sigcontext at the moment. */ static -void synth_ucontext(ThreadId tid, const vki_siginfo_t *si, +void synth_ucontext(ThreadId tid, const vki_siginfo_t *si, Int trapno, const vki_sigset_t *set, struct vki_ucontext *uc, struct _vki_fpstate *fpstate) { @@ -361,7 +361,7 @@ // FIXME: SC2(gs,GS); // FIXME: SC2(fs,FS); /* XXX err */ - /* XXX trapno */ + sc->trapno = trapno; # undef SC2 sc->cr2 = (UWord)si->_sifields._sigfault._addr; @@ -435,6 +435,7 @@ static Addr build_rt_sigframe(ThreadState *tst, Addr rsp_top_of_frame, const vki_siginfo_t *siginfo, + const struct vki_ucontext *siguc, void *handler, UInt flags, const vki_sigset_t *mask, void *restorer) @@ -442,6 +443,7 @@ struct rt_sigframe *frame; Addr rsp = rsp_top_of_frame; Int sigNo = siginfo->si_signo; + Int trapno; rsp -= sizeof(*frame); rsp = VG_ROUNDDN(rsp, 16); @@ -459,6 +461,11 @@ else frame->retaddr = (Addr)&VG_(amd64_linux_SUBST_FOR_rt_sigreturn); + if (siguc) + trapno = siguc->uc_mcontext.trapno; + else + trapno = 0; + VG_(memcpy)(&frame->sigInfo, siginfo, sizeof(vki_siginfo_t)); /* SIGILL defines addr to be the faulting address */ @@ -466,7 +473,7 @@ frame->sigInfo._sifields._sigfault._addr = (void*)tst->arch.vex.guest_RIP; - synth_ucontext(tst->tid, siginfo, mask, &frame->uContext, &frame->fpstate); + synth_ucontext(tst->tid, siginfo, trapno, mask, &frame->uContext, &frame->fpstate); VG_TRACK( post_mem_write, Vg_CoreSignal, tst->tid, rsp, offsetof(struct rt_sigframe, vg) ); @@ -480,6 +487,7 @@ void VG_(sigframe_create)( ThreadId tid, Addr rsp_top_of_frame, const vki_siginfo_t *siginfo, +const struct vki_ucontext *siguc, void *handler, UInt flags, const vki_sigset_t *mask, @@ -489,7 +497,7 @@ struct rt_sigframe *frame; ThreadState* tst = VG_(get_ThreadState)(tid); - rsp = build_rt_sigframe(tst, rsp_top_of_frame, siginfo, + rsp = build_rt_sigframe(tst, rsp_top_of_frame, siginfo, siguc, handler, flags, mask, restorer); frame = (struct rt_sigframe *)rsp; Modified: trunk/coregrind/m_sigframe/sigframe-ppc32-aix5.c === --- trunk/coregrind/m_sigframe/sigframe-ppc32-aix5.c2007-12-21 01:24:59 UTC (rev 7304) +++ trunk/coregrind/m_sigframe/sigframe-ppc32-aix5.c2007-12-21 10:24:24 UTC (rev 7305) @@ -103,6 +103,7 @@ void VG_(sigframe_create) ( ThreadId tid, Addr sp_top_of_frame, const vki_siginfo_t *siginfo, +const struct vki_ucontext *siguc, void *handler, UInt flags, const vki_sigset_t *mask, Modified: trunk/coregrind/m_sigframe/sigframe-ppc32-linux.c === --- trunk/coregrind/m_sigframe/sigframe-ppc32-linux.c 2007-12-21 01:24:59 UTC (rev 7304) +++ trunk/coregrind/m_sigframe/sigframe-ppc32-linux.c 2007-12-21 10:24:24 UTC (rev 7305) @@ -665,6 +665,7 @@ void VG_(sigframe_create)( ThreadId tid, Addr sp_top_of_frame, const vki_siginfo_t *siginfo, + const struct vki_ucontext *siguc, void *handler, UInt flags, const vki_sigset_t *mask, Modified: trunk/coreg
[Valgrind-developers] valgrind: r7306 - in trunk: auxprogs coregrind coregrind/m_aspacemgr include/vki
Author: sewardj Date: 2007-12-22 14:12:42 + (Sat, 22 Dec 2007) New Revision: 7306 Log: AIX5 counterpart to r7302: Improve handling of programs which require very large main thread stacks. Modified: trunk/auxprogs/aix5_VKI_info.c trunk/coregrind/m_aspacemgr/aspacemgr-aix5.c trunk/coregrind/m_main.c trunk/include/vki/vki-ppc32-aix5.h trunk/include/vki/vki-ppc64-aix5.h Modified: trunk/auxprogs/aix5_VKI_info.c === --- trunk/auxprogs/aix5_VKI_info.c 2007-12-21 10:24:24 UTC (rev 7305) +++ trunk/auxprogs/aix5_VKI_info.c 2007-12-22 14:12:42 UTC (rev 7306) @@ -268,6 +268,7 @@ printf("#define VKI_SEGV_MAPERR %d\n", SEGV_MAPERR); printf("\n"); printf("#define VKI_TRAP_TRACE %d\n", TRAP_TRACE); + printf("#define VKI_TRAP_BRKPT %d\n", TRAP_BRKPT); printf("#define VKI_BUS_OBJERR %d\n", BUS_OBJERR); printf("#define VKI_BUS_ADRERR %d\n", BUS_ADRERR); printf("#define VKI_BUS_ADRALN %d\n", BUS_ADRALN); Modified: trunk/coregrind/m_aspacemgr/aspacemgr-aix5.c === --- trunk/coregrind/m_aspacemgr/aspacemgr-aix5.c2007-12-21 10:24:24 UTC (rev 7305) +++ trunk/coregrind/m_aspacemgr/aspacemgr-aix5.c2007-12-22 14:12:42 UTC (rev 7306) @@ -201,8 +201,10 @@ /* The assumed size of the main thread's stack, so that we can add a segment for it at startup. */ -#define N_FAKE_STACK_PAGES 4096 /* 16M fake stack */ +#define N_FAKE_STACK_PAGES_MIN 4096 /* 16M fake stack */ /* default size */ +#define N_FAKE_STACK_PAGES_MAX 32768 /* 128M fake stack */ /* max size? */ + /* Hacks which are probably for AIX 'millicode'. Note: ensure these stay page aligned. */ @@ -1162,6 +1164,8 @@ { static Bool done = False; AixSegment seg; + Word n_fake_stack_pages; + Word m1 = 1048576; aspacem_assert(!done); done = True; @@ -1180,7 +1184,6 @@ 0xFFF'''E920, and the accessible area extends to 0xFFF'''. So in both cases, (64k roundup of sp) - 1 gives the end of the accessible area. */ - VG_(debugLog)(1,"aspacem", "aix5_set_initial_client_sp( %p )\n", (void*)sp); @@ -1197,8 +1200,30 @@ seg.end = AM_64K_ROUNDUP(sp) - 1; } - seg.start = seg.end+1 - N_FAKE_STACK_PAGES * VKI_PAGE_SIZE; + n_fake_stack_pages = N_FAKE_STACK_PAGES_MIN; + if (VG_(clo_main_stacksize) > 0 + && ((m1+VG_(clo_main_stacksize)) / VKI_PAGE_SIZE) > n_fake_stack_pages) { + n_fake_stack_pages = (m1+VG_(clo_main_stacksize)) / VKI_PAGE_SIZE; + } + if (n_fake_stack_pages > N_FAKE_STACK_PAGES_MAX) { + /* Allocation of the stack failed. We have to stop. */ + VG_(debugLog)( + 0, "aspacem", +"valgrind: " +"I failed to allocate space for the application's stack.\n"); + VG_(debugLog)( + 0, "aspacem", +"valgrind: " +"This may be the result of a very large --max-stackframe=\n"); + VG_(debugLog)( + 0, "aspacem", +"valgrind: " +"setting. Cannot continue. Sorry.\n\n"); + ML_(am_exit)(0); + } + seg.start = seg.end+1 - n_fake_stack_pages * VKI_PAGE_SIZE; + VG_(debugLog)(1,"aspacem", "aix5_set_initial_client_sp: stack seg:\n"); show_AixSegment(1,0, &seg); add_asegment( &asegs_pri, &seg ); Modified: trunk/coregrind/m_main.c === --- trunk/coregrind/m_main.c2007-12-21 10:24:24 UTC (rev 7305) +++ trunk/coregrind/m_main.c2007-12-22 14:12:42 UTC (rev 7306) @@ -1470,12 +1470,14 @@ # error "Uknown platform" # endif + /* NOTE: this call reads VG_(clo_max_stackframe). */ the_iifii = VG_(ii_create_image)( the_iicii ); # if defined(VGO_aix5) /* Tell aspacem where the initial client stack is, so that it can later produce a faked-up NSegment in response to VG_(am_find_nsegment) for that address range, if asked. */ + /* NOTE: this call reads VG_(clo_max_stackframe). */ VG_(am_aix5_set_initial_client_sp)( the_iifii.initial_client_SP ); /* Now have a look at said fake segment, so we can find out the size of it. */ @@ -1484,7 +1486,7 @@ = VG_(am_find_nsegment)( the_iifii.initial_client_SP ); vg_assert(seg); sz = seg->end - seg->start + 1; -vg_assert(sz >= 0 && sz <= 64*1024*1024); /* stay sane */ +vg_assert(sz >= 0 && sz <= (256+1)*1024*1024); /* stay sane */ the_iifii.clstack_max_size = sz; } # endif Modified: trunk/include/vki/vki-ppc32-aix5.h === --- trunk/include/vki/vki-ppc32-aix5.h 2007-12-21 10:24:24 UTC (rev 7305) +++ trunk/include/vki/vki-ppc32-aix5.h 2007-12-22 14:12:42 UTC (rev 7306) @@ -290,6 +290,7 @@ #define VKI_SEGV_MAPERR 50 #define VKI_TRAP_TR
[Valgrind-developers] valgrind: r7307 - trunk/coregrind
Author: sewardj Date: 2007-12-22 14:14:04 + (Sat, 22 Dec 2007) New Revision: 7307 Log: Comment-only change. Modified: trunk/coregrind/m_main.c Modified: trunk/coregrind/m_main.c === --- trunk/coregrind/m_main.c2007-12-22 14:12:42 UTC (rev 7306) +++ trunk/coregrind/m_main.c2007-12-22 14:14:04 UTC (rev 7307) @@ -1470,14 +1470,14 @@ # error "Uknown platform" # endif - /* NOTE: this call reads VG_(clo_max_stackframe). */ + /* NOTE: this call reads VG_(clo_main_stacksize). */ the_iifii = VG_(ii_create_image)( the_iicii ); # if defined(VGO_aix5) /* Tell aspacem where the initial client stack is, so that it can later produce a faked-up NSegment in response to VG_(am_find_nsegment) for that address range, if asked. */ - /* NOTE: this call reads VG_(clo_max_stackframe). */ + /* NOTE: this call reads VG_(clo_main_stacksize). */ VG_(am_aix5_set_initial_client_sp)( the_iifii.initial_client_SP ); /* Now have a look at said fake segment, so we can find out the size of it. */ - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7308 - in trunk: cachegrind coregrind include
Author: tom Date: 2007-12-30 12:28:26 + (Sun, 30 Dec 2007) New Revision: 7308 Log: Add const qualifiers to appropriate arguments of OSet routines. Patch from Bart Van Assche <[EMAIL PROTECTED]>. Modified: trunk/cachegrind/cg_main.c trunk/coregrind/m_oset.c trunk/include/pub_tool_oset.h Modified: trunk/cachegrind/cg_main.c === --- trunk/cachegrind/cg_main.c 2007-12-22 14:14:04 UTC (rev 7307) +++ trunk/cachegrind/cg_main.c 2007-12-30 12:28:26 UTC (rev 7308) @@ -112,7 +112,7 @@ } LineCC; // First compare file, then fn, then line. -static Word cmp_CodeLoc_LineCC(void *vloc, void *vcc) +static Word cmp_CodeLoc_LineCC(const void *vloc, const void *vcc) { Word res; CodeLoc* a = (CodeLoc*)vloc; @@ -182,7 +182,7 @@ /*--- String table operations ---*/ /**/ -static Word stringCmp( void* key, void* elem ) +static Word stringCmp( const void* key, const void* elem ) { return VG_(strcmp)(*(Char**)key, *(Char**)elem); } Modified: trunk/coregrind/m_oset.c === --- trunk/coregrind/m_oset.c2007-12-22 14:14:04 UTC (rev 7307) +++ trunk/coregrind/m_oset.c2007-12-30 12:28:26 UTC (rev 7308) @@ -189,7 +189,7 @@ } // Compare a key and an element. Inlining is *crucial*. -static inline Word slow_cmp(AvlTree* t, void* k, AvlNode* n) +static inline Word slow_cmp(const AvlTree* t, const void* k, const AvlNode* n) { return t->cmp(k, elem_of_node(n)); } @@ -490,7 +490,7 @@ /**/ // Find the *node* in t matching k, or NULL if not found. -static AvlNode* avl_lookup(AvlTree* t, void* k) +static AvlNode* avl_lookup(const AvlTree* t, const void* k) { Word cmpres; AvlNode* curr = t->root; @@ -522,7 +522,7 @@ } // Find the *element* in t matching k, or NULL if not found. -void* VG_(OSetGen_Lookup)(AvlTree* t, void* k) +void* VG_(OSetGen_Lookup)(const AvlTree* t, const void* k) { AvlNode* n; vg_assert(t); @@ -532,7 +532,7 @@ // Find the *element* in t matching k, or NULL if not found; use the given // comparison function rather than the standard one. -void* VG_(OSetGen_LookupWithCmp)(AvlTree* t, void* k, OSetCmp_t cmp) +void* VG_(OSetGen_LookupWithCmp)(AvlTree* t, const void* k, OSetCmp_t cmp) { // Save the normal one to the side, then restore once we're done. void* e; @@ -546,7 +546,7 @@ } // Is there an element matching k? -Bool VG_(OSetGen_Contains)(AvlTree* t, void* k) +Bool VG_(OSetGen_Contains)(const AvlTree* t, const void* k) { return (NULL != VG_(OSetGen_Lookup)(t, k)); } @@ -775,7 +775,7 @@ /*--- Miscellaneous operations ---*/ /**/ -Int VG_(OSetGen_Size)(AvlTree* t) +Int VG_(OSetGen_Size)(const AvlTree* t) { vg_assert(t); return t->nElems; Modified: trunk/include/pub_tool_oset.h === --- trunk/include/pub_tool_oset.h 2007-12-22 14:14:04 UTC (rev 7307) +++ trunk/include/pub_tool_oset.h 2007-12-30 12:28:26 UTC (rev 7308) @@ -76,7 +76,7 @@ // - Alloc: allocates a chunk of memory. // - Free: frees a chunk of memory allocated with Alloc. -typedef Word (*OSetCmp_t) ( void* key, void* elem ); +typedef Word (*OSetCmp_t) ( const void* key, const void* elem ); typedef void* (*OSetAlloc_t) ( SizeT szB ); typedef void (*OSetFree_t)( void* p ); @@ -234,11 +234,11 @@ // they will return NULL if VG_(OSetGen_Next)() is called without an // intervening call to VG_(OSetGen_ResetIter)(). -extern Int VG_(OSetGen_Size) ( OSet* os ); +extern Int VG_(OSetGen_Size) ( const OSet* os ); extern void VG_(OSetGen_Insert) ( OSet* os, void* elem ); -extern Bool VG_(OSetGen_Contains) ( OSet* os, void* key ); -extern void* VG_(OSetGen_Lookup) ( OSet* os, void* key ); -extern void* VG_(OSetGen_LookupWithCmp)( OSet* os, void* key, OSetCmp_t cmp ); +extern Bool VG_(OSetGen_Contains) ( const OSet* os, const void* key ); +extern void* VG_(OSetGen_Lookup) ( const OSet* os, const void* key ); +extern void* VG_(OSetGen_LookupWithCmp)( OSet* os, const void* key, OSetCmp_t cmp ); extern void* VG_(OSetGen_Remove) ( OSet* os, void* key ); extern void VG_(OSetGen_ResetIter)( OSet* os ); extern void* VG_(OSetGen_Next) ( OSet* os ); - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.ne
[Valgrind-developers] valgrind: r7309 - trunk/exp-drd
Author: tom Date: 2008-01-02 10:07:44 + (Wed, 02 Jan 2008) New Revision: 7309 Log: Stop drd trying to get a backtrace when there is no stack pointer. Patch from Bart Van Assche <[EMAIL PROTECTED]>. Modified: trunk/exp-drd/drd_segment.c Modified: trunk/exp-drd/drd_segment.c === --- trunk/exp-drd/drd_segment.c 2007-12-30 12:28:26 UTC (rev 7308) +++ trunk/exp-drd/drd_segment.c 2008-01-02 10:07:44 UTC (rev 7309) @@ -64,7 +64,7 @@ sg->next = 0; sg->prev = 0; - if (vg_created != VG_INVALID_THREADID) + if (vg_created != VG_INVALID_THREADID && VG_(get_SP)(vg_created) != 0) sg->stacktrace = VG_(record_ExeContext)(vg_created, 0); else sg->stacktrace = 0; - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7310 - in trunk: coregrind exp-drd
Author: tom Date: 2008-01-02 10:13:04 + (Wed, 02 Jan 2008) New Revision: 7310 Log: Mark the main thread as running while the initial memory declarations are made to the tool so that the tool can associate that memory with the main thread if it wishes. Also cleanup existing hacks in the drd tool which worked around the fact that the core did not set the current thread while declaring the initial memory. Path from Bart Van Assche <[EMAIL PROTECTED]>. Modified: trunk/coregrind/m_main.c trunk/exp-drd/drd_main.c trunk/exp-drd/drd_thread.c Modified: trunk/coregrind/m_main.c === --- trunk/coregrind/m_main.c2008-01-02 10:07:44 UTC (rev 7309) +++ trunk/coregrind/m_main.c2008-01-02 10:13:04 UTC (rev 7310) @@ -1763,6 +1763,12 @@ { Addr* seg_starts; Int n_seg_starts; + /* Mark the main thread as running while we tell the tool about +the client memory so that the tool can associate that memory +with the main thread. */ + tl_assert(VG_(running_tid) == VG_INVALID_THREADID); + VG_(running_tid) = tid_main; + seg_starts = get_seg_starts( &n_seg_starts ); vg_assert(seg_starts && n_seg_starts >= 0); @@ -1821,6 +1827,10 @@ False, /* readable? */ False, /* writable? */ True /* executable? */ ); + + /* Clear the running thread indicator */ + VG_(running_tid) = VG_INVALID_THREADID; + tl_assert(VG_(running_tid) == VG_INVALID_THREADID); } //-- Modified: trunk/exp-drd/drd_main.c === --- trunk/exp-drd/drd_main.c2008-01-02 10:07:44 UTC (rev 7309) +++ trunk/exp-drd/drd_main.c2008-01-02 10:13:04 UTC (rev 7310) @@ -321,13 +321,6 @@ const DrdThreadId drd_creator = VgThreadIdToDrdThreadId(creator); tl_assert(created != VG_INVALID_THREADID); thread_pre_create(drd_creator, created); -#if 1 - // Hack: compensation for code missing in coregrind/m_main.c. - if (created == 1) - { - thread_set_running_tid(1, 1); - } -#endif if (IsValidDrdThreadId(drd_creator)) { thread_new_segment(drd_creator); Modified: trunk/exp-drd/drd_thread.c === --- trunk/exp-drd/drd_thread.c 2008-01-02 10:07:44 UTC (rev 7309) +++ trunk/exp-drd/drd_thread.c 2008-01-02 10:13:04 UTC (rev 7310) @@ -424,17 +424,14 @@ DrdThreadId thread_get_running_tid(void) { - // HACK. To do: remove the if-statement and keep the assert. - if (VG_(get_running_tid)() != VG_INVALID_THREADID) - tl_assert(VG_(get_running_tid)() == s_vg_running_tid); + tl_assert(VG_(get_running_tid)() == s_vg_running_tid); tl_assert(s_drd_running_tid != DRD_INVALID_THREADID); return s_drd_running_tid; } void thread_set_vg_running_tid(const ThreadId vg_tid) { - // HACK. To do: uncomment the line below. - // tl_assert(vg_tid != VG_INVALID_THREADID); + tl_assert(vg_tid != VG_INVALID_THREADID); if (vg_tid != s_vg_running_tid) { @@ -447,10 +444,6 @@ void thread_set_running_tid(const ThreadId vg_tid, const DrdThreadId drd_tid) { - // HACK. To do: remove the next two lines. - if (vg_tid == VG_INVALID_THREADID) - return; - tl_assert(vg_tid != VG_INVALID_THREADID); tl_assert(drd_tid != DRD_INVALID_THREADID); - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind-www r343 - trunk
Author: njn Date: 2008-01-03 00:44:09 + (Thu, 03 Jan 2008) New Revision: 343 Log: Update front page, mostly for 3.3.0 changes. Modified: trunk/index.html Modified: trunk/index.html === --- trunk/index.html2007-12-11 03:10:44 UTC (rev 342) +++ trunk/index.html2008-01-03 00:44:09 UTC (rev 343) @@ -13,17 +13,18 @@ Valgrind is an award-winning -suite of tools for debugging and profiling Linux -programs. With the tools that come with Valgrind, you can -automatically detect many memory management and threading bugs, -avoiding hours of frustrating bug-hunting, making your programs -more stable. You can also perform detailed profiling, to speed up -and reduce memory use of your programs. +instrumentation framework for building dynamic analysis tools. There +are Valgrind tools that can automatically detect many memory management +and threading bugs, and profile your programs in detail. You can also +use Valgrind to build new tools. + -The Valgrind distribution currently includes four tools: a -memory error detector, a cache (time) profiler, a call-graph profiler, -and a heap (space) profiler. It runs on the following platforms: -X86/Linux, AMD64/Linux, PPC32/Linux, PPC64/Linux. +The Valgrind distribution currently includes five production-quality +tools: a memory error detector, a thread error detector, a cache and +branch-prediction profiler, a call-graph generating cache profiler, and a +heap profiler. It also includes two experimental tools: a data race +detector, and an instant memory leak detector. It runs on the following +platforms: X86/Linux, AMD64/Linux, PPC32/Linux, PPC64/Linux. Valgrind is http://www.opensource.org/";>Open Source / http://www.gnu.org/philosophy/free-sw.html";>Free Software, @@ -42,15 +43,6 @@ for x86/Linux, AMD64/Linux, PPC32/Linux and PPC64/Linux, is available. (release notes). - - January 29 2007: valgrind-3.2.3, - for x86/Linux, AMD64/Linux, PPC32/Linux and PPC64/Linux, is available. - 3.2.3 is almost identical to 3.2.2, but fixes a regression that - unfortunately crept into 3.2.2. - - October 30 2006: The slides for a tutorial entitled "Building - Workload Characterization Tools with Valgrind" are available on the - publications page. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind-www r344 - trunk/info
Author: njn Date: 2008-01-03 04:41:54 + (Thu, 03 Jan 2008) New Revision: 344 Log: Add missing tag. Modified: trunk/info/about.html Modified: trunk/info/about.html === --- trunk/info/about.html 2008-01-03 00:44:09 UTC (rev 343) +++ trunk/info/about.html 2008-01-03 04:41:54 UTC (rev 344) @@ -43,7 +43,7 @@ have had feedback from users working on projects with up to 25 million lines of code. It has been used on projects of all sizes, from single-user personal projects, to projects with hundreds of -programmers. +programmers. Valgrind is suitable for any type of software. Valgrind has been used with desktop applications, libraries, databases, games, web - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind-www r345 - trunk/info
Author: njn Date: 2008-01-03 05:01:50 + (Thu, 03 Jan 2008) New Revision: 345 Log: Add a page about development priorities that Julian and I wrote ages ago. Currently not linked to from the front page -- I'm still not sure if we should put it up. Added: trunk/info/priorities.html Added: trunk/info/priorities.html === --- trunk/info/priorities.html (rev 0) +++ trunk/info/priorities.html 2008-01-03 05:01:50 UTC (rev 345) @@ -0,0 +1,171 @@ +Development Priorities + +The following is a prioritised list of Valgrind design and +development goals. Each one is followed by a rationale written like +this. The aim of this list is to give a general understanding of +what we think is important, but it should not be taken as +inviolable. + +Following the goals and rationales are some background comments on +techniques that have been used to achieve these goals. + +High Priority + + + +Robustness. Valgrind should be able to correctly run +as many programs as possible on the platforms we support. + +Systems which cannot be relied on to handle the vast majority of +presented workloads soon fall out of favour with users. + + + +Accuracy of outputs. Debugging and profiling +information generated by the tools should be sufficiently accurate as to +be both useful to and credible to users. For example, bug detectors +should have minimal false positives. + +Tools which produce unreliable or non-credible results soon fall +out of favour with users. + + + +Design simplicity. The design and implementation +should be easy to understand, maintain, test and verify. + +Our engineering resources are very limited, so the code base +should be structured to make best use of them. Also, a simple code base +is more accessible to newcomers. + + + +Instrumentation capabilities. Firstly, provide +enough capabilities to keep Memcheck going. Then add capabilities as +required by other tools. + +We aim for Valgrind to be an effective framework for building +dynamic analysis tools, so it needs to provide instrumentation +capabilities as required by current and emerging tools. + + + +Medium Priority + + + +Performance (speed and memory usage) of heavyweight +tools. This covers the speed of both the Valgrind core and the +tool components. + +All else being equal, faster and less space hungry tools are able +to handle larger workloads and so are more useful. + + + +Usability. Users should be able to use the tools +without excessive complication or inconvenience. + +Tools which are difficult or inconvenient to use soon fall out of +favour with users. + + + +New tools. Encourage development of new tools as +needs and opportunities develop. + +The needs of users and the general computing landscape changes +slowly over time, and it is important to remain relevant. + + + +Portability. We want to avoid platform-specific +techniques. + +Platform-specific techniques and assumptions are clearly a + hindrance to portablility. We have also found them to sometimes + reduce stability. + + + +Low Priority + + +Performance of lightweight tools. + +Heavyweight tools are both harder to construct and more valuable +to users than simple ones (eg, instruction counters, memory trace +generators), and other instrumentation frameworks (such as Pin and +DynamoRIO) support lightweight tools well. Where design choices +conflict they have usually been resolved in favour of supporting +heavyweight tools better. + + + +New platforms. Although we want portability, we +don't want to support a lot of platforms, because it's hard work, +especially to do it to a high quality. + +As above, our engineering resources are limited and so we should +focus effort on the most widely used platforms. + + + + + +Example Techniques +Here are some techniques that in the past have been used to achieve +the above goals. This list does not claim to be complete. + + +Valgrind's code representation (IR) favours powerful instrumentation +capabilities. This allows heavyweight tools such as Memcheck to be +built and have reasonable performance. However, it gives poor +performance for lightweight tools such as trace collectors. Such +lightweight tools will have better performance if written in other DBI +frameworks such as Pin or DynamoRIO. + + + +Valgrind does not use libc or any other library itself. This used to +not be true, but it caused robustness and portability problems. + + + +Valgrind makes very few assumptions about memory layout. This used to +not be true, but it caused robustness and portability problems. For +example, Memcheck's two-level shadow memory representation means its +shadow memory can be laid out very flexibly, but it is not particularly +fast. A "half-and-half" representation that stores shadow memory can be +faster, but fails on some programs, some Linux kernel configurations, +and is incompatible with other OSes such as Mac OS X. + + + +Valgrind used to use x86
[Valgrind-developers] valgrind-www r346 - trunk/info
Author: njn Date: 2008-01-03 05:03:22 + (Thu, 03 Jan 2008) New Revision: 346 Log: fix tags Modified: trunk/info/priorities.html Modified: trunk/info/priorities.html === --- trunk/info/priorities.html 2008-01-03 05:01:50 UTC (rev 345) +++ trunk/info/priorities.html 2008-01-03 05:03:22 UTC (rev 346) @@ -79,7 +79,7 @@ -Portability. We want to avoid platform-specific +Portability. We want to avoid platform-specific techniques. Platform-specific techniques and assumptions are clearly a @@ -91,7 +91,7 @@ Low Priority -Performance of lightweight tools. +Performance of lightweight tools. Heavyweight tools are both harder to construct and more valuable to users than simple ones (eg, instruction counters, memory trace - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind-www r347 - trunk/info
Author: njn Date: 2008-01-03 05:09:36 + (Thu, 03 Jan 2008) New Revision: 347 Log: more html fixes Modified: trunk/info/priorities.html Modified: trunk/info/priorities.html === --- trunk/info/priorities.html 2008-01-03 05:03:22 UTC (rev 346) +++ trunk/info/priorities.html 2008-01-03 05:09:36 UTC (rev 347) @@ -50,6 +50,7 @@ + Medium Priority @@ -83,13 +84,15 @@ techniques. Platform-specific techniques and assumptions are clearly a - hindrance to portablility. We have also found them to sometimes - reduce stability. +hindrance to portablility. We have also found them to sometimes reduce +stability. + Low Priority + Performance of lightweight tools. @@ -117,6 +120,7 @@ Here are some techniques that in the past have been used to achieve the above goals. This list does not claim to be complete. + Valgrind's code representation (IR) favours powerful instrumentation capabilities. This allows heavyweight tools such as Memcheck to be - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind-www r348 - trunk/info
Author: njn Date: 2008-01-03 05:12:10 + (Thu, 03 Jan 2008) New Revision: 348 Log: tweaks Modified: trunk/info/priorities.html Modified: trunk/info/priorities.html === --- trunk/info/priorities.html 2008-01-03 05:09:36 UTC (rev 347) +++ trunk/info/priorities.html 2008-01-03 05:12:10 UTC (rev 348) @@ -155,9 +155,10 @@ Valgrind serialises thread execution. For subtle atomicity reasons, -this is necessary for tools (like Memcheck) that use shadow values. It -means they can not use more than one processor at a time on -multiprocessor machines. +this is necessary for tools (like Memcheck) that use shadow values. +(How to do a better job with this is still an open research question.) +It means that Valgrind tools can not use more than one processor at a +time on multiprocessor machines. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind-www r349 - trunk/info
Author: njn Date: 2008-01-03 05:13:42 + (Thu, 03 Jan 2008) New Revision: 349 Log: wibble Modified: trunk/info/priorities.html Modified: trunk/info/priorities.html === --- trunk/info/priorities.html 2008-01-03 05:12:10 UTC (rev 348) +++ trunk/info/priorities.html 2008-01-03 05:13:42 UTC (rev 349) @@ -6,9 +6,6 @@ what we think is important, but it should not be taken as inviolable. -Following the goals and rationales are some background comments on -techniques that have been used to achieve these goals. - High Priority @@ -117,8 +114,8 @@ Example Techniques -Here are some techniques that in the past have been used to achieve -the above goals. This list does not claim to be complete. +Here are some techniques that in the past have been used to achieve +the above goals. This list does not claim to be complete. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind-www r350 - trunk/info
Author: njn Date: 2008-01-03 22:57:18 + (Thu, 03 Jan 2008) New Revision: 350 Log: tweak Modified: trunk/info/platforms.html Modified: trunk/info/platforms.html === --- trunk/info/platforms.html 2008-01-03 05:13:42 UTC (rev 349) +++ trunk/info/platforms.html 2008-01-03 22:57:18 UTC (rev 350) @@ -79,7 +79,7 @@ Linux *BSD Darwin Solaris x86 donelow high low amd64 donelow eventually? -ppc32 done high +ppc32 done low ppc64 done ? arm low mips low - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] vex: r1807 - trunk/priv/guest-x86
Author: sewardj Date: 2008-01-04 01:22:41 + (Fri, 04 Jan 2008) New Revision: 1807 Log: Very kludgey implementation of IRET. May or may not fix #155011. Modified: trunk/priv/guest-x86/toIR.c Modified: trunk/priv/guest-x86/toIR.c === --- trunk/priv/guest-x86/toIR.c 2007-12-11 00:41:57 UTC (rev 1806) +++ trunk/priv/guest-x86/toIR.c 2008-01-04 01:22:41 UTC (rev 1807) @@ -7135,7 +7135,96 @@ ); } +/* Generate IR to set the guest %EFLAGS from the pushfl-format image + in the given 32-bit temporary. The flags that are set are: O S Z A + C P D ID AC. + In all cases, code to set AC is generated. However, VEX actually + ignores the AC value and so can optionally emit an emulation + warning when it is enabled. In this routine, an emulation warning + is only emitted if emit_AC_emwarn is True, in which case + next_insn_EIP must be correct (this allows for correct code + generation for popfl/popfw). If emit_AC_emwarn is False, + next_insn_EIP is unimportant (this allows for easy if kludgey code + generation for IRET.) */ + +static +void set_EFLAGS_from_value ( IRTemp t1, + Bool emit_AC_emwarn, + Addr32 next_insn_EIP ) +{ + vassert(typeOfIRTemp(irsb->tyenv,t1) == Ity_I32); + + /* t1 is the flag word. Mask out everything except OSZACP and set + the flags thunk to X86G_CC_OP_COPY. */ + stmt( IRStmt_Put( OFFB_CC_OP, mkU32(X86G_CC_OP_COPY) )); + stmt( IRStmt_Put( OFFB_CC_DEP2, mkU32(0) )); + stmt( IRStmt_Put( OFFB_CC_DEP1, + binop(Iop_And32, + mkexpr(t1), + mkU32( X86G_CC_MASK_C | X86G_CC_MASK_P + | X86G_CC_MASK_A | X86G_CC_MASK_Z + | X86G_CC_MASK_S| X86G_CC_MASK_O ) + ) +) + ); + /* Set NDEP even though it isn't used. This makes redundant-PUT + elimination of previous stores to this field work better. */ + stmt( IRStmt_Put( OFFB_CC_NDEP, mkU32(0) )); + + /* Also need to set the D flag, which is held in bit 10 of t1. + If zero, put 1 in OFFB_DFLAG, else -1 in OFFB_DFLAG. */ + stmt( IRStmt_Put( +OFFB_DFLAG, +IRExpr_Mux0X( + unop(Iop_32to8, +binop(Iop_And32, + binop(Iop_Shr32, mkexpr(t1), mkU8(10)), + mkU32(1))), + mkU32(1), + mkU32(0x))) + ); + + /* Set the ID flag */ + stmt( IRStmt_Put( +OFFB_IDFLAG, +IRExpr_Mux0X( + unop(Iop_32to8, +binop(Iop_And32, + binop(Iop_Shr32, mkexpr(t1), mkU8(21)), + mkU32(1))), + mkU32(0), + mkU32(1))) + ); + + /* And set the AC flag. If setting it 1 to, possibly emit an + emulation warning. */ + stmt( IRStmt_Put( +OFFB_ACFLAG, +IRExpr_Mux0X( + unop(Iop_32to8, +binop(Iop_And32, + binop(Iop_Shr32, mkexpr(t1), mkU8(18)), + mkU32(1))), + mkU32(0), + mkU32(1))) + ); + + if (emit_AC_emwarn) { + put_emwarn( mkU32(EmWarn_X86_acFlag) ); + stmt( + IRStmt_Exit( +binop( Iop_CmpNE32, + binop(Iop_And32, mkexpr(t1), mkU32(1<<18)), + mkU32(0) ), +Ijk_EmWarn, +IRConst_U32( next_insn_EIP ) + ) + ); + } +} + + /* Helper for deciding whether a given insn (starting at the opcode byte) may validly be used with a LOCK prefix. The following insns may be used with LOCK when their destination operand is in memory. @@ -11124,7 +11213,32 @@ dres.whatNext = Dis_StopHere; DIP("ret\n"); break; - + + case 0xCF: /* IRET */ + /* Note, this is an extremely kludgey and limited implementation + of iret. All it really does is: +popl %EIP; popl %CS; popl %EFLAGS. + %CS is set but ignored (as it is in (eg) popw %cs)". */ + t1 = newTemp(Ity_I32); /* ESP */ + t2 = newTemp(Ity_I32); /* new EIP */ + t3 = newTemp(Ity_I32); /* new CS */ + t4 = newTemp(Ity_I32); /* new EFLAGS */ + assign(t1, getIReg(4,R_ESP)); + assign(t2, loadLE(Ity_I32, binop(Iop_Add32,mkexpr(t1),mkU32(0) ))); + assign(t3, loadLE(Ity_I32, binop(Iop_Add32,mkexpr(t1),mkU32(4) ))); + assign(t4, loadLE(Ity_I32, binop(Iop_Add32,mkexpr(t1),mkU32(8) ))); + /* Get stuff off stack */ + putIReg(4, R_ESP,binop(Iop_Add32, mkexpr(t1), mkU32(12))); + /* set %CS (which is ignored anyway) */ + putSReg( R_CS, unop(Iop_32to16, mkexpr(t3)) ); + /* set %EFLAGS */ + set_EFLAGS_from_value( t4, False
[Valgrind-developers] valgrind: r7311 - branches
Author: sewardj Date: 2008-01-04 11:08:38 + (Fri, 04 Jan 2008) New Revision: 7311 Log: Create a copy of trunk r7310 intended to be used for improving reading of data symbols. Added: branches/DATASYMS/ Copied: branches/DATASYMS (from rev 7310, trunk) - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7312 - in trunk/exp-drd: . tests
Author: sewardj Date: 2008-01-04 11:36:41 + (Fri, 04 Jan 2008) New Revision: 7312 Log: Rename drd_preloaded.c to drd_intercepts.c (Bart Van Assche) Added: trunk/exp-drd/drd_intercepts.c Removed: trunk/exp-drd/drd_preloaded.c Modified: trunk/exp-drd/Makefile.am trunk/exp-drd/tests/pth_cond_race.stderr.exp Modified: trunk/exp-drd/Makefile.am === --- trunk/exp-drd/Makefile.am 2008-01-04 11:08:38 UTC (rev 7311) +++ trunk/exp-drd/Makefile.am 2008-01-04 11:36:41 UTC (rev 7312) @@ -20,7 +20,7 @@ noinst_PROGRAMS += exp-drd-ppc64-aix5 vgpreload_exp-drd-ppc64-aix5.so endif -VGPRELOAD_DRD_SOURCES_COMMON = drd_preloaded.c +VGPRELOAD_DRD_SOURCES_COMMON = drd_intercepts.c vgpreload_exp_drd_x86_linux_so_SOURCES = $(VGPRELOAD_DRD_SOURCES_COMMON) vgpreload_exp_drd_x86_linux_so_CPPFLAGS = $(AM_CPPFLAGS_X86_LINUX) Copied: trunk/exp-drd/drd_intercepts.c (from rev 7310, trunk/exp-drd/drd_preloaded.c) === --- trunk/exp-drd/drd_intercepts.c (rev 0) +++ trunk/exp-drd/drd_intercepts.c 2008-01-04 11:36:41 UTC (rev 7312) @@ -0,0 +1,530 @@ + +/**/ +/*--- Client-space code for drd. drd_preloaded.c ---*/ +/**/ + +/* + This file is part of drd, a data race detector. + + Copyright (C) 2006-2007 Bart Van Assche + [EMAIL PROTECTED] + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307, USA. + + The GNU General Public License is contained in the file COPYING. +*/ + +/* - + ALL THE CODE IN THIS FILE RUNS ON THE SIMULATED CPU. + + These functions are not called directly - they're the targets of code + redirection or load notifications (see pub_core_redir.h for info). + They're named weirdly so that the intercept code can find them when the + shared object is initially loaded. + + Note that this filename has the "drd_" prefix because it can appear + in stack traces, and the "drd_" makes it a little clearer that it + originates from Valgrind. + -- */ + +// Make sure pthread_spinlock_t is available on glibc 2.3.2 systems. +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif + +#include +#include // uintptr_t +#include +#include +#include +#include "drd_clientreq.h" +#include "pub_core_basics.h" +#include "pub_core_clreq.h" +#include "pub_core_debuginfo.h" // Needed for pub_core_redir.h +#include "pub_core_redir.h" // For VG_NOTIFY_ON_LOAD +#include "pub_tool_threadstate.h"// VG_N_THREADS + + +// Defines. + +#define PTH_FUNC(ret_ty, f, args...) \ + ret_ty VG_WRAP_FUNCTION_ZZ(libpthreadZdsoZd0,f)(args); \ + ret_ty VG_WRAP_FUNCTION_ZZ(libpthreadZdsoZd0,f)(args) + + +// Local data structures. + +typedef struct +{ + void* (*start)(void*); + void* arg; + int detachstate; +#if 0 + pthread_mutex_t mutex; + pthread_cond_t cond; +#else + int wrapper_started; +#endif +} VgPosixThreadArgs; + + +// Local variables. + +static int vg_main_thread_state_is_set = 0; + + +// Function definitions. + +static void vg_start_suppression(const void* const p, size_t const size) +{ + int res; + VALGRIND_DO_CLIENT_REQUEST(res, 0, VG_USERREQ__DRD_START_SUPPRESSION, + p, size, 0, 0, 0); +} + +#if 0 +static void vg_finish_suppression(const void* const p, size_t const size) +{ + int res; + VALGRIND_DO_CLIENT_REQUEST(res, 0, VG_USERREQ__DRD_FINISH_SUPPRESSION, + p, size, 0, 0, 0); +} +#endif + +static void vg_start_recording(void) +{ + int res; + VALGRIND_DO_CLIENT_REQUEST(res, 0, VG_USERREQ__DRD_START_RECORDING, + pthread_self(), 0, 0, 0, 0); +} + +static void vg_stop_recording(void) +{ + int res; + VALGRIND_DO_CLIENT_REQUEST(res, 0, VG_USERREQ__DRD_STOP_RECORDING, + pthread_self(), 0, 0, 0, 0); +} + +static void vg_set_joinable(const pthread_t tid, const int joinable) +{ + int res; + assert(joinable == 0 || joinable == 1); +#if 0 + printf("vg_set_joinable(%ld, %d)\
[Valgrind-developers] valgrind: r7313 - in branches/DATASYMS/coregrind: . m_debuginfo
Author: sewardj Date: 2008-01-04 13:09:44 + (Fri, 04 Jan 2008) New Revision: 7313 Log: Rename the VG_AR_SYMTAB arena to VG_AR_DINFO to reflect more accurately its purpose. Modified: branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c branches/DATASYMS/coregrind/m_debuginfo/readdwarf.c branches/DATASYMS/coregrind/m_debuginfo/readelf.c branches/DATASYMS/coregrind/m_debuginfo/readstabs.c branches/DATASYMS/coregrind/m_debuginfo/readxcoff.c branches/DATASYMS/coregrind/m_debuginfo/storage.c branches/DATASYMS/coregrind/m_mallocfree.c branches/DATASYMS/coregrind/m_redir.c branches/DATASYMS/coregrind/pub_core_mallocfree.h Modified: branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c === --- branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c 2008-01-04 11:36:41 UTC (rev 7312) +++ branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c 2008-01-04 13:09:44 UTC (rev 7313) @@ -119,13 +119,13 @@ vg_assert(filename); - si = VG_(arena_calloc)(VG_AR_SYMTAB, 1, sizeof(SegInfo)); + si = VG_(arena_calloc)(VG_AR_DINFO, 1, sizeof(SegInfo)); si->text_start_avma = start; si->text_size = size; si->foffset = foffset; - si->filename= VG_(arena_strdup)(VG_AR_SYMTAB, filename); + si->filename= VG_(arena_strdup)(VG_AR_DINFO, filename); si->memname = memname - ? VG_(arena_strdup)(VG_AR_SYMTAB, memname) + ? VG_(arena_strdup)(VG_AR_DINFO, memname) : NULL; /* Everything else -- pointers, sizes, arrays -- is zeroed by calloc. @@ -151,17 +151,17 @@ { struct strchunk *chunk, *next; vg_assert(si != NULL); - if (si->filename) VG_(arena_free)(VG_AR_SYMTAB, si->filename); - if (si->symtab) VG_(arena_free)(VG_AR_SYMTAB, si->symtab); - if (si->loctab) VG_(arena_free)(VG_AR_SYMTAB, si->loctab); - if (si->cfsi) VG_(arena_free)(VG_AR_SYMTAB, si->cfsi); + if (si->filename) VG_(arena_free)(VG_AR_DINFO, si->filename); + if (si->symtab) VG_(arena_free)(VG_AR_DINFO, si->symtab); + if (si->loctab) VG_(arena_free)(VG_AR_DINFO, si->loctab); + if (si->cfsi) VG_(arena_free)(VG_AR_DINFO, si->cfsi); if (si->cfsi_exprs) VG_(deleteXA)(si->cfsi_exprs); for (chunk = si->strchunks; chunk != NULL; chunk = next) { next = chunk->next; - VG_(arena_free)(VG_AR_SYMTAB, chunk); + VG_(arena_free)(VG_AR_DINFO, chunk); } - VG_(arena_free)(VG_AR_SYMTAB, si); + VG_(arena_free)(VG_AR_DINFO, si); } @@ -354,7 +354,7 @@ if (!filename) return; - filename = VG_(arena_strdup)( VG_AR_SYMTAB, filename ); + filename = VG_(arena_strdup)( VG_AR_DINFO, filename ); ok = (seg->kind == SkFileC || (seg->kind == SkFileV && allow_SkFileV)) && seg->offset == 0 @@ -365,7 +365,7 @@ && ML_(is_elf_object_file)( (const void*)seg->start ); if (!ok) { - VG_(arena_free)(VG_AR_SYMTAB, filename); + VG_(arena_free)(VG_AR_DINFO, filename); return; } @@ -379,7 +379,7 @@ /* acquire_syms_for_range makes its own copy of filename, so is safe to free it. */ - VG_(arena_free)(VG_AR_SYMTAB, filename); + VG_(arena_free)(VG_AR_DINFO, filename); } Modified: branches/DATASYMS/coregrind/m_debuginfo/readdwarf.c === --- branches/DATASYMS/coregrind/m_debuginfo/readdwarf.c 2008-01-04 11:36:41 UTC (rev 7312) +++ branches/DATASYMS/coregrind/m_debuginfo/readdwarf.c 2008-01-04 13:09:44 UTC (rev 7313) @@ -75,7 +75,7 @@ { if (wa->tab) { vg_assert(wa->tab_size > 0); - VG_(arena_free)(VG_AR_SYMTAB, wa->tab); + VG_(arena_free)(VG_AR_DINFO, wa->tab); } init_WordArray(wa); } @@ -97,14 +97,14 @@ vg_assert( (wa->tab_size == 0 && wa->tab == NULL) || (wa->tab_size != 0 && wa->tab != NULL) ); new_size = wa->tab_size == 0 ? 8 : 2 * wa->tab_size; - new_tab = VG_(arena_malloc)(VG_AR_SYMTAB, + new_tab = VG_(arena_malloc)(VG_AR_DINFO, new_size * sizeof(Word)); vg_assert(new_tab != NULL); for (i = 0; i < wa->tab_used; i++) new_tab[i] = wa->tab[i]; wa->tab_size = new_size; if (wa->tab) - VG_(arena_free)(VG_AR_SYMTAB, wa->tab); + VG_(arena_free)(VG_AR_DINFO, wa->tab); wa->tab = new_tab; } @@ -1948,10 +1948,10 @@ } static void* symtab_alloc ( SizeT szB ) { - return VG_(arena_malloc)( VG_AR_SYMTAB, szB ); + return VG_(arena_malloc)( VG_AR_DINFO, szB ); } static void symtab_free ( void* v ) { - VG_(arena_free)( VG_AR_SYMTAB, v ); + VG_(arena_free)( VG_AR_DINFO, v ); } static void initUnwindContext ( /*OUT*/UnwindContext* ctx ) Modified: branches/DATASYMS/coregrind/m_debuginfo/readelf.c === ---
[Valgrind-developers] valgrind: r7314 - trunk/memcheck/tests
Author: tom Date: 2008-01-04 23:55:27 + (Fri, 04 Jan 2008) New Revision: 7314 Log: Fix compiler warning. Patch from Bart Van Assche <[EMAIL PROTECTED]>. Modified: trunk/memcheck/tests/sigprocmask.c Modified: trunk/memcheck/tests/sigprocmask.c === --- trunk/memcheck/tests/sigprocmask.c 2008-01-04 13:09:44 UTC (rev 7313) +++ trunk/memcheck/tests/sigprocmask.c 2008-01-04 23:55:27 UTC (rev 7314) @@ -11,10 +11,10 @@ int main(void) { +#if defined(__NR_sigprocmask) && !defined(__powerpc64__) && !defined(_AIX) + int x[6], *s, *os, i; -#if defined(__NR_sigprocmask) && !defined(__powerpc64__) && !defined(_AIX) - x[0] = 0x; x[1] = 0x89abcdef; x[2] = 0x; - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7315 - trunk/exp-drd
Author: tom Date: 2008-01-04 23:57:15 + (Fri, 04 Jan 2008) New Revision: 7315 Log: Add missing include to fix compiler warning. Patch from Bart Van Assche <[EMAIL PROTECTED]>. Modified: trunk/exp-drd/drd_segment.c Modified: trunk/exp-drd/drd_segment.c === --- trunk/exp-drd/drd_segment.c 2008-01-04 23:55:27 UTC (rev 7314) +++ trunk/exp-drd/drd_segment.c 2008-01-04 23:57:15 UTC (rev 7315) @@ -31,6 +31,7 @@ #include "pub_tool_libcassert.h" // tl_assert() #include "pub_tool_libcbase.h"// VG_(strlen)() #include "pub_tool_libcprint.h" // VG_(printf)() +#include "pub_tool_machine.h" // VG_(get_SP)() #include "pub_tool_mallocfree.h" // VG_(malloc)(), VG_(free)() #include "pub_tool_threadstate.h" // VG_INVALID_THREADID - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7316 - trunk/memcheck/tests
Author: tom Date: 2008-01-04 23:58:32 + (Fri, 04 Jan 2008) New Revision: 7316 Log: Add const qualifiers to fix compiler warnings. Patch from Bart Van Assche <[EMAIL PROTECTED]>. Modified: trunk/memcheck/tests/oset_test.c Modified: trunk/memcheck/tests/oset_test.c === --- trunk/memcheck/tests/oset_test.c2008-01-04 23:57:15 UTC (rev 7315) +++ trunk/memcheck/tests/oset_test.c2008-01-04 23:58:32 UTC (rev 7316) @@ -347,10 +347,10 @@ return buf; } -static Word blockCmp(void* vkey, void* velem) +static Word blockCmp(const void* vkey, const void* velem) { - Addr key = *(Addr*)vkey; - Block* elem = (Block*)velem; + Addr key = *(const Addr*)vkey; + const Block* elem = (const Block*)velem; assert(elem->first <= elem->last); if (key < elem->first) return -1; - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7318 - in trunk: . exp-drd
Author: tom Date: 2008-01-05 00:12:45 + (Sat, 05 Jan 2008) New Revision: 7318 Log: Add drd suppression file to the default suppressions and avoid including core headers in the drd tool. Patch from Bart Van Assche <[EMAIL PROTECTED]>. Modified: trunk/configure.in trunk/exp-drd/drd_main.c Modified: trunk/configure.in === --- trunk/configure.in 2008-01-05 00:01:20 UTC (rev 7317) +++ trunk/configure.in 2008-01-05 00:12:45 UTC (rev 7318) @@ -485,6 +485,7 @@ AC_DEFINE([GLIBC_2_2], 1, [Define to 1 if you're using glibc 2.2.x]) DEFAULT_SUPP="glibc-2.2.supp ${DEFAULT_SUPP}" DEFAULT_SUPP="glibc-2.2-LinuxThreads-helgrind.supp ${DEFAULT_SUPP}" + DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" ;; 2.3) @@ -492,6 +493,7 @@ AC_DEFINE([GLIBC_2_3], 1, [Define to 1 if you're using glibc 2.3.x]) DEFAULT_SUPP="glibc-2.3.supp ${DEFAULT_SUPP}" DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" + DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" ;; 2.4) @@ -499,6 +501,7 @@ AC_DEFINE([GLIBC_2_4], 1, [Define to 1 if you're using glibc 2.4.x]) DEFAULT_SUPP="glibc-2.4.supp ${DEFAULT_SUPP}" DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" + DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" ;; 2.5) @@ -506,18 +509,21 @@ AC_DEFINE([GLIBC_2_5], 1, [Define to 1 if you're using glibc 2.5.x]) DEFAULT_SUPP="glibc-2.5.supp ${DEFAULT_SUPP}" DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" + DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" ;; 2.6) AC_MSG_RESULT(2.6 family) AC_DEFINE([GLIBC_2_6], 1, [Define to 1 if you're using glibc 2.6.x]) DEFAULT_SUPP="glibc-2.6.supp ${DEFAULT_SUPP}" DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" + DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" ;; 2.7) AC_MSG_RESULT(2.7 family) AC_DEFINE([GLIBC_2_7], 1, [Define to 1 if you're using glibc 2.7.x]) DEFAULT_SUPP="glibc-2.7.supp ${DEFAULT_SUPP}" DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" + DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" ;; aix5) AC_MSG_RESULT(AIX 5.1 or 5.2 or 5.3) Modified: trunk/exp-drd/drd_main.c === --- trunk/exp-drd/drd_main.c2008-01-05 00:01:20 UTC (rev 7317) +++ trunk/exp-drd/drd_main.c2008-01-05 00:12:45 UTC (rev 7318) @@ -35,8 +35,6 @@ #include "drd_track.h" #include "drd_vc.h" #include "priv_drd_clientreq.h" -#include "pub_core_mallocfree.h" -#include "pub_core_options.h" #include "pub_tool_vki.h" #include "pub_tool_basics.h" #include "pub_tool_debuginfo.h" // VG_(describe_IP)() @@ -152,8 +150,7 @@ thread_get_name(thread_get_running_tid()), VG_(get_running_tid)(), thread_get_running_tid()); - VG_(get_and_pp_StackTrace)(VG_(get_running_tid)(), - VG_(clo_backtrace_size)); + VG_(get_and_pp_StackTrace)(VG_(get_running_tid)(), 12); tl_assert(DrdThreadIdToVgThreadId(thread_get_running_tid()) == VG_(get_running_tid)()); } @@ -195,8 +192,7 @@ VG_(get_running_tid)(), thread_get_running_tid(), addr - thread_get_stack_min(thread_get_running_tid())); - VG_(get_and_pp_StackTrace)(VG_(get_running_tid)(), - VG_(clo_backtrace_size)); + VG_(get_and_pp_StackTrace)(VG_(get_running_tid)(), 12); tl_assert(DrdThreadIdToVgThreadId(thread_get_running_tid()) == VG_(get_running_tid)()); } @@ -251,8 +247,7 @@ VG_(message)(Vg_UserMsg, "start 0x%lx size %ld %s (tracing 0x%lx)", a1, a2 - a1, thread_get_name(thread_get_running_tid()), drd_trace_address); - VG_(get_and_pp_StackTrace)(VG_(get_running_tid)(), - VG_(clo_backtrace_size)); + VG_(get_and_pp_StackTrace)(VG_(get_running_tid)(), 12); } } @@ -264,8 +259,7 @@ VG_(message)(Vg_UserMsg, "end 0x%lx size %ld %s (tracing 0x%lx)", a1, a2 - a1, thread_get_name(thread_get_running_tid()), drd_trace_address); - VG_(get_and_pp_StackTrace)(VG_(get_running_tid)(), - VG_(clo_backtrace_size)); + VG_(get_and_pp_StackTrace)(VG_(get_running_tid)(), 12); } thread_stop_using_mem(a1, a2); mutex_stop_using_mem(a1, a2); @@ -684,21 +678,6 @@ } } -static void drd_load_suppression_file(void) -{ - tl_assert(VG_(clo_n_suppressions) < VG_CLO_MAX_SFILES - 1); - { - /* If we haven't reached the max number of suppression files, load - th
[Valgrind-developers] valgrind: r7317 - trunk/memcheck/tests
Author: tom Date: 2008-01-05 00:01:20 + (Sat, 05 Jan 2008) New Revision: 7317 Log: Fix compiler warnings by using a variable to hide the null pointer from the compiler. Patch from Bart Van Assche <[EMAIL PROTECTED]>. Modified: trunk/memcheck/tests/execve.c trunk/memcheck/tests/execve.stderr.exp trunk/memcheck/tests/execve2.c trunk/memcheck/tests/execve2.stderr.exp Modified: trunk/memcheck/tests/execve.c === --- trunk/memcheck/tests/execve.c 2008-01-04 23:58:32 UTC (rev 7316) +++ trunk/memcheck/tests/execve.c 2008-01-05 00:01:20 UTC (rev 7317) @@ -2,10 +2,11 @@ int main(void) { + char* null_filename = NULL; char* bad[2] = { (char*)1, NULL }; char* good[1] = { NULL }; - execve(NULL, bad, bad); + execve(null_filename, bad, bad); execve("/bin/true", good, good); return 0; Modified: trunk/memcheck/tests/execve.stderr.exp === --- trunk/memcheck/tests/execve.stderr.exp 2008-01-04 23:58:32 UTC (rev 7316) +++ trunk/memcheck/tests/execve.stderr.exp 2008-01-05 00:01:20 UTC (rev 7317) @@ -1,14 +1,14 @@ Syscall param execve(filename) points to unaddressable byte(s) at 0x: execve (in /...libc...) - by 0x: main (execve.c:8) + by 0x: main (execve.c:9) Address 0x is not stack'd, malloc'd or (recently) free'd Syscall param execve(argv[i]) points to unaddressable byte(s) at 0x: execve (in /...libc...) - by 0x: main (execve.c:8) + by 0x: main (execve.c:9) Address 0x is not stack'd, malloc'd or (recently) free'd Syscall param execve(envp[i]) points to unaddressable byte(s) at 0x: execve (in /...libc...) - by 0x: main (execve.c:8) + by 0x: main (execve.c:9) Address 0x is not stack'd, malloc'd or (recently) free'd Modified: trunk/memcheck/tests/execve2.c === --- trunk/memcheck/tests/execve2.c 2008-01-04 23:58:32 UTC (rev 7316) +++ trunk/memcheck/tests/execve2.c 2008-01-05 00:01:20 UTC (rev 7317) @@ -3,7 +3,9 @@ int main ( int argc, char** argv, char** envp ) { - execve(NULL,NULL, NULL); + char* null_filename = NULL; + + execve(null_filename, NULL, NULL); execve("../../tests/true", NULL, envp); assert(0); // shouldn't get here } Modified: trunk/memcheck/tests/execve2.stderr.exp === --- trunk/memcheck/tests/execve2.stderr.exp 2008-01-04 23:58:32 UTC (rev 7316) +++ trunk/memcheck/tests/execve2.stderr.exp 2008-01-05 00:01:20 UTC (rev 7317) @@ -1,4 +1,4 @@ Syscall param execve(filename) points to unaddressable byte(s) at 0x: execve (in /...libc...) - by 0x: main (execve2.c:6) + by 0x: main (execve2.c:8) Address 0x is not stack'd, malloc'd or (recently) free'd - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7319 - branches/DATASYMS/coregrind/m_debuginfo
Author: sewardj Date: 2008-01-07 19:24:26 + (Mon, 07 Jan 2008) New Revision: 7319 Log: Commit initial framework changes aimed at making data symbol reading and .got/.plt identification work properly on Linux. The basic observation is that until now, Valgrind has waited until an ELF file is mapped r-x, then attempted to read both text and data symbols for the file. That's reasonable for the text symbols but is nonsense for the data symbols, since we have no idea where ld.so will later map the file's data section. The basic change is to cause debuginfo.c to wait to see both a r-x and a rw- mapping for an ELF object file, before reading its symbols. Only that way will we know where the data segment is mapped to, and hence can we know what the data symbol actual VMAs are. As well as revising the when-to-load-symbols logic, much accumulated cruft in readelf.c is being tidied up. Note this is work in progress and is majorly broken at the moment. Modified: branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c branches/DATASYMS/coregrind/m_debuginfo/priv_readelf.h branches/DATASYMS/coregrind/m_debuginfo/priv_storage.h branches/DATASYMS/coregrind/m_debuginfo/readelf.c Modified: branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c === --- branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c 2008-01-05 00:12:45 UTC (rev 7318) +++ branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c 2008-01-07 19:24:26 UTC (rev 7319) @@ -42,6 +42,7 @@ #include "pub_core_libcbase.h" #include "pub_core_libcassert.h" #include "pub_core_libcprint.h" +#include "pub_core_libcfile.h" #include "pub_core_mallocfree.h" #include "pub_core_options.h" #include "pub_core_redir.h" // VG_(redir_notify_{new,delete}_SegInfo) @@ -237,7 +238,7 @@ } } - +#if 0 /* Create a new SegInfo with the specific address/length/vma offset, then snarf whatever info we can from the given filename into it. */ static @@ -281,8 +282,116 @@ return si; } +#endif +static Bool ranges_overlap (Addr s1, SizeT len1, Addr s2, SizeT len2 ) +{ + Addr e1, e2; + if (len1 == 0 || len2 == 0) + return False; + e1 = s1 + len1 - 1; + e2 = s2 + len2 - 1; + /* Assert that we don't have wraparound. If we do it would imply + that file sections are getting mapped around the end of the + address space, which sounds unlikely. */ + vg_assert(s1 <= e1); + vg_assert(s2 <= e2); + if (e1 < s2 || e2 < s1) return False; + return True; +} +static Bool do_SegInfos_overlap ( SegInfo* si1, SegInfo* si2 ) +{ + vg_assert(si1); + vg_assert(si2); + + if (si1->have_rx_map && si2->have_rx_map + && ranges_overlap(si1->rx_map_avma, si1->rx_map_size, + si2->rx_map_avma, si2->rx_map_size)) + return True; + + if (si1->have_rx_map && si2->have_rw_map + && ranges_overlap(si1->rx_map_avma, si1->rx_map_size, + si2->rw_map_avma, si2->rw_map_size)) + return True; + + if (si1->have_rw_map && si2->have_rx_map + && ranges_overlap(si1->rw_map_avma, si1->rw_map_size, + si2->rx_map_avma, si2->rx_map_size)) + return True; + + if (si1->have_rw_map && si2->have_rw_map + && ranges_overlap(si1->rw_map_avma, si1->rw_map_size, + si2->rw_map_avma, si2->rw_map_size)) + return True; + + return False; +} + +static void discard_marked_SegInfos ( void ) +{ + SegInfo* curr; + + while (True) { + + curr = segInfo_list; + while (True) { + if (curr == NULL) +break; + if (curr->mark) +break; +curr = curr->next; + } + + if (!curr) break; + discard_SegInfo( curr ); + + } +} + +static void discard_SegInfos_which_overlap_with ( SegInfo* siRef ) +{ + SegInfo* si; + /* Mark all the SegInfos in segInfo_list that need to be deleted. + First, clear all the mark bits; then set them if they overlap + with siRef. Since siRef itself is in this list we at least + expect its own mark bit to be set. */ + for (si = segInfo_list; si; si = si->next) { + si->mark = do_SegInfos_overlap( si, siRef ); + if (si == siRef) { + vg_assert(si->mark); + si->mark = False; + } + } + discard_marked_SegInfos(); +} + +/* Find the existing SegInfo for (memname,filename) or if not found, + create one. In the latter case memname and filename are strdup'd + into VG_AR_DINFO, and the new SegInfo is added to segInfo_list. */ +static +SegInfo* find_or_create_SegInfo_for ( UChar* filename, UChar* memname ) +{ + SegInfo* si; + vg_assert(filename); + for (si = segInfo_list; si; si = si->next) { + vg_assert(si->filename); + if (0==VG_(strcmp)(si->filename, filename) + && ( (memname && si->memname) + ? 0==VG_(strcmp)(memname, si->memname) + : True )) + break; + } + if (!si) { +
[Valgrind-developers] valgrind: r7320 - in branches/DATASYMS: callgrind coregrind coregrind/m_debuginfo exp-drd include
Author: sewardj Date: 2008-01-08 00:09:03 + (Tue, 08 Jan 2008) New Revision: 7320 Log: Rename the type SegInfo (which it just isn't) to DebugInfo, a more appropriate name. Also, rename and reorder some fields in DebugInfo. Modified: branches/DATASYMS/callgrind/bb.c branches/DATASYMS/callgrind/debug.c branches/DATASYMS/callgrind/fn.c branches/DATASYMS/callgrind/global.h branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c branches/DATASYMS/coregrind/m_debuginfo/priv_readdwarf.h branches/DATASYMS/coregrind/m_debuginfo/priv_readelf.h branches/DATASYMS/coregrind/m_debuginfo/priv_readstabs.h branches/DATASYMS/coregrind/m_debuginfo/priv_storage.h branches/DATASYMS/coregrind/m_debuginfo/readdwarf.c branches/DATASYMS/coregrind/m_debuginfo/readelf.c branches/DATASYMS/coregrind/m_debuginfo/readstabs.c branches/DATASYMS/coregrind/m_debuginfo/storage.c branches/DATASYMS/coregrind/m_redir.c branches/DATASYMS/coregrind/pub_core_redir.h branches/DATASYMS/exp-drd/drd_error.c branches/DATASYMS/exp-drd/drd_error.h branches/DATASYMS/exp-drd/drd_segment.c branches/DATASYMS/include/pub_tool_debuginfo.h [... diff too large to include ...] - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7321 - branches/DATASYMS/coregrind/m_debuginfo
Author: sewardj Date: 2008-01-08 00:36:15 + (Tue, 08 Jan 2008) New Revision: 7321 Log: ppc64-linux specific followup to r7320. Modified: branches/DATASYMS/coregrind/m_debuginfo/readelf.c Modified: branches/DATASYMS/coregrind/m_debuginfo/readelf.c === --- branches/DATASYMS/coregrind/m_debuginfo/readelf.c 2008-01-08 00:09:03 UTC (rev 7320) +++ branches/DATASYMS/coregrind/m_debuginfo/readelf.c 2008-01-08 00:36:15 UTC (rev 7321) @@ -237,9 +237,9 @@ if (!plausible && ELFXX_ST_TYPE(sym->st_info) == STT_NOTYPE && sym->st_size > 0 - && si->opd_start_avma != 0 - && sym_addr >= si->opd_start_avma - && sym_addr < si->opd_start_avma + si->opd_size) + && di->opd_avma != 0 + && sym_addr >= di->opd_avma + && sym_addr < di->opd_avma + di->opd_size) plausible = True; # endif @@ -350,7 +350,7 @@ /* Here's yet another ppc64-linux hack. Get rid of leading dot if the symbol is outside .opd. */ # if defined(VGP_ppc64_linux) - if (si->opd_avma != 0 + if (di->opd_avma != 0 && !is_in_opd && sym_name[0] == '.') { vg_assert(!(*from_opd_out)); - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7322 - trunk/coregrind/m_syswrap
Author: tom Date: 2008-01-08 13:54:43 + (Tue, 08 Jan 2008) New Revision: 7322 Log: Valid file descriptor argument to llseek system call. Modified: trunk/coregrind/m_syswrap/syswrap-linux.c Modified: trunk/coregrind/m_syswrap/syswrap-linux.c === --- trunk/coregrind/m_syswrap/syswrap-linux.c 2008-01-08 00:36:15 UTC (rev 7321) +++ trunk/coregrind/m_syswrap/syswrap-linux.c 2008-01-08 13:54:43 UTC (rev 7322) @@ -582,7 +582,10 @@ unsigned int, fd, unsigned long, offset_high, unsigned long, offset_low, vki_loff_t *, result, unsigned int, whence); - PRE_MEM_WRITE( "llseek(result)", ARG4, sizeof(vki_loff_t)); + if (!ML_(fd_allowed)(ARG1, "llseek", tid, False)) + SET_STATUS_Failure( VKI_EBADF ); + else + PRE_MEM_WRITE( "llseek(result)", ARG4, sizeof(vki_loff_t)); } POST(sys_llseek) { - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7323 - trunk/include/vki
Author: tom Date: 2008-01-08 16:10:47 + (Tue, 08 Jan 2008) New Revision: 7323 Log: Update linux system call lists based on 2.6.23.1 kernel source. Modified: trunk/include/vki/vki-scnums-amd64-linux.h trunk/include/vki/vki-scnums-ppc32-linux.h trunk/include/vki/vki-scnums-ppc64-linux.h trunk/include/vki/vki-scnums-x86-linux.h Modified: trunk/include/vki/vki-scnums-amd64-linux.h === --- trunk/include/vki/vki-scnums-amd64-linux.h 2008-01-08 13:54:43 UTC (rev 7322) +++ trunk/include/vki/vki-scnums-amd64-linux.h 2008-01-08 16:10:47 UTC (rev 7323) @@ -360,6 +360,13 @@ #define __NR_tee 276 #define __NR_sync_file_range 277 #define __NR_vmsplice 278 +#define __NR_move_pages279 +#define __NR_utimensat 280 +#define __NR_epoll_pwait 281 +#define __NR_signalfd 282 +#define __NR_timerfd 283 +#define __NR_eventfd 284 +#define __NR_fallocate 285 #endif /* __VKI_SCNUMS_AMD64_LINUX_H */ Modified: trunk/include/vki/vki-scnums-ppc32-linux.h === --- trunk/include/vki/vki-scnums-ppc32-linux.h 2008-01-08 13:54:43 UTC (rev 7322) +++ trunk/include/vki/vki-scnums-ppc32-linux.h 2008-01-08 16:10:47 UTC (rev 7323) @@ -343,8 +343,17 @@ #define __NR_faccessat 298 #define __NR_get_robust_list 299 #define __NR_set_robust_list 300 +#define __NR_move_pages301 +#define __NR_getcpu302 +#define __NR_epoll_pwait 303 +#define __NR_utimensat 304 +#define __NR_signalfd 305 +#define __NR_timerfd 306 +#define __NR_eventfd 307 +#define __NR_sync_file_range2 308 +#define __NR_fallocate 309 -#define __NR_syscalls 301 +#define __NR_syscalls 310 #endif /* __VKI_SCNUMS_PPC32_LINUX_H */ Modified: trunk/include/vki/vki-scnums-ppc64-linux.h === --- trunk/include/vki/vki-scnums-ppc64-linux.h 2008-01-08 13:54:43 UTC (rev 7322) +++ trunk/include/vki/vki-scnums-ppc64-linux.h 2008-01-08 16:10:47 UTC (rev 7323) @@ -335,6 +335,15 @@ #define __NR_faccessat 298 #define __NR_get_robust_list 299 #define __NR_set_robust_list 300 +#define __NR_move_pages301 +#define __NR_getcpu302 +#define __NR_epoll_pwait 303 +#define __NR_utimensat 304 +#define __NR_signalfd 305 +#define __NR_timerfd 306 +#define __NR_eventfd 307 +#define __NR_sync_file_range2 308 +#define __NR_fallocate 309 #endif /* __VKI_SCNUMS_PPC64_LINUX_H */ Modified: trunk/include/vki/vki-scnums-x86-linux.h === --- trunk/include/vki/vki-scnums-x86-linux.h2008-01-08 13:54:43 UTC (rev 7322) +++ trunk/include/vki/vki-scnums-x86-linux.h2008-01-08 16:10:47 UTC (rev 7323) @@ -351,7 +351,14 @@ #define __NR_sync_file_range 314 #define __NR_tee 315 #define __NR_vmsplice 316 +#define __NR_move_pages317 +#define __NR_getcpu318 +#define __NR_epoll_pwait 319 #define __NR_utimensat 320 +#define __NR_signalfd 321 +#define __NR_timerfd 322 +#define __NR_eventfd 323 +#define __NR_fallocate 324 #endif /* __VKI_SCNUMS_X86_LINUX_H */ - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7325 - in trunk: coregrind/m_aspacemgr include
Author: tom Date: 2008-01-08 16:48:30 + (Tue, 08 Jan 2008) New Revision: 7325 Log: Made the argument to VG_(am_get_filename) const as it doesn't need to be modified and the routine to find the segment for an address now returns a const pointer. Modified: trunk/coregrind/m_aspacemgr/aspacemgr-linux.c trunk/include/pub_tool_aspacemgr.h Modified: trunk/coregrind/m_aspacemgr/aspacemgr-linux.c === --- trunk/coregrind/m_aspacemgr/aspacemgr-linux.c 2008-01-08 16:31:25 UTC (rev 7324) +++ trunk/coregrind/m_aspacemgr/aspacemgr-linux.c 2008-01-08 16:48:30 UTC (rev 7325) @@ -603,7 +603,7 @@ has one. The returned name's storage cannot be assumed to be persistent, so the caller should immediately copy the name elsewhere. */ -HChar* VG_(am_get_filename)( NSegment* seg ) +HChar* VG_(am_get_filename)( NSegment const * seg ) { Int i; aspacem_assert(seg); Modified: trunk/include/pub_tool_aspacemgr.h === --- trunk/include/pub_tool_aspacemgr.h 2008-01-08 16:31:25 UTC (rev 7324) +++ trunk/include/pub_tool_aspacemgr.h 2008-01-08 16:48:30 UTC (rev 7325) @@ -137,7 +137,7 @@ extern NSegment const * VG_(am_find_nsegment) ( Addr a ); // See pub_core_aspacemgr.h for description. -extern HChar* VG_(am_get_filename)( NSegment* ); +extern HChar* VG_(am_get_filename)( NSegment const * ); // See pub_core_aspacemgr.h for description. extern Bool VG_(am_is_valid_for_client) ( Addr start, SizeT len, - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7324 - trunk/coregrind/m_syswrap
Author: tom Date: 2008-01-08 16:31:25 + (Tue, 08 Jan 2008) New Revision: 7324 Log: Add support for the sync_file_range system call. Based on patch from Russell Sears <[EMAIL PROTECTED]>. Modified: trunk/coregrind/m_syswrap/priv_syswrap-linux.h trunk/coregrind/m_syswrap/syswrap-amd64-linux.c trunk/coregrind/m_syswrap/syswrap-linux.c trunk/coregrind/m_syswrap/syswrap-x86-linux.c Modified: trunk/coregrind/m_syswrap/priv_syswrap-linux.h === --- trunk/coregrind/m_syswrap/priv_syswrap-linux.h 2008-01-08 16:10:47 UTC (rev 7323) +++ trunk/coregrind/m_syswrap/priv_syswrap-linux.h 2008-01-08 16:31:25 UTC (rev 7324) @@ -220,6 +220,9 @@ DECL_TEMPLATE(linux, sys_rt_sigqueueinfo); DECL_TEMPLATE(linux, sys_rt_sigsuspend); +// Linux-specific? +DECL_TEMPLATE(linux, sys_sync_file_range); + /* - Wrappers for sockets and ipc-ery. These are split into standalone procedures because x86-linux hides them inside multiplexors Modified: trunk/coregrind/m_syswrap/syswrap-amd64-linux.c === --- trunk/coregrind/m_syswrap/syswrap-amd64-linux.c 2008-01-08 16:10:47 UTC (rev 7323) +++ trunk/coregrind/m_syswrap/syswrap-amd64-linux.c 2008-01-08 16:31:25 UTC (rev 7324) @@ -1371,6 +1371,12 @@ // LINX_(__NR_unshare,sys_unshare), // 272 LINX_(__NR_set_robust_list, sys_set_robust_list), // 273 LINXY(__NR_get_robust_list, sys_get_robust_list), // 274 + +// LINX_(__NR_splice,sys_ni_syscall), // 275 +// LINX_(__NR_tee, sys_ni_syscall), // 276 + LINX_(__NR_sync_file_range, sys_sync_file_range), // 277 +// LINX_(__NR_vmsplice, sys_ni_syscall), // 278 +// LINX_(__NR_move_pages,sys_ni_syscall), // 279 }; const UInt ML_(syscall_table_size) = Modified: trunk/coregrind/m_syswrap/syswrap-linux.c === --- trunk/coregrind/m_syswrap/syswrap-linux.c 2008-01-08 16:10:47 UTC (rev 7323) +++ trunk/coregrind/m_syswrap/syswrap-linux.c 2008-01-08 16:31:25 UTC (rev 7324) @@ -2118,6 +2118,17 @@ POST_MEM_WRITE( ARG5, sizeof(struct vki_rusage) ); } +PRE(sys_sync_file_range) +{ + PRINT("sys_sync_file_range ( %d, %lld, %lld, %d )", + ARG1,ARG2,ARG3,ARG4); + PRE_REG_READ4(long, "sync_file_range", + int, fd, vki_loff_t, offset, vki_loff_t, nbytes, + unsigned int, flags); + if (!ML_(fd_allowed)(ARG1, "sync_file_range", tid, False)) + SET_STATUS_Failure( VKI_EBADF ); +} + /* - utime wrapper -- */ Modified: trunk/coregrind/m_syswrap/syswrap-x86-linux.c === --- trunk/coregrind/m_syswrap/syswrap-x86-linux.c 2008-01-08 16:10:47 UTC (rev 7323) +++ trunk/coregrind/m_syswrap/syswrap-x86-linux.c 2008-01-08 16:31:25 UTC (rev 7324) @@ -2216,7 +2216,15 @@ // LINX_(__NR_unshare,sys_unshare), // 310 LINX_(__NR_set_robust_list, sys_set_robust_list), // 311 LINXY(__NR_get_robust_list, sys_get_robust_list), // 312 +// LINX_(__NR_splice,sys_ni_syscall), // 313 + LINX_(__NR_sync_file_range, sys_sync_file_range), // 314 +// LINX_(__NR_tee, sys_ni_syscall), // 315 +// LINX_(__NR_vmsplice, sys_ni_syscall), // 316 +// LINX_(__NR_move_pages,sys_ni_syscall), // 317 +// LINX_(__NR_getcpu,sys_ni_syscall), // 318 +// LINX_(__NR_epoll_pwait, sys_ni_syscall), // 319 + LINX_(__NR_utimensat, sys_utimensat),// 320 }; - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7326 - branches/DATASYMS/coregrind/m_debuginfo
Author: sewardj Date: 2008-01-08 17:29:02 + (Tue, 08 Jan 2008) New Revision: 7326 Log: Fix enough stuff so that simple x86-linux programs Memcheckify OK once again. Modified: branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c branches/DATASYMS/coregrind/m_debuginfo/priv_storage.h branches/DATASYMS/coregrind/m_debuginfo/readelf.c Modified: branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c === --- branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c 2008-01-08 16:48:30 UTC (rev 7325) +++ branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c 2008-01-08 17:29:02 UTC (rev 7326) @@ -215,8 +215,9 @@ while (True) { if (curr == NULL) break; - if (start+length - 1 < curr->text_avma - || curr->text_avma + curr->text_size - 1 < start) { + if (curr->text_size > 0 + && (start+length - 1 < curr->text_avma + || curr->text_avma + curr->text_size - 1 < start)) { /* no overlap */ } else { found = True; @@ -581,6 +582,7 @@ [a, a+len). */ void VG_(di_notify_munmap)( Addr a, SizeT len ) { + if (0) VG_(printf)("DISCARD %p %p\n", a, a+len); discard_syms_in_range(a, len); } Modified: branches/DATASYMS/coregrind/m_debuginfo/priv_storage.h === --- branches/DATASYMS/coregrind/m_debuginfo/priv_storage.h 2008-01-08 16:48:30 UTC (rev 7325) +++ branches/DATASYMS/coregrind/m_debuginfo/priv_storage.h 2008-01-08 17:29:02 UTC (rev 7326) @@ -207,7 +207,7 @@ extern void ML_(ppCfiExpr)( XArray* src, Int ix ); -/* - SEGINFO - */ +/* - DEBUGINFO - */ /* This is the top-level data type. It's a structure which contains information pertaining to one mapped ELF object. This type is Modified: branches/DATASYMS/coregrind/m_debuginfo/readelf.c === --- branches/DATASYMS/coregrind/m_debuginfo/readelf.c 2008-01-08 16:48:30 UTC (rev 7325) +++ branches/DATASYMS/coregrind/m_debuginfo/readelf.c 2008-01-08 17:29:02 UTC (rev 7326) @@ -837,7 +837,7 @@ Addr dimage = 0; UWord n_dimage = 0; OffT offset_dimage = 0; - Bool debug = 1||False; + Bool debug = False; /* Image addresses for the ELF file we're working with. */ Addr oimage = 0; @@ -872,6 +872,12 @@ vg_assert(!di->strchunks); vg_assert(!di->soname); + /* If these don't hold true, it means that m_syswrap/m_aspacemgr + managed to do a mapping where the start isn't page aligned. + Which sounds pretty bogus to me. */ + vg_assert(VG_IS_PAGE_ALIGNED(di->rx_map_avma)); + vg_assert(VG_IS_PAGE_ALIGNED(di->rw_map_avma)); + /* -- Phase 1. At this point, there is very little information in the DebugInfo. We only know that something that looks like an @@ -1139,36 +1145,50 @@ goto out;\ } while (0) - /* Find avma-s for .text, .data, .opd */ + /* Find avma-s for: .text .data .bss .plt .got .opd .eh_frame */ - /* Accept .text only when mapped as rx */ + /* Accept .text where mapped as rx */ if (0 == VG_(strcmp)(name, ".text")) { - if (inrx /* && !inrw */ && size > 0 && di->text_size == 0) { + if (inrx && size > 0 && di->text_size == 0) { di->text_avma = di->rx_map_avma + foff - di->rx_map_foff; -di->text_size = size; -di->text_bias = di->text_avma - svma; +di->text_size = //di->rx_map_size; //size; +size; +di->text_bias = VG_PGROUNDDN(di->text_avma) - VG_PGROUNDDN(svma); if (debug) VG_(printf)("acquiring .text avma = %p\n", di->text_avma); } else { BAD(".text"); } - } + } - /* Accept .data only when mapped as rw */ + /* Accept .data where mapped as rw */ if (0 == VG_(strcmp)(name, ".data")) { - if (/*!inrx && */ inrw && size > 0 && di->data_size == 0) { + if (inrw && size > 0 && di->data_size == 0) { di->data_avma = di->rw_map_avma + foff - di->rw_map_foff; di->data_size = size; +di->data_bias = di->data_avma - svma; if (debug) VG_(printf)("acquiring .data avma = %p\n", di->data_avma); } else { BAD(".data"); } - } + } - /* Accept .opd only when mapped as rw */ + /* Accept .bss where mapped as rw */ + if (0 == VG_(strcmp)(name, ".bss")) { + if (inrw && size > 0 && di->bss_size == 0) { +di->bss_avma = di->rw_map_avma + foff - di->rw_map_foff; +
[Valgrind-developers] valgrind: r7327 - trunk/coregrind/m_debuginfo
Author: tom Date: 2008-01-08 17:44:04 + (Tue, 08 Jan 2008) New Revision: 7327 Log: If we don't find the address in the segInfo list that ask the address space manager for the name of the file it was mapped from as a fallback solution. This allows us to print the names of exe/dll files in the stack trace when running programs under wine. Modified: trunk/coregrind/m_debuginfo/debuginfo.c Modified: trunk/coregrind/m_debuginfo/debuginfo.c === --- trunk/coregrind/m_debuginfo/debuginfo.c 2008-01-08 17:29:02 UTC (rev 7326) +++ trunk/coregrind/m_debuginfo/debuginfo.c 2008-01-08 17:44:04 UTC (rev 7327) @@ -659,6 +659,8 @@ { Int used; SegInfo* si; + const NSegment *seg; + HChar* filename; vg_assert(nbuf > 0); for (si = segInfo_list; si != NULL; si = si->next) { @@ -680,6 +682,12 @@ return True; } } + if ((seg = VG_(am_find_nsegment(a))) != NULL && + (filename = VG_(am_get_filename)(seg)) != NULL) + { + VG_(strncpy_safely)(buf, filename, nbuf); + return True; + } return False; } - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7328 - branches/DATASYMS/coregrind/m_debuginfo
Author: sewardj Date: 2008-01-08 23:59:03 + (Tue, 08 Jan 2008) New Revision: 7328 Log: A lot more tidying up. Make x86-linux work again. Modified: branches/DATASYMS/coregrind/m_debuginfo/readelf.c Modified: branches/DATASYMS/coregrind/m_debuginfo/readelf.c === --- branches/DATASYMS/coregrind/m_debuginfo/readelf.c 2008-01-08 17:44:04 UTC (rev 7327) +++ branches/DATASYMS/coregrind/m_debuginfo/readelf.c 2008-01-08 23:59:03 UTC (rev 7328) @@ -833,16 +833,16 @@ Bool res, ok; SysResfd, sres; Word i; - OffT offset_oimage = 0; - Addr dimage = 0; - UWord n_dimage = 0; - OffT offset_dimage = 0; Bool debug = False; /* Image addresses for the ELF file we're working with. */ Addr oimage = 0; UWord n_oimage = 0; + /* Ditto for any ELF debuginfo file that we might happen to load. */ + Addr dimage = 0; + UWord n_dimage = 0; + /* ELF header for the main file. Should == oimage since is at start of file. */ ElfXX_Ehdr* ehdr_img = NULL; @@ -1007,9 +1007,8 @@ vg_assert(di->soname == NULL); { -//zz Bool offset_set = False; ElfXX_Addr prev_addr = 0; - Addr baseaddr = 0; + Addr baseaddr = 0; for (i = 0; i < phdr_nent; i++) { ElfXX_Phdr* phdr = INDEX_BIS( phdr_img, i, phdr_ent_szB ); @@ -1147,12 +1146,11 @@ /* Find avma-s for: .text .data .bss .plt .got .opd .eh_frame */ - /* Accept .text where mapped as rx */ + /* Accept .text where mapped as rx (code) */ if (0 == VG_(strcmp)(name, ".text")) { if (inrx && size > 0 && di->text_size == 0) { di->text_avma = di->rx_map_avma + foff - di->rx_map_foff; -di->text_size = //di->rx_map_size; //size; -size; +di->text_size = size; di->text_bias = VG_PGROUNDDN(di->text_avma) - VG_PGROUNDDN(svma); if (debug) VG_(printf)("acquiring .text avma = %p\n", di->text_avma); @@ -1161,7 +1159,7 @@ } } - /* Accept .data where mapped as rw */ + /* Accept .data where mapped as rw (data) */ if (0 == VG_(strcmp)(name, ".data")) { if (inrw && size > 0 && di->data_size == 0) { di->data_avma = di->rw_map_avma + foff - di->rw_map_foff; @@ -1174,7 +1172,7 @@ } } - /* Accept .bss where mapped as rw */ + /* Accept .bss where mapped as rw (data) */ if (0 == VG_(strcmp)(name, ".bss")) { if (inrw && size > 0 && di->bss_size == 0) { di->bss_avma = di->rw_map_avma + foff - di->rw_map_foff; @@ -1186,7 +1184,31 @@ } } - /* Accept .opd where mapped as rw */ + /* Accept .got where mapped as rw (data) */ + if (0 == VG_(strcmp)(name, ".got")) { + if (inrw && size > 0 && di->got_size == 0) { +di->got_avma = di->rw_map_avma + foff - di->rw_map_foff; +di->got_size = size; +if (debug) + VG_(printf)("acquiring .got avma = %p\n", di->got_avma); + } else { +BAD(".got"); + } + } + + /* Accept .plt where mapped as rx (code) */ + if (0 == VG_(strcmp)(name, ".plt")) { + if (inrx && size > 0 && di->plt_size == 0) { +di->plt_avma = di->rx_map_avma + foff - di->rx_map_foff; +di->plt_size = size; +if (debug) + VG_(printf)("acquiring .plt avma = %p\n", di->plt_avma); + } else { +BAD(".plt"); + } + } + + /* Accept .opd where mapped as rw (data) */ if (0 == VG_(strcmp)(name, ".opd")) { if (inrw && size > 0 && di->opd_size == 0) { di->opd_avma = di->rw_map_avma + foff - di->rw_map_foff; @@ -1198,10 +1220,10 @@ } } - /* Accept .eh_frame where mapped as rx */ + /* Accept .eh_frame where mapped as rx (code) (?!) */ if (0 == VG_(strcmp)(name, ".eh_frame")) { if (inrx && size > 0 && di->ehframe_size == 0) { -di->ehframe_avma = VG_PGROUNDDN(di->rx_map_avma + foff - di->rx_map_foff); +di->ehframe_avma = di->rx_map_avma + foff - di->rx_map_foff; di->ehframe_size = size; if (debug) VG_(printf)("acquiring .eh_frame avma = %p\n", di->ehframe_avma); @@ -1236,13 +1258,14 @@ /* Find interesting sections, read the symbol table(s), read any debug information */ { - /* IMAGE addresses: pointers to start of sections (in the - oimage, not in the running image) -- image addresses */ + /* IMAGE addresses: pointers to start of sections in the + transiently loaded oimage, not in the fragments of the file + mapped in by the guest's dynamic linker. */ UChar* strtab_img = NULL;
[Valgrind-developers] valgrind: r7329 - branches/DATASYMS/coregrind/m_debuginfo
Author: sewardj Date: 2008-01-09 14:50:32 + (Wed, 09 Jan 2008) New Revision: 7329 Log: * unbreak soname reading; make the logic more clearly like that of GNU readelf * unbreak ELF symbol table reading on ppc32/64-linux * tidy up read_elf_symtab__{ppc64_linux,normal} - get rid of redundant parameters, and use the _img/_svma/_avma/_bias naming scheme consistently * change lots of tabs to spaces Modified: branches/DATASYMS/coregrind/m_debuginfo/readelf.c Modified: branches/DATASYMS/coregrind/m_debuginfo/readelf.c === --- branches/DATASYMS/coregrind/m_debuginfo/readelf.c 2008-01-08 23:59:03 UTC (rev 7328) +++ branches/DATASYMS/coregrind/m_debuginfo/readelf.c 2008-01-09 14:50:32 UTC (rev 7329) @@ -196,8 +196,8 @@ ElfXX_Sym* sym,/* ELF symbol */ Char* sym_name, /* name */ Addr sym_addr, /* declared address */ -UChar* opd_filea, /* oimage of .opd sec (ppc64-linux only) */ -OffT opd_offset, /* base address assumed in oimage */ +UChar* opd_img,/* oimage of .opd sec (ppc64-linux only) */ +OffT opd_bias, /* for biasing AVMAs found in .opd */ /* OUTPUTS */ Char** sym_name_out, /* name we should record */ Addr* sym_addr_out, /* addr we should record */ @@ -299,8 +299,8 @@ Intoffset_in_opd; ULong* fn_descr; - if (0) VG_(printf)("opdXXX: opd_offset %p, sym_addr %p\n", - (void*)(opd_offset), (void*)sym_addr); + if (0) VG_(printf)("opdXXX: opd_bias %p, sym_addr %p\n", + (void*)(opd_bias), (void*)sym_addr); if (!VG_IS_8_ALIGNED(sym_addr)) { TRACE_SYMTAB("ignore -- not 8-aligned: %s\n", sym_name); @@ -320,22 +320,26 @@ /* Now we want to know what's at that offset in the .opd section. We can't look in the running image since it won't necessarily have been mapped. But we can consult the oimage. - opd_filea is the start address of the .opd in the oimage. + opd_img is the start address of the .opd in the oimage. Hence: */ - fn_descr = (ULong*)(opd_filea + offset_in_opd); + fn_descr = (ULong*)(opd_img + offset_in_opd); if (0) VG_(printf)("opdXXY: offset %d, fn_descr %p\n", offset_in_opd, fn_descr); if (0) VG_(printf)("opdXXZ: *fn_descr %p\n", (void*)(fn_descr[0])); - /* opd_offset is the difference between di->start (where the - library got mapped) and the address space used for addresses - within the library file. */ - - sym_addr= fn_descr[0] + opd_offset; + /* opd_bias is the what we have to add to SVMAs found in .opd to + get plausible .text AVMAs for the entry point, and .data + AVMAs (presumably) for the TOC locations. We use the caller + supplied value (which is di->text_bias) for both of these. + Not sure why that is correct - it seems to work, and sounds + OK for fn_descr[0], but surely we need to use the data bias + and not the text bias for fn_descr[1] ? Oh Well. + */ + sym_addr= fn_descr[0] + opd_bias; *sym_addr_out = sym_addr; - *sym_tocptr_out = fn_descr[1] + opd_offset; + *sym_tocptr_out = fn_descr[1] + opd_bias; *from_opd_out = True; is_in_opd = True; @@ -391,12 +395,12 @@ __attribute__((unused)) /* not referred to on all targets */ void read_elf_symtab__normal( struct _DebugInfo* di, UChar* tab_name, -ElfXX_Sym* o_symtab, UInt o_symtab_sz, OffT o_symtab_offset, -UChar* o_strtab, UInt o_strtab_sz, -UChar* opd_filea, OffT opd_offset /* ppc64-linux only */ +ElfXX_Sym* symtab_img, SizeT symtab_szB, +UChar* strtab_img, SizeT strtab_szB, +UChar* opd_img /* ppc64-linux only */ ) { - Inti; + Word i; Addr sym_addr, sym_addr_really; Char *sym_name, *sym_name_really; Intsym_size; @@ -405,7 +409,7 @@ DiSym risym; ElfXX_Sym *sym; - if (o_strtab == NULL || o_symtab == NULL) { + if (strtab_img == NULL || symtab_img == NULL) { Char buf[80]; vg_assert(VG_(strlen)(tab_name) < 40); VG_(sprintf)(buf, " object doesn't have a %s", tab_name); @@ -414,20 +418,20 @@ } TRACE_SYMTAB("\nReading (ELF, standard) %s (%d entries)\n", tab_name, -o_symtab_sz/sizeof(ElfXX_Sym) ); +symtab_szB/sizeof(ElfXX_Sym) ); /* Perhaps should start at i = 1; ELF docs suggest that entry 0 always denotes 'unknown symbol'. */ - for (i = 1; i < (Int)(o_symtab_sz/sizeof(ElfXX_Sym)); i++) { - sym = & o_symtab[i]; - sym_name = (Char*)(o_strtab + sym->st_name); - sym_addr = o_symtab_offset + sym->st_value; + for (i = 1; i < (Word)(symtab_
[Valgrind-developers] valgrind: r7330 - branches/DATASYMS/coregrind/m_debuginfo
Author: sewardj Date: 2008-01-09 17:51:55 + (Wed, 09 Jan 2008) New Revision: 7330 Log: Fix more ppc64-linux regressions, and improve reporting of errors that occur when reading symbol table or debug info from files. Modified: branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c branches/DATASYMS/coregrind/m_debuginfo/priv_storage.h branches/DATASYMS/coregrind/m_debuginfo/readdwarf.c branches/DATASYMS/coregrind/m_debuginfo/readelf.c branches/DATASYMS/coregrind/m_debuginfo/storage.c Modified: branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c === --- branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c 2008-01-09 14:50:32 UTC (rev 7329) +++ branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c 2008-01-09 17:51:55 UTC (rev 7330) @@ -451,14 +451,14 @@ VG_(memset)(buf1k, 0, sizeof(buf1k)); fd = VG_(open)( filename, VKI_O_RDONLY, 0 ); if (fd.isError) { - ML_(symerr)("can't open file to inspect ELF header"); + ML_(symerr)(NULL, True, "can't open file to inspect ELF header"); return; } nread = VG_(read)( fd.res, buf1k, sizeof(buf1k) ); VG_(close)( fd.res ); if (nread <= 0) { - ML_(symerr)("can't read file to inspect ELF header"); + ML_(symerr)(NULL, True, "can't read file to inspect ELF header"); return; } vg_assert(nread > 0 && nread <= sizeof(buf1k) ); Modified: branches/DATASYMS/coregrind/m_debuginfo/priv_storage.h === --- branches/DATASYMS/coregrind/m_debuginfo/priv_storage.h 2008-01-09 14:50:32 UTC (rev 7329) +++ branches/DATASYMS/coregrind/m_debuginfo/priv_storage.h 2008-01-09 17:51:55 UTC (rev 7330) @@ -371,8 +371,10 @@ /* -- Misc -- */ /* Show a non-fatal debug info reading error. Use vg_panic if - terminal. */ -extern void ML_(symerr) ( HChar* msg ); + terminal. 'serious' errors are always shown, not 'serious' ones + are shown only at verbosity level 2 and above. */ +extern +void ML_(symerr) ( struct _DebugInfo* di, Bool serious, HChar* msg ); /* Print a symbol. */ extern void ML_(ppSym) ( Int idx, DiSym* sym ); Modified: branches/DATASYMS/coregrind/m_debuginfo/readdwarf.c === --- branches/DATASYMS/coregrind/m_debuginfo/readdwarf.c 2008-01-09 14:50:32 UTC (rev 7329) +++ branches/DATASYMS/coregrind/m_debuginfo/readdwarf.c 2008-01-09 17:51:55 UTC (rev 7330) @@ -497,7 +497,8 @@ /* Check the length of the block. */ if (info.li_length > noLargerThan) { - ML_(symerr)("DWARF line info appears to be corrupt " + ML_(symerr)(di, True, + "DWARF line info appears to be corrupt " "- the section is too small"); goto out; } @@ -510,7 +511,8 @@ (Int)info.li_version); if (info.li_version != 2) { - ML_(symerr)("Only DWARF version 2 line info " + ML_(symerr)(di, True, + "Only DWARF version 2 line info " "is currently supported."); goto out; } @@ -642,7 +644,8 @@ VG_(printf)("\n"); if (*data != 0) { - ML_(symerr)("can't find NUL at end of DWARF2 directory table"); + ML_(symerr)(di, True, + "can't find NUL at end of DWARF2 directory table"); goto out; } data ++; @@ -683,7 +686,8 @@ VG_(printf)("\n"); if (*data != 0) { - ML_(symerr)("can't find NUL at end of DWARF2 file name table"); + ML_(symerr)(di, True, + "can't find NUL at end of DWARF2 file name table"); goto out; } data ++; @@ -1132,7 +1136,8 @@ /* Make sure we at least have a header for the first block */ if (debug_info_sz < 4) { - ML_(symerr)( "Last block truncated in .debug_info; ignoring" ); + ML_(symerr)( di, True, + "Last block truncated in .debug_info; ignoring" ); return; } @@ -1146,14 +1151,16 @@ blklen = read_initial_length_field( block_img, &blklen_is_64 ); blklen_len = blklen_is_64 ? 12 : 4; if ( block_img + blklen + blklen_len > end_img ) { - ML_(symerr)( "Last block truncated in .debug_info; ignoring" ); + ML_(symerr)( di, True, + "Last block truncated in .debug_info; ignoring" ); return; } /* version should be 2 */ ver = *((UShort*)( block_img + blklen_len )); if ( ver != 2 ) { - ML_(symerr)( "Ignoring non-dwarf2 block in .debug_info" ); + ML_(symerr)( di, True, + "Ignoring non-dwarf2 block in .debug_info" ); continue; } Modified: branches/DATASYMS/coregrind/m_debuginfo/readelf.c === --- branches/DATASYMS/coregrind/m_debuginfo/readelf.c 2008-01-09 14:50:32 UTC (rev 7329) +++ branches/DATASYMS/coregrind
[Valgrind-developers] valgrind: r7331 - in trunk: coregrind include
Author: sewardj Date: 2008-01-09 18:37:41 + (Wed, 09 Jan 2008) New Revision: 7331 Log: Move VG_(clo_backtrace_size) to a tool-visible header file. Modified: trunk/coregrind/pub_core_options.h trunk/include/pub_tool_options.h Modified: trunk/coregrind/pub_core_options.h === --- trunk/coregrind/pub_core_options.h 2008-01-09 17:51:55 UTC (rev 7330) +++ trunk/coregrind/pub_core_options.h 2008-01-09 18:37:41 UTC (rev 7331) @@ -131,8 +131,6 @@ /* Display gory details for the k'th most popular error. default: Infinity. */ extern Int VG_(clo_dump_error); -/* Number of parents of a backtrace. Default: 8. */ -extern Int VG_(clo_backtrace_size); /* Engage miscellaneous weird hacks needed for some progs. */ extern Char* VG_(clo_sim_hints); /* Show symbols in the form 'name+offset' ? Default: NO */ Modified: trunk/include/pub_tool_options.h === --- trunk/include/pub_tool_options.h2008-01-09 17:51:55 UTC (rev 7330) +++ trunk/include/pub_tool_options.h2008-01-09 18:37:41 UTC (rev 7331) @@ -116,6 +116,9 @@ less aggressively if that is needed (callgrind needs this). */ extern VexControl VG_(clo_vex_control); +/* Number of parents of a backtrace. Default: 8. */ +extern Int VG_(clo_backtrace_size); + /* Call this if a recognised option was bad for some reason. Note: don't use it just because an option was unrecognised -- return 'False' from VG_(tdict).tool_process_cmd_line_option) to indicate - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7333 - trunk/docs/internals
Author: sewardj Date: 2008-01-09 21:19:44 + (Wed, 09 Jan 2008) New Revision: 7333 Log: Start a bug-tracking file for the 3.3 line. Added: trunk/docs/internals/3_3_BUGSTATUS.txt Modified: trunk/docs/internals/Makefile.am Added: trunk/docs/internals/3_3_BUGSTATUS.txt === --- trunk/docs/internals/3_3_BUGSTATUS.txt (rev 0) +++ trunk/docs/internals/3_3_BUGSTATUS.txt 2008-01-09 21:19:44 UTC (rev 7333) @@ -0,0 +1,26 @@ + +-- Legend -- + +n-i-bz = not in bugzilla +pending = is scheduled to be fixed (or at least considered) on this branch +wontfix = will not fix on this branch +many= fix composed of many commits +WF = waiting for feedback from bug reporter + +PRI: 33 = fix this for 3.3.1 + Vfd = fix has been verified on 3.3.X branch + + +-- Bugs reported after (in) 3.3.0 -- + +TRUNK 33BRANCH PRIBUG# WHAT + +r7299 pending33 n-i-bz stupid sizeof bug in Helgrind +r7322 pending33 n-i-bz check fd on sys_llseek +r7323 pending33 n-i-bz update syscall lists to kernel 2.6.23.1 +r7324 pending33 n-i-bz support sys_sync_file_range + +vx1807 pending33 155011 vex x86->IR: 0xCF (iret) + +pending pending33 155091 Warning [...] unhandled DW_OP_ opcode 0x23 + (patch proposed, waiting for feedback) Modified: trunk/docs/internals/Makefile.am === --- trunk/docs/internals/Makefile.am2008-01-09 21:03:43 UTC (rev 7332) +++ trunk/docs/internals/Makefile.am2008-01-09 21:19:44 UTC (rev 7333) @@ -1,5 +1,6 @@ EXTRA_DIST = \ 3_0_BUGSTATUS.txt 3_1_BUGSTATUS.txt \ + 3_2_BUGSTATUS.txt 3_3_BUGSTATUS.txt \ darwin-notes.txt darwin-syscalls.txt \ directory-structure.txt \ m_replacemalloc.txt \ - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7332 - in trunk: . nightly/bin
Author: sewardj Date: 2008-01-09 21:03:43 + (Wed, 09 Jan 2008) New Revision: 7332 Log: Make a new regtest target, "all-regtest", being the union of "make regtest" and "make exp-regtest". Then change the nightly build system to run all-regtest instead of exp-regtest. Modified: trunk/Makefile.am trunk/nightly/bin/nightly Modified: trunk/Makefile.am === --- trunk/Makefile.am 2008-01-09 18:37:41 UTC (rev 7331) +++ trunk/Makefile.am 2008-01-09 21:03:43 UTC (rev 7332) @@ -70,6 +70,8 @@ @PERL@ tests/vg_regtest $(TOOLS) exp-regtest: check @PERL@ tests/vg_regtest $(EXP_TOOLS) +all-regtest: check + @PERL@ tests/vg_regtest $(TOOLS) $(EXP_TOOLS) ## Preprend @PERL@ because tests/vg_per isn't executable perf: check Modified: trunk/nightly/bin/nightly === --- trunk/nightly/bin/nightly 2008-01-09 18:37:41 UTC (rev 7331) +++ trunk/nightly/bin/nightly 2008-01-09 21:03:43 UTC (rev 7332) @@ -97,7 +97,7 @@ \ runcmd $logfile \ "Running regression tests " \ - "cd valgrind && make regtest" + "cd valgrind && make all-regtest" # Grab some indicative text for the short log file -- if the regtests # succeeded, show their results. If we didn't make it that far, show the - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7334 - trunk/coregrind/m_syswrap
Author: sewardj Date: 2008-01-09 22:01:40 + (Wed, 09 Jan 2008) New Revision: 7334 Log: Enable some syscalls needed to run firefox on 64-bit ppc on Fedora 8. Modified: trunk/coregrind/m_syswrap/syswrap-ppc64-linux.c Modified: trunk/coregrind/m_syswrap/syswrap-ppc64-linux.c === --- trunk/coregrind/m_syswrap/syswrap-ppc64-linux.c 2008-01-09 21:19:44 UTC (rev 7333) +++ trunk/coregrind/m_syswrap/syswrap-ppc64-linux.c 2008-01-09 22:01:40 UTC (rev 7334) @@ -1269,7 +1269,7 @@ GENXY(__NR_wait4, sys_wait4), // 114 // _(__NR_swapoff, sys_swapoff),// 115 -// _(__NR_sysinfo, sys_sysinfo),// 116 + LINXY(__NR_sysinfo, sys_sysinfo),// 116 PLAXY(__NR_ipc, sys_ipc),// 117 GENX_(__NR_fsync, sys_fsync), // 118 // _(__NR_sigreturn, sys_sigreturn), // 119 @@ -1328,13 +1328,13 @@ GENX_(__NR_mremap,sys_mremap), // 163 // _(__NR_setresuid, sys_setresuid), // 164 -// _(__NR_getresuid, sys_getresuid), // 165 + LINXY(__NR_getresuid, sys_getresuid), // 165 // _(__NR_query_module, sys_query_module), // 166 GENXY(__NR_poll, sys_poll), // 167 // _(__NR_nfsservctl,sys_nfsservctl), // 168 // _(__NR_setresgid, sys_setresgid), // 169 -// _(__NR_getresgid, sys_getresgid), // 170 + LINXY(__NR_getresgid, sys_getresgid), // 170 // _(__NR_prctl, sys_prctl), // 171 PLAX_(__NR_rt_sigreturn, sys_rt_sigreturn), // 172 LINXY(__NR_rt_sigaction, sys_rt_sigaction), // 173 - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7335 - in branches/DATASYMS: coregrind/m_debuginfo include
Author: sewardj Date: 2008-01-09 22:53:42 + (Wed, 09 Jan 2008) New Revision: 7335 Log: Now that the infrastructure behind it is straightened out a bit, fix VG_(seginfo_sect_kind) accordingly. Modified: branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c branches/DATASYMS/include/pub_tool_debuginfo.h Modified: branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c === --- branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c 2008-01-09 22:01:40 UTC (rev 7334) +++ branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c 2008-01-09 22:53:42 UTC (rev 7335) @@ -1455,38 +1455,46 @@ VgSectKind VG_(seginfo_sect_kind)(Addr a) { DebugInfo* di; - VgSectKind ret = Vg_SectUnknown; for (di = debugInfo_list; di != NULL; di = di->next) { - if (a >= di->text_avma - && a < di->text_avma + di->text_size) { -if (0) - VG_(printf)( - "addr=%p di=%p %s got=%p %ld plt=%p %ld data=%p %ld bss=%p %ld\n", - a, di, di->filename, - di->got_avma, di->got_size, - di->plt_avma, di->plt_size, - di->data_avma, di->data_size, - di->bss_avma, di->bss_size); + if (0) + VG_(printf)( +"addr=%p di=%p %s got=%p,%ld plt=%p,%ld data=%p,%ld bss=%p,%ld\n", +a, di, di->filename, +di->got_avma, di->got_size, +di->plt_avma, di->plt_size, +di->data_avma, di->data_size, +di->bss_avma, di->bss_size); -ret = Vg_SectText; + if (di->text_size > 0 + && a >= di->text_avma && a < di->text_avma + di->text_size) + return Vg_SectText; -if (a >= di->data_avma && a < di->data_avma + di->data_size) - ret = Vg_SectData; -else - if (a >= di->bss_avma && a < di->bss_avma + di->bss_size) - ret = Vg_SectBSS; -else - if (a >= di->plt_avma && a < di->plt_avma + di->plt_size) - ret = Vg_SectPLT; -else - if (a >= di->got_avma && a < di->got_avma + di->got_size) - ret = Vg_SectGOT; - } + if (di->data_size > 0 + && a >= di->data_avma && a < di->data_avma + di->data_size) + return Vg_SectData; + + if (di->bss_size > 0 + && a >= di->bss_avma && a < di->bss_avma + di->bss_size) + return Vg_SectBSS; + + if (di->plt_size > 0 + && a >= di->plt_avma && a < di->plt_avma + di->plt_size) + return Vg_SectPLT; + + if (di->got_size > 0 + && a >= di->got_avma && a < di->got_avma + di->got_size) + return Vg_SectGOT; + + if (di->opd_size > 0 + && a >= di->opd_avma && a < di->opd_avma + di->opd_size) + return Vg_SectOPD; + + /* we could also check for .eh_frame, if anyone really cares */ } - return ret; + return Vg_SectUnknown; } Char* VG_(seginfo_sect_kind_name)(Addr a, Char* buf, UInt n_buf) @@ -1510,6 +1518,9 @@ case Vg_SectPLT: VG_(snprintf)(buf, n_buf, "PLT"); break; + case Vg_SectOPD: + VG_(snprintf)(buf, n_buf, "OPD"); + break; default: vg_assert(0); } Modified: branches/DATASYMS/include/pub_tool_debuginfo.h === --- branches/DATASYMS/include/pub_tool_debuginfo.h 2008-01-09 22:01:40 UTC (rev 7334) +++ branches/DATASYMS/include/pub_tool_debuginfo.h 2008-01-09 22:53:42 UTC (rev 7335) @@ -130,7 +130,8 @@ Vg_SectData, Vg_SectBSS, Vg_SectGOT, - Vg_SectPLT + Vg_SectPLT, + Vg_SectOPD } VgSectKind; - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7336 - branches/DATASYMS/coregrind/m_debuginfo
Author: sewardj Date: 2008-01-10 14:31:54 + (Thu, 10 Jan 2008) New Revision: 7336 Log: * enable reading of ELF data symbols by default * add new field .isText to DiSym structure * improve debug printing Modified: branches/DATASYMS/coregrind/m_debuginfo/priv_storage.h branches/DATASYMS/coregrind/m_debuginfo/readelf.c branches/DATASYMS/coregrind/m_debuginfo/readxcoff.c Modified: branches/DATASYMS/coregrind/m_debuginfo/priv_storage.h === --- branches/DATASYMS/coregrind/m_debuginfo/priv_storage.h 2008-01-09 22:53:42 UTC (rev 7335) +++ branches/DATASYMS/coregrind/m_debuginfo/priv_storage.h 2008-01-10 14:31:54 UTC (rev 7336) @@ -50,8 +50,9 @@ struct { Addr addr; /* lowest address of entity */ Addr tocptr; /* ppc64-linux only: value that R2 should have */ + UChar *name; /* name */ UInt size; /* size in bytes */ - UChar *name; /* name */ + Bool isText; } DiSym; Modified: branches/DATASYMS/coregrind/m_debuginfo/readelf.c === --- branches/DATASYMS/coregrind/m_debuginfo/readelf.c 2008-01-09 22:53:42 UTC (rev 7335) +++ branches/DATASYMS/coregrind/m_debuginfo/readelf.c 2008-01-10 14:31:54 UTC (rev 7336) @@ -139,7 +139,7 @@ static void show_raw_elf_symbol ( Int i, - ElfXX_Sym* sym, Char* sym_name, Addr sym_addr, + ElfXX_Sym* sym, Char* sym_name, Addr sym_svma, Bool ppc64_linux_format ) { HChar* space = ppc64_linux_format ? " " : ""; @@ -162,8 +162,8 @@ case STT_HIPROC: VG_(printf)("hip "); break; default: VG_(printf)("??? "); break; } - VG_(printf)(": val %010p, %ssz %4d %s\n", - sym_addr, space, sym->st_size, + VG_(printf)(": svma %010p, %ssz %4d %s\n", + sym_svma, space, sym->st_size, ( sym->st_name ? sym_name : (Char*)"NONAME" ) ); } @@ -173,6 +173,12 @@ this is straightforward - the name, address, size are copied out unchanged. + There is a bit of a kludge re data symbols (see KLUDGED BSS CHECK + below): we assume that the .bss is mapped immediately after .data, + and so accept any data symbol which exists in the range [start of + .data, size of .data + size of .bss). I don't know if this is + really correct/justifiable, or not. + For ppc64-linux it's more complex. If the symbol is seen to be in the .opd section, it is taken to be a function descriptor, and so a dereference is attempted, in order to get hold of the real entry @@ -195,24 +201,26 @@ struct _DebugInfo* di, /* containing DebugInfo */ ElfXX_Sym* sym,/* ELF symbol */ Char* sym_name, /* name */ -Addr sym_addr, /* declared address */ +Addr sym_svma, /* address as stated in the object file */ UChar* opd_img,/* oimage of .opd sec (ppc64-linux only) */ OffT opd_bias, /* for biasing AVMAs found in .opd */ /* OUTPUTS */ Char** sym_name_out, /* name we should record */ -Addr* sym_addr_out, /* addr we should record */ +Addr* sym_avma_out, /* addr we should record */ Int* sym_size_out, /* symbol size */ Addr* sym_tocptr_out, /* ppc64-linux only: R2 value to be used on entry */ -Bool* from_opd_out/* ppc64-linux only: did we deref an - .opd entry? */ +Bool* from_opd_out, /* ppc64-linux only: did we deref an + .opd entry? */ +Bool* is_text_out /* is this a text symbol? */ ) { Bool plausible, is_in_opd; /* Set defaults */ *sym_name_out = sym_name; - *sym_addr_out = sym_addr; + *sym_avma_out = sym_svma; /* we will bias this shortly */ + *is_text_out= True; *sym_size_out = (Int)sym->st_size; *sym_tocptr_out = 0; /* unknown/inapplicable */ *from_opd_out = False; @@ -226,20 +234,29 @@ ) && (ELFXX_ST_TYPE(sym->st_info) == STT_FUNC - || (VG_(needs).data_syms - && ELFXX_ST_TYPE(sym->st_info) == STT_OBJECT) + || ELFXX_ST_TYPE(sym->st_info) == STT_OBJECT ); + /* Now bias sym_avma_out accordingly */ + if (ELFXX_ST_TYPE(sym->st_info) == STT_OBJECT) { + *is_text_out = False; + *sym_avma_out += di->data_bias; + } else { + *is_text_out = True; + *sym_avma_out += di->text_bias; + } + # if defined(VGP_ppc64_linux) /* Allow STT_NOTYPE in the very special case where we're running on ppc64-linux and the symbol is one which the .opd-chasing hack below will chase. */ if (!plausible + && *is_text_out && ELFXX_ST_TYPE(sym->st_info) == STT_NOTYPE
[Valgrind-developers] valgrind: r7337 - in branches/DATASYMS: coregrind coregrind/m_debuginfo exp-drd include memcheck
Author: sewardj Date: 2008-01-10 17:54:50 + (Thu, 10 Jan 2008) New Revision: 7337 Log: Push data-symbol awareness through to the debuginfo query machinery in debuginfo.c, and connect Memcheck's describe-an-address device to it. This makes Memcheck able to issue errors like this Uninitialised byte(s) found during client check request at 0x4005FE: croak (dsyms2.c:23) by 0x40066D: main (dsyms2.c:49) Address 0x601043 is 7 bytes inside global var "global_i2" Not terribly useful, but it's a start. Modified: branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c branches/DATASYMS/coregrind/m_debuginfo/priv_storage.h branches/DATASYMS/coregrind/m_debuginfo/storage.c branches/DATASYMS/coregrind/m_redir.c branches/DATASYMS/exp-drd/drd_error.c branches/DATASYMS/include/pub_tool_debuginfo.h branches/DATASYMS/memcheck/mc_main.c Modified: branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c === --- branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c 2008-01-10 14:31:54 UTC (rev 7336) +++ branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c 2008-01-10 17:54:50 UTC (rev 7337) @@ -680,22 +680,42 @@ /* Search all symtabs that we know about to locate ptr. If found, set *pdi to the relevant DebugInfo, and *symno to the symtab entry - *number within that. If not found, *psi is set to NULL. */ + *number within that. If not found, *psi is set to NULL. + If findText==True, only text symbols are searched for. + If findText==False, only data symbols are searched for. +*/ static void search_all_symtabs ( Addr ptr, /*OUT*/DebugInfo** pdi, /*OUT*/Int* symno, - Bool match_anywhere_in_fun ) + Bool match_anywhere_in_sym, + Bool findText ) { Intsno; DebugInfo* di; + Bool inRange; + for (di = debugInfo_list; di != NULL; di = di->next) { - if (di->text_avma <= ptr - && ptr < di->text_avma + di->text_size) { - sno = ML_(search_one_symtab) ( di, ptr, match_anywhere_in_fun ); - if (sno == -1) goto not_found; - *symno = sno; - *pdi = di; - return; + + if (findText) { + inRange = di->text_size > 0 + && di->text_avma <= ptr + && ptr < di->text_avma + di->text_size; + } else { + inRange = di->data_size > 0 + && di->data_avma <= ptr + && ptr < di->data_avma + di->data_size + di->bss_size; } + + /* Note this short-circuit check relies on the assumption that + .bss is mapped immediately after .data. */ + if (!inRange) continue; + + sno = ML_(search_one_symtab) ( + di, ptr, match_anywhere_in_sym, findText ); + if (sno == -1) goto not_found; + *symno = sno; + *pdi = di; + return; + } not_found: *pdi = NULL; @@ -729,16 +749,19 @@ plausible symbol name. Returns False if no idea; otherwise True. Caller supplies buf and nbuf. If demangle is False, don't do demangling, regardless of VG_(clo_demangle) -- probably because the - call has come from VG_(get_fnname_nodemangle)(). */ + call has come from VG_(get_fnname_nodemangle)(). findText + indicates whether we're looking for a text symbol or a data symbol + -- caller must choose one kind or the other. */ static -Bool get_fnname ( Bool demangle, Addr a, Char* buf, Int nbuf, - Bool match_anywhere_in_fun, Bool show_offset) +Bool get_sym_name ( Bool demangle, Addr a, Char* buf, Int nbuf, +Bool match_anywhere_in_sym, Bool show_offset, +Bool findText, /*OUT*/OffT* offsetP ) { DebugInfo* di; Intsno; Intoffset; - search_all_symtabs ( a, &di, &sno, match_anywhere_in_fun ); + search_all_symtabs ( a, &di, &sno, match_anywhere_in_sym, findText ); if (di == NULL) return False; if (demangle) { @@ -749,6 +772,8 @@ } offset = a - di->symtab[sno].addr; + if (offsetP) *offsetP = (OffT)offset; + if (show_offset && offset != 0) { Char buf2[12]; Char*symend = buf + VG_(strlen)(buf); @@ -777,7 +802,9 @@ DebugInfo* si; Intsno; search_all_symtabs ( guest_code_addr, -&si, &sno, True/*match_anywhere_in_fun*/ ); +&si, &sno, +True/*match_anywhere_in_fun*/, +True/*consider text symbols only*/ ); if (si == NULL) return 0; else @@ -788,18 +815,22 @@ match anywhere in function, but don't show offsets. */ Bool VG_(get_fnname) ( Addr a, Char* buf, Int nbuf ) { - return get_fnname ( /*demangle*/True, a, buf, nbuf, - /*match_anywhere_in_fun*/True, - /*show offset?*/False ); + retu
[Valgrind-developers] valgrind: r7338 - in branches/DATASYMS: callgrind coregrind/m_debuginfo exp-drd include memcheck
Author: sewardj Date: 2008-01-11 07:24:37 + (Fri, 11 Jan 2008) New Revision: 7338 Log: Enhancements to debuginfo segment-lookup functions: Change VG_(seginfo_sect_kind) so it also produces an object file name as well as a VgSectKind. Adjust users accordingly. Make use of this in Memcheck's address-describer. Remove VG_(seginfo_sect_kind_name) and replace it with VG_(pp_SectKind), so as to independently have a way to print VgSectKinds without doing the address lookup. Modified: branches/DATASYMS/callgrind/bb.c branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c branches/DATASYMS/exp-drd/drd_error.c branches/DATASYMS/exp-drd/drd_main.c branches/DATASYMS/include/pub_tool_debuginfo.h branches/DATASYMS/memcheck/mc_main.c Modified: branches/DATASYMS/callgrind/bb.c === --- branches/DATASYMS/callgrind/bb.c2008-01-10 17:54:50 UTC (rev 7337) +++ branches/DATASYMS/callgrind/bb.c2008-01-11 07:24:37 UTC (rev 7338) @@ -141,7 +141,7 @@ new->jmp = (CJmpInfo*) &(new->instr[instr_count]); new->instr_len = 0; new->cost_count = 0; - new->sect_kind = VG_(seginfo_sect_kind)(offset + obj->offset); + new->sect_kind = VG_(seginfo_sect_kind)(NULL, 0, offset + obj->offset); new->fn = 0; new->line= 0; new->is_entry= 0; Modified: branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c === --- branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c 2008-01-10 17:54:50 UTC (rev 7337) +++ branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c 2008-01-11 07:24:37 UTC (rev 7338) @@ -1511,9 +1511,58 @@ return di->text_bias; } -VgSectKind VG_(seginfo_sect_kind)(Addr a) +Int VG_(seginfo_syms_howmany) ( const DebugInfo *si ) { + return si->symtab_used; +} + +void VG_(seginfo_syms_getidx) ( const DebugInfo *si, + Int idx, + /*OUT*/Addr* addr, + /*OUT*/Addr* tocptr, + /*OUT*/UInt* size, + /*OUT*/HChar** name, + /*OUT*/Bool* isText ) +{ + vg_assert(idx >= 0 && idx < si->symtab_used); + if (addr) *addr = si->symtab[idx].addr; + if (tocptr) *tocptr = si->symtab[idx].tocptr; + if (size) *size = si->symtab[idx].size; + if (name) *name = (HChar*)si->symtab[idx].name; + if (isText) *isText = si->symtab[idx].isText; +} + + +/**/ +/*--- SectKind query functions ---*/ +/**/ + +/* Convert a VgSectKind to a string, which must be copied if you want + to change it. */ +const HChar* VG_(pp_SectKind)( VgSectKind kind ) +{ + switch (kind) { + case Vg_SectUnknown: return "Unknown"; + case Vg_SectText:return "Text"; + case Vg_SectData:return "Data"; + case Vg_SectBSS: return "BSS"; + case Vg_SectGOT: return "GOT"; + case Vg_SectPLT: return "PLT"; + case Vg_SectOPD: return "OPD"; + default: vg_assert(0); + } +} + +/* Given an address 'a', make a guess of which section of which object + it comes from. If name is non-NULL, then the last n_name-1 + characters of the object's name is put in name[0 .. n_name-2], and + name[n_name-1] is set to zero (guaranteed zero terminated). */ + +VgSectKind VG_(seginfo_sect_kind)( /*OUT*/UChar* name, SizeT n_name, + Addr a) +{ DebugInfo* di; + VgSectKind res = Vg_SectUnknown; for (di = debugInfo_list; di != NULL; di = di->next) { @@ -1527,84 +1576,69 @@ di->bss_avma, di->bss_size); if (di->text_size > 0 - && a >= di->text_avma && a < di->text_avma + di->text_size) - return Vg_SectText; - + && a >= di->text_avma && a < di->text_avma + di->text_size) { + res = Vg_SectText; + break; + } if (di->data_size > 0 - && a >= di->data_avma && a < di->data_avma + di->data_size) - return Vg_SectData; - + && a >= di->data_avma && a < di->data_avma + di->data_size) { + res = Vg_SectData; + break; + } if (di->bss_size > 0 - && a >= di->bss_avma && a < di->bss_avma + di->bss_size) - return Vg_SectBSS; - + && a >= di->bss_avma && a < di->bss_avma + di->bss_size) { + res = Vg_SectBSS; + break; + } if (di->plt_size > 0 - && a >= di->plt_avma && a < di->plt_avma + di->plt_size) - return Vg_SectPLT; - + && a >= di->plt_avma && a < di->plt_avma + di->plt_size) { + res = Vg_SectPLT; + break; + } if (di->got_size > 0 - && a >= di->got_avma && a < di->got_avma + di->got_size) - return
[Valgrind-developers] valgrind: r7339 - in branches/DATASYMS: coregrind include
Author: sewardj Date: 2008-01-13 01:47:56 + (Sun, 13 Jan 2008) New Revision: 7339 Log: Make the argument to VG_(log2) be unsigned. Doesn't really make sense to interpret it as a signed value. Modified: branches/DATASYMS/coregrind/m_libcbase.c branches/DATASYMS/include/pub_tool_libcbase.h Modified: branches/DATASYMS/coregrind/m_libcbase.c === --- branches/DATASYMS/coregrind/m_libcbase.c2008-01-11 07:24:37 UTC (rev 7338) +++ branches/DATASYMS/coregrind/m_libcbase.c2008-01-13 01:47:56 UTC (rev 7339) @@ -563,13 +563,14 @@ Misc useful functions -- */ -/* Returns the base-2 logarithm of x. Returns -1 if x is not a power of two. */ -Int VG_(log2) ( Int x ) +/* Returns the base-2 logarithm of x. Returns -1 if x is not a power + of two. */ +Int VG_(log2) ( UInt x ) { Int i; /* Any more than 32 and we overflow anyway... */ for (i = 0; i < 32; i++) { - if (1 << i == x) return i; + if ((1U << i) == x) return i; } return -1; } Modified: branches/DATASYMS/include/pub_tool_libcbase.h === --- branches/DATASYMS/include/pub_tool_libcbase.h 2008-01-11 07:24:37 UTC (rev 7338) +++ branches/DATASYMS/include/pub_tool_libcbase.h 2008-01-13 01:47:56 UTC (rev 7339) @@ -135,8 +135,9 @@ extern void VG_(ssort)( void* base, SizeT nmemb, SizeT size, Int (*compar)(void*, void*) ); -/* Returns the base-2 logarithm of x. Returns -1 if x is not a power of two. */ -extern Int VG_(log2) ( Int x ); +/* Returns the base-2 logarithm of x. Returns -1 if x is not a power + of two. */ +extern Int VG_(log2) ( UInt x ); // A pseudo-random number generator returning a random UInt. If pSeed // is NULL, it uses its own seed, which starts at zero. If pSeed is - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7340 - branches/DATASYMS/coregrind/m_debuginfo
Author: sewardj Date: 2008-01-13 01:54:19 + (Sun, 13 Jan 2008) New Revision: 7340 Log: Improve .bss handling. I still don't really understand how to reliably figure out at which VMA ld.so maps the .bss section, though. Also, handle .sdata segments -- these are another kind of .data segment that show up on ppc32-linux. Modified: branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c branches/DATASYMS/coregrind/m_debuginfo/priv_storage.h branches/DATASYMS/coregrind/m_debuginfo/readelf.c Modified: branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c === --- branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c 2008-01-13 01:47:56 UTC (rev 7339) +++ branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c 2008-01-13 01:54:19 UTC (rev 7340) @@ -700,9 +700,17 @@ && di->text_avma <= ptr && ptr < di->text_avma + di->text_size; } else { - inRange = di->data_size > 0 - && di->data_avma <= ptr - && ptr < di->data_avma + di->data_size + di->bss_size; + inRange = (di->data_size > 0 +&& di->data_avma <= ptr +&& ptr < di->data_avma + di->data_size) + || + (di->sdata_size > 0 +&& di->sdata_avma <= ptr +&& ptr < di->sdata_avma + di->sdata_size) + || + (di->bss_size > 0 +&& di->bss_avma <= ptr +&& ptr < di->bss_avma + di->bss_size); } /* Note this short-circuit check relies on the assumption that Modified: branches/DATASYMS/coregrind/m_debuginfo/priv_storage.h === --- branches/DATASYMS/coregrind/m_debuginfo/priv_storage.h 2008-01-13 01:47:56 UTC (rev 7339) +++ branches/DATASYMS/coregrind/m_debuginfo/priv_storage.h 2008-01-13 01:54:19 UTC (rev 7340) @@ -274,15 +274,24 @@ though. */ /* .text */ Addr text_avma; + Addr text_svma; SizeT text_size; OffT text_bias; /* .data */ + Addr data_svma; Addr data_avma; SizeT data_size; OffT data_bias; + /* .sdata */ + Addr sdata_svma; + Addr sdata_avma; + SizeT sdata_size; + OffT sdata_bias; /* .bss */ + Addr bss_svma; Addr bss_avma; SizeT bss_size; + OffT bss_bias; /* .plt */ Addr plt_avma; SizeT plt_size; Modified: branches/DATASYMS/coregrind/m_debuginfo/readelf.c === --- branches/DATASYMS/coregrind/m_debuginfo/readelf.c 2008-01-13 01:47:56 UTC (rev 7339) +++ branches/DATASYMS/coregrind/m_debuginfo/readelf.c 2008-01-13 01:54:19 UTC (rev 7340) @@ -216,6 +216,7 @@ ) { Bool plausible, is_in_opd; + Bool in_text, in_data, in_sdata, in_bss; /* Set defaults */ *sym_name_out = sym_name; @@ -238,6 +239,8 @@ ); /* Now bias sym_avma_out accordingly */ +#if 0 + /* This works, but seems a bit crude */ if (ELFXX_ST_TYPE(sym->st_info) == STT_OBJECT) { *is_text_out = False; *sym_avma_out += di->data_bias; @@ -245,6 +248,38 @@ *is_text_out = True; *sym_avma_out += di->text_bias; } +#else + /* Try to figure out exactly which section the symbol is from and + bias accordingly. Screws up if the previously deduced section + svma address ranges are wrong. */ + if (di->text_size > 0 + && sym_svma >= di->text_svma + && sym_svma < di->text_svma + di->text_size) { + *is_text_out = True; + *sym_avma_out += di->text_bias; + } else + if (di->data_size > 0 + && sym_svma >= di->data_svma + && sym_svma < di->data_svma + di->data_size) { + *is_text_out = False; + *sym_avma_out += di->data_bias; + } else + if (di->sdata_size > 0 + && sym_svma >= di->sdata_svma + && sym_svma < di->sdata_svma + di->sdata_size) { + *is_text_out = False; + *sym_avma_out += di->sdata_bias; + } else + if (di->bss_size > 0 + && sym_svma >= di->bss_svma + && sym_svma < di->bss_svma + di->bss_size) { + *is_text_out = False; + *sym_avma_out += di->bss_bias; + } else { + *is_text_out = True; + *sym_avma_out += di->text_bias; + } +#endif # if defined(VGP_ppc64_linux) /* Allow STT_NOTYPE in the very special case where we're running on @@ -255,8 +290,8 @@ && ELFXX_ST_TYPE(sym->st_info) == STT_NOTYPE && sym->st_size > 0 && di->opd_size > 0 - && *sym_svma_out >= di->opd_avma - && *sym_svma_out < di->opd_avma + di->opd_size) + && *sym_avma_out >= di->opd_avma + && *sym_avma_out < di->opd_avma + di->opd_size) plausible = True; # endif @@ -315,9 +350,11 @@ # else Intoffset_in_opd; ULong* fn_descr; + Bool details
[Valgrind-developers] valgrind: r7342 - branches/DATASYMS/coregrind/m_debuginfo
Author: sewardj Date: 2008-01-13 14:12:13 + (Sun, 13 Jan 2008) New Revision: 7342 Log: Improve debug printing in prefersym(). Modified: branches/DATASYMS/coregrind/m_debuginfo/storage.c Modified: branches/DATASYMS/coregrind/m_debuginfo/storage.c === --- branches/DATASYMS/coregrind/m_debuginfo/storage.c 2008-01-13 14:11:24 UTC (rev 7341) +++ branches/DATASYMS/coregrind/m_debuginfo/storage.c 2008-01-13 14:12:13 UTC (rev 7342) @@ -556,6 +556,11 @@ Int vlena, vlenb; /* length without version */ const UChar *vpa, *vpb; + Bool preferA = False; + Bool preferB = False; + + vg_assert(a->addr == b->addr); + vlena = lena = VG_(strlen)(a->name); vlenb = lenb = VG_(strlen)(b->name); @@ -567,37 +572,57 @@ if (vpb) vlenb = vpb - b->name; - TRACE_SYMTAB("choosing between '%s' and '%s'\n", a->name, b->name); - /* MPI hack: prefer PMPI_Foo over MPI_Foo */ if (0==VG_(strncmp)(a->name, "MPI_", 4) && 0==VG_(strncmp)(b->name, "PMPI_", 5) - && 0==VG_(strcmp)(a->name, 1+b->name)) - return b; - else + && 0==VG_(strcmp)(a->name, 1+b->name)) { + preferB = True; goto out; + } if (0==VG_(strncmp)(b->name, "MPI_", 4) && 0==VG_(strncmp)(a->name, "PMPI_", 5) - && 0==VG_(strcmp)(b->name, 1+a->name)) - return a; + && 0==VG_(strcmp)(b->name, 1+a->name)) { + preferA = True; goto out; + } /* Select the shortest unversioned name */ - if (vlena < vlenb) - return a; - else if (vlenb < vlena) - return b; + if (vlena < vlenb) { + preferA = True; goto out; + } + if (vlenb < vlena) { + preferB = True; goto out; + } /* Equal lengths; select the versioned name */ - if (vpa && !vpb) - return a; - if (vpb && !vpa) - return b; + if (vpa && !vpb) { + preferA = True; goto out; + } + if (vpb && !vpa) { + preferB = True; goto out; + } /* Either both versioned or neither is versioned; select them alphabetically */ - if (VG_(strcmp)(a->name, b->name) < 0) + if (VG_(strcmp)(a->name, b->name) < 0) { + preferA = True; goto out; + } + /* else */ { + preferB = True; goto out; + } + /*NOTREACHED*/ + vg_assert(0); + out: + if (preferA && !preferB) { + TRACE_SYMTAB("sym at %p: prefer '%s' over '%s'\n", + a->addr, a->name, b->name ); return a; - else + } + if (preferB && !preferA) { + TRACE_SYMTAB("sym at %p: prefer '%s' over '%s'\n", + b->addr, b->name, a->name ); return b; + } + /*NOTREACHED*/ + vg_assert(0); } static void canonicaliseSymtab ( struct _DebugInfo* di ) - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7341 - branches/DATASYMS/coregrind/m_debuginfo
Author: sewardj Date: 2008-01-13 14:11:24 + (Sun, 13 Jan 2008) New Revision: 7341 Log: Try to straighten out _bias computations for: .text .data .sdata .bss Modified: branches/DATASYMS/coregrind/m_debuginfo/readelf.c Modified: branches/DATASYMS/coregrind/m_debuginfo/readelf.c === --- branches/DATASYMS/coregrind/m_debuginfo/readelf.c 2008-01-13 01:54:19 UTC (rev 7340) +++ branches/DATASYMS/coregrind/m_debuginfo/readelf.c 2008-01-13 14:11:24 UTC (rev 7341) @@ -1325,8 +1325,11 @@ di->text_svma = svma; di->text_avma = di->rx_map_avma + foff - di->rx_map_foff; di->text_size = size; -di->text_bias = VG_PGROUNDDN(di->text_avma) - VG_PGROUNDDN(svma); -TRACE_SYMTAB("acquiring .text avma = %p .. %p\n", +di->text_bias = di->text_avma - svma; +TRACE_SYMTAB("acquiring .text svma = %p .. %p\n", + di->text_svma, + di->text_svma + di->text_size - 1); +TRACE_SYMTAB("acquiring .text avma = %p .. %p\n", di->text_avma, di->text_avma + di->text_size - 1); TRACE_SYMTAB("acquiring .text bias = %p\n", di->text_bias); @@ -1341,7 +1344,10 @@ di->data_svma = svma; di->data_avma = di->rw_map_avma + foff - di->rw_map_foff; di->data_size = size; -di->data_bias = VG_PGROUNDDN(di->data_avma) - VG_PGROUNDDN(svma); +di->data_bias = di->data_avma - svma; +TRACE_SYMTAB("acquiring .data svma = %p .. %p\n", + di->data_svma, + di->data_svma + di->data_size - 1); TRACE_SYMTAB("acquiring .data avma = %p .. %p\n", di->data_avma, di->data_avma + di->data_size - 1); @@ -1357,7 +1363,10 @@ di->sdata_svma = svma; di->sdata_avma = di->rw_map_avma + foff - di->rw_map_foff; di->sdata_size = size; -di->sdata_bias = VG_PGROUNDDN(di->sdata_avma) - VG_PGROUNDDN(svma); +di->sdata_bias = di->sdata_avma - svma; +TRACE_SYMTAB("acquiring .sdata svma = %p .. %p\n", + di->sdata_svma, + di->sdata_svma + di->sdata_size - 1); TRACE_SYMTAB("acquiring .sdata avma = %p .. %p\n", di->sdata_avma, di->sdata_avma + di->sdata_size - 1); @@ -1373,13 +1382,15 @@ di->bss_svma = svma; di->bss_avma = di->rw_map_avma + foff - di->rw_map_foff; di->bss_size = size; -di->bss_bias = VG_PGROUNDDN(di->bss_avma) - VG_PGROUNDDN(svma); +di->bss_bias = di->bss_avma - svma; bss_align = alyn; +TRACE_SYMTAB("acquiring .bss svma = %p .. %p\n", + di->bss_svma, + di->bss_svma + di->bss_size - 1); TRACE_SYMTAB("acquiring .bss avma = %p .. %p\n", di->bss_avma, di->bss_avma + di->bss_size - 1); TRACE_SYMTAB("acquiring .bss bias = %p\n", di->bss_bias); -TRACE_SYMTAB("acquiring .bss svma = %p\n", di->bss_svma); } else if ((!inrw) && (!inrx) && size > 0 && di->bss_size == 0) { /* File contains a .bss, but it didn't get mapped. Ignore. */ @@ -1396,8 +1407,8 @@ /* Accept .sbss where mapped as rw (data) */ if (0 == VG_(strcmp)(name, ".sbss")) { if (inrw && size > 0 && sbss_size == 0) { -sbss_size = size; -sbss_svma = svma; +sbss_size = size; +sbss_svma = svma; sbss_align = alyn; } else { BAD(".sbss"); @@ -1501,7 +1512,8 @@ /* but don't mess with .bss avma or bias */ TRACE_SYMTAB("found .sbss of size %ld immediately preceding .bss\n", sbss_size); - TRACE_SYMTAB("revised .bss svma %p\n", di->bss_svma); + TRACE_SYMTAB("revised .bss svma %p .. %p\n", + di->bss_svma, di->bss_svma + di->bss_size - 1); TRACE_SYMTAB("revised .bss avma %p .. %p\n", di->bss_avma, di->bss_avma + di->bss_size - 1); } @@ -1513,7 +1525,8 @@ /* but don't mess with .bss avma or bias */ TRACE_SYMTAB("found .sbss of size %ld immediately following .bss\n", sbss_size); - TRACE_SYMTAB("revised .bss svma %p (is unchanged)\n", di->bss_svma); + TRACE_SYMTAB("revised .bss svma %p .. %p\n", + di->bss_svma, di->bss_svma + di->bss_size - 1); TRACE_SYMTAB("revised .bss avma %p .. %p\n", di->bss_avma, di->bss_avma + di->bss_size - 1); } -
[Valgrind-developers] valgrind: r7343 - branches/DATASYMS/coregrind/m_debuginfo
Author: sewardj Date: 2008-01-13 15:26:15 + (Sun, 13 Jan 2008) New Revision: 7343 Log: Fix up .sbss fiddling a bit. Modified: branches/DATASYMS/coregrind/m_debuginfo/readelf.c Modified: branches/DATASYMS/coregrind/m_debuginfo/readelf.c === --- branches/DATASYMS/coregrind/m_debuginfo/readelf.c 2008-01-13 14:12:13 UTC (rev 7342) +++ branches/DATASYMS/coregrind/m_debuginfo/readelf.c 2008-01-13 15:26:15 UTC (rev 7343) @@ -1508,27 +1508,30 @@ == di->bss_svma) { /* Immediately precedes .bss */ di->bss_size += (di->bss_svma - sbss_svma); + di->bss_bias += (di->bss_svma - sbss_svma); di->bss_svma -= (di->bss_svma - sbss_svma); /* but don't mess with .bss avma or bias */ TRACE_SYMTAB("found .sbss of size %ld immediately preceding .bss\n", sbss_size); - TRACE_SYMTAB("revised .bss svma %p .. %p\n", + TRACE_SYMTAB("revised .bss svma = %p .. %p\n", di->bss_svma, di->bss_svma + di->bss_size - 1); - TRACE_SYMTAB("revised .bss avma %p .. %p\n", + TRACE_SYMTAB("revised .bss avma = %p .. %p\n", di->bss_avma, di->bss_avma + di->bss_size - 1); + TRACE_SYMTAB("revised .bss bias = %p\n", di->bss_bias); } else - if (round_Addr_upwards(di->bss_svma + di->bss_size, sbss_align) - == sbss_svma) { + if (round_Addr_upwards(di->bss_svma + di->bss_size, sbss_align) + == sbss_svma) { /* Immediately follows .bss */ di->bss_size += (sbss_svma - di->bss_svma); /* but don't mess with .bss avma or bias */ TRACE_SYMTAB("found .sbss of size %ld immediately following .bss\n", sbss_size); - TRACE_SYMTAB("revised .bss svma %p .. %p\n", + TRACE_SYMTAB("revised .bss svma = %p .. %p\n", di->bss_svma, di->bss_svma + di->bss_size - 1); - TRACE_SYMTAB("revised .bss avma %p .. %p\n", + TRACE_SYMTAB("revised .bss avma = %p .. %p\n", di->bss_avma, di->bss_avma + di->bss_size - 1); + TRACE_SYMTAB("revised .bss bias = %p\n", di->bss_bias); } else { /* Can't ascertain relative position. Complain and - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7344 - branches/DATASYMS/coregrind/m_debuginfo
Author: sewardj Date: 2008-01-13 15:27:44 + (Sun, 13 Jan 2008) New Revision: 7344 Log: Improve error reporting when failing to open the ELF file. Modified: branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c branches/DATASYMS/coregrind/m_debuginfo/storage.c Modified: branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c === --- branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c 2008-01-13 15:26:15 UTC (rev 7343) +++ branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c 2008-01-13 15:27:44 UTC (rev 7344) @@ -451,7 +451,10 @@ VG_(memset)(buf1k, 0, sizeof(buf1k)); fd = VG_(open)( filename, VKI_O_RDONLY, 0 ); if (fd.isError) { - ML_(symerr)(NULL, True, "can't open file to inspect ELF header"); + DebugInfo fake_di; + VG_(memset)(&fake_di, 0, sizeof(fake_di)); + fake_di.filename = filename; + ML_(symerr)(&fake_di, True, "can't open file to inspect ELF header"); return; } nread = VG_(read)( fd.res, buf1k, sizeof(buf1k) ); Modified: branches/DATASYMS/coregrind/m_debuginfo/storage.c === --- branches/DATASYMS/coregrind/m_debuginfo/storage.c 2008-01-13 15:26:15 UTC (rev 7343) +++ branches/DATASYMS/coregrind/m_debuginfo/storage.c 2008-01-13 15:27:44 UTC (rev 7344) @@ -64,7 +64,7 @@ VG_(message)(Vg_DebugMsg, "WARNING: Serious error when " "reading debug info"); - if (VG_(clo_verbosity) < 2) { + if (True || VG_(clo_verbosity) < 2) { /* Need to show what the file name is, at verbosity levels 2 or below, since that won't already have been shown */ VG_(message)(Vg_DebugMsg, - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7345 - branches/DATASYMS/coregrind/m_syswrap
Author: sewardj Date: 2008-01-13 15:36:15 + (Sun, 13 Jan 2008) New Revision: 7345 Log: Merge r7334 (Enable some syscalls needed to run firefox on 64-bit ppc on Fedora 8.) Modified: branches/DATASYMS/coregrind/m_syswrap/syswrap-ppc64-linux.c Modified: branches/DATASYMS/coregrind/m_syswrap/syswrap-ppc64-linux.c === --- branches/DATASYMS/coregrind/m_syswrap/syswrap-ppc64-linux.c 2008-01-13 15:27:44 UTC (rev 7344) +++ branches/DATASYMS/coregrind/m_syswrap/syswrap-ppc64-linux.c 2008-01-13 15:36:15 UTC (rev 7345) @@ -1269,7 +1269,7 @@ GENXY(__NR_wait4, sys_wait4), // 114 // _(__NR_swapoff, sys_swapoff),// 115 -// _(__NR_sysinfo, sys_sysinfo),// 116 + LINXY(__NR_sysinfo, sys_sysinfo),// 116 PLAXY(__NR_ipc, sys_ipc),// 117 GENX_(__NR_fsync, sys_fsync), // 118 // _(__NR_sigreturn, sys_sigreturn), // 119 @@ -1328,13 +1328,13 @@ GENX_(__NR_mremap,sys_mremap), // 163 // _(__NR_setresuid, sys_setresuid), // 164 -// _(__NR_getresuid, sys_getresuid), // 165 + LINXY(__NR_getresuid, sys_getresuid), // 165 // _(__NR_query_module, sys_query_module), // 166 GENXY(__NR_poll, sys_poll), // 167 // _(__NR_nfsservctl,sys_nfsservctl), // 168 // _(__NR_setresgid, sys_setresgid), // 169 -// _(__NR_getresgid, sys_getresgid), // 170 + LINXY(__NR_getresgid, sys_getresgid), // 170 // _(__NR_prctl, sys_prctl), // 171 PLAX_(__NR_rt_sigreturn, sys_rt_sigreturn), // 172 LINXY(__NR_rt_sigaction, sys_rt_sigaction), // 173 - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7347 - trunk/coregrind/m_debuginfo
Author: sewardj Date: 2008-01-14 12:04:11 + (Mon, 14 Jan 2008) New Revision: 7347 Log: Handle DW_OP_plus_uconst. Possibly fixes #155091 (not yet confirmed by reporter). Modified: trunk/coregrind/m_debuginfo/readdwarf.c Modified: trunk/coregrind/m_debuginfo/readdwarf.c === --- trunk/coregrind/m_debuginfo/readdwarf.c 2008-01-14 11:54:56 UTC (rev 7346) +++ trunk/coregrind/m_debuginfo/readdwarf.c 2008-01-14 12:04:11 UTC (rev 7347) @@ -2638,6 +2638,7 @@ Intix, ix2, reg; UChar opcode; Word sw; + UWord uw; CfiOp op; HChar* opname; @@ -2712,6 +2713,16 @@ VG_(printf)("DW_OP_breg%d: %ld", reg, sw); break; + case DW_OP_plus_uconst: +uw = read_leb128U( &expr ); +PUSH( ML_(CfiExpr_Const)( dst, uw ) ); +POP( ix ); +POP( ix2 ); +PUSH( ML_(CfiExpr_Binop)( dst, op, ix2, ix ) ); +if (ddump_frames) + VG_(printf)("DW_OP_plus_uconst: %lu", uw); +break; + case DW_OP_const4s: /* push: 32-bit signed immediate */ sw = read_le_s_encoded_literal( expr, 4 ); - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers
[Valgrind-developers] valgrind: r7348 - branches/DATASYMS/coregrind/m_debuginfo
Author: sewardj Date: 2008-01-14 15:11:58 + (Mon, 14 Jan 2008) New Revision: 7348 Log: Even more arsing around to try and figure out where .bss really is mapped. Abandon all previous scheme(s) and simply assume that .bss .sbss and .dynbss are mapped immediately after .data. This is the first arrangement that actually works at all on ppc32/64-linux w.r.t. correctly establishing the address of bss symbols. Modified: branches/DATASYMS/coregrind/m_debuginfo/readelf.c Modified: branches/DATASYMS/coregrind/m_debuginfo/readelf.c === --- branches/DATASYMS/coregrind/m_debuginfo/readelf.c 2008-01-14 12:04:11 UTC (rev 7347) +++ branches/DATASYMS/coregrind/m_debuginfo/readelf.c 2008-01-14 15:11:58 UTC (rev 7348) @@ -711,7 +711,7 @@ VG_(OSetGen_Insert)(oset, elem); if (di->trace_symtab) { VG_(printf)(" to-oset [%4d]: " - " val %010p, toc %010p, sz %4d %s\n", + " val %010p, toc %010p, sz %4d %s\n", i, (void*) elem->key.addr, (void*) elem->tocptr, (Int) elem->size, @@ -740,7 +740,7 @@ ML_(addSym) ( di, &risym ); if (di->trace_symtab) { VG_(printf)("rec(%c) [%4d]: " - " val %010p, toc %010p, sz %4d %s\n", + " val %010p, toc %010p, sz %4d %s\n", risym.isText ? 't' : 'd', i, (void*) risym.addr, (void*) risym.tocptr, @@ -1270,6 +1270,10 @@ /*UInt */ bss_align = 0; /*UInt */ sbss_align = 0; + UInt data_align = 0; + SizeT bss_totsize = 0; + Addr gen_bss_lowest_svma = ~((Addr)0); + /* Now read the section table. */ TRACE_SYMTAB("\n"); TRACE_SYMTAB("--- Examining the section headers and program headers ---\n"); @@ -1341,6 +1345,7 @@ /* Accept .data where mapped as rw (data) */ if (0 == VG_(strcmp)(name, ".data")) { if (inrw && size > 0 && di->data_size == 0) { +if (alyn > data_align) data_align = alyn; di->data_svma = svma; di->data_avma = di->rw_map_avma + foff - di->rw_map_foff; di->data_size = size; @@ -1360,6 +1365,7 @@ /* Accept .sdata where mapped as rw (data) */ if (0 == VG_(strcmp)(name, ".sdata")) { if (inrw && size > 0 && di->sdata_size == 0) { +if (alyn > data_align) data_align = alyn; di->sdata_svma = svma; di->sdata_avma = di->rw_map_avma + foff - di->rw_map_foff; di->sdata_size = size; @@ -1379,6 +1385,9 @@ /* Accept .bss where mapped as rw (data) */ if (0 == VG_(strcmp)(name, ".bss")) { if (inrw && size > 0 && di->bss_size == 0) { +bss_totsize += round_Addr_upwards(size, alyn); +if (svma < gen_bss_lowest_svma) gen_bss_lowest_svma = svma; +TRACE_SYMTAB("increasing total bss-like size to %ld\n", bss_totsize); di->bss_svma = svma; di->bss_avma = di->rw_map_avma + foff - di->rw_map_foff; di->bss_size = size; @@ -1407,6 +1416,9 @@ /* Accept .sbss where mapped as rw (data) */ if (0 == VG_(strcmp)(name, ".sbss")) { if (inrw && size > 0 && sbss_size == 0) { +bss_totsize += round_Addr_upwards(size, alyn); +if (svma < gen_bss_lowest_svma) gen_bss_lowest_svma = svma; +TRACE_SYMTAB("increasing total bss-like size to %ld\n", bss_totsize); sbss_size = size; sbss_svma = svma; sbss_align = alyn; @@ -1415,6 +1427,17 @@ } } + /* Accept .sbss where mapped as rw (data) */ + if (0 == VG_(strcmp)(name, ".dynbss")) { + if (inrw && size > 0 /* && sbss_size == 0*/) { +bss_totsize += round_Addr_upwards(size, alyn); +if (svma < gen_bss_lowest_svma) gen_bss_lowest_svma = svma; +TRACE_SYMTAB("increasing total bss-like size to %ld\n", bss_totsize); + } else { +BAD(".dynbss"); + } + } + /* Accept .got where mapped as rw (data) */ if (0 == VG_(strcmp)(name, ".got")) { if (inrw && size > 0 && di->got_size == 0) { @@ -1497,6 +1520,7 @@ } +#if 0 /* We found a .sbss section too. If if immediately adjoins the .bss, pretend it's a part of .bss. This is a hack. Fortunately .sbss (small-items .bss section) seems to exist on @@ -1544,7 +1568,29 @@ } } +#endif +#if 1 + /* Kludge: ignore all previous computations for .bss avma range, + and simply assume that .bss immediately follows .data/.sdata.*/ + if (1) { + SizeT data_al = round_Addr_upwards(di->data_avma, data_align) + - di->data_avma; + TRACE_SYMTAB("data_al = %ld\n", data_al); + bss_totsize += data_al; + + di->bss_svma = gen_bss_lowest_svma; + di->bss_size = bss_totsize; + di->bss_avma = di->data_avma
[Valgrind-developers] valgrind: r7349 - branches/DATASYMS/coregrind/m_debuginfo
Author: sewardj Date: 2008-01-15 02:21:39 + (Tue, 15 Jan 2008) New Revision: 7349 Log: Track recent changes in m_debuginfo, principally to the type DebugInfo and the changed loginc in debuginfo.c. Modified: branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c branches/DATASYMS/coregrind/m_debuginfo/priv_readxcoff.h branches/DATASYMS/coregrind/m_debuginfo/readxcoff.c Modified: branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c === --- branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c 2008-01-14 15:11:58 UTC (rev 7348) +++ branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c 2008-01-15 02:21:39 UTC (rev 7349) @@ -177,7 +177,7 @@ while (curr) { if (curr == di) { - // Found it; remove from list and free it. + /* Found it; remove from list and free it. */ if (VG_(clo_verbosity) > 1 || VG_(clo_trace_redir)) VG_(message)(Vg_DebugMsg, "Discarding syms at %p-%p in %s due to %s()", @@ -195,13 +195,14 @@ curr = curr->next; } - // Not found. + /* Not found. */ } -/* Repeatedly scan debugInfo_list, looking for DebugInfos intersecting - [start,start+length), and call discard_DebugInfo to get rid of - them. This modifies the list, hence the multiple iterations. +/* Repeatedly scan debugInfo_list, looking for DebugInfos with text + AVMAs intersecting [start,start+length), and call discard_DebugInfo + to get rid of them. This modifies the list, hence the multiple + iterations. */ static void discard_syms_in_range ( Addr start, SizeT length ) { @@ -231,52 +232,10 @@ } } -#if 0 -/* Create a new SegInfo with the specific address/length/vma offset, - then snarf whatever info we can from the given filename into it. */ -static -SegInfo* acquire_syms_for_range( -/* ALL*/ Addr seg_addr, -/* ALL*/ SizeT seg_len, -/* ELF only */ OffT seg_offset, -/* ALL*/ const UChar* seg_filename, -/* XCOFF only */ const UChar* seg_memname, - /* XCOFF only */ Addr data_addr, - /* XCOFF only */ SizeT data_len, - /* XCOFF only */ Bool is_mainexe - ) -{ - Bool ok; - SegInfo* si = alloc_SegInfo(seg_addr, seg_len, seg_offset, - seg_filename, seg_memname); -# if defined(VGO_linux) - ok = ML_(read_elf_debug_info) ( si ); -# elif defined(VGO_aix5) - ok = ML_(read_xcoff_debug_info) ( si, data_addr, data_len, is_mainexe ); -# else -#error Unknown OS -# endif - if (!ok) { - // Something went wrong (eg. bad ELF file). - free_SegInfo( si ); - si = NULL; - - } else { - // Prepend si to segInfo_list - si->next = segInfo_list; - segInfo_list = si; - - ML_(canonicaliseTables) ( si ); - - /* notify m_redir about it */ - VG_(redir_notify_new_SegInfo)( si ); - } - - return si; -} -#endif - +/* Does [s1,+len1) overlap [s2,+len2) ? Note: does not handle + wraparound at the end of the address space -- just asserts in that + case. */ static Bool ranges_overlap (Addr s1, SizeT len1, Addr s2, SizeT len2 ) { Addr e1, e2; @@ -293,6 +252,9 @@ return True; } + +/* Do the basic rx_ and rw_ mappings of the two DebugInfos overlap in + any way? */ static Bool do_DebugInfos_overlap ( DebugInfo* di1, DebugInfo* di2 ) { vg_assert(di1); @@ -321,6 +283,9 @@ return False; } + +/* Discard all elements of debugInfo_list whose .mark bit is set. +*/ static void discard_marked_DebugInfos ( void ) { DebugInfo* curr; @@ -342,6 +307,13 @@ } } + +/* Discard any elements of debugInfo_list which overlap with diRef. + Clearly diRef must have its rx_ and rw_ mapping information set to + something sane. */ +#if defined(VGO_aix5) +__attribute__((unused)) +#endif static void discard_DebugInfos_which_overlap_with ( DebugInfo* diRef ) { DebugInfo* di; @@ -359,6 +331,7 @@ discard_marked_DebugInfos(); } + /* Find the existing DebugInfo for (memname,filename) or if not found, create one. In the latter case memname and filename are strdup'd into VG_AR_DINFO, and the new DebugInfo is added to @@ -630,38 +603,42 @@ Bool is_mainexe, Bool acquire ) { - SegInfo* si; - if (acquire) { - acquire_syms_for_range( - /* ALL*/ code_start, - /* ALL*/ code_len, - /* ELF only */ 0, - /* ALL*/ file_name, - /* XCOFF only */ mem_name, - /* XCOFF only */ data_start, - /* XCOFF only */ data_len, - /* XCOFF only */ is_mainexe - ); + Bool ok; + DebugInfo* di; + di = find_or_create_DebugInfo_for( file_name, mem_name ); + vg_assert(di); + di->text_svma = 0; /* don't know yet */ + di->text_bias = 0; /* don't know yet */ + di->
[Valgrind-developers] valgrind: r7350 - trunk/memcheck
Author: sewardj Date: 2008-01-15 08:42:56 + (Tue, 15 Jan 2008) New Revision: 7350 Log: Intercept memcpy on 64-bit ld.so's. Modified: trunk/memcheck/mc_replace_strmem.c Modified: trunk/memcheck/mc_replace_strmem.c === --- trunk/memcheck/mc_replace_strmem.c 2008-01-15 02:21:39 UTC (rev 7349) +++ trunk/memcheck/mc_replace_strmem.c 2008-01-15 08:42:56 UTC (rev 7350) @@ -401,6 +401,7 @@ MEMCPY(m_libc_soname, memcpy) MEMCPY(m_ld_so_1, memcpy) /* ld.so.1 */ +MEMCPY(m_ld64_so_1, memcpy) /* ld64.so.1 */ /* icc9 blats these around all over the place. Not only in the main executable but various .so's. They are highly tuned and read memory beyond the source boundary (although work correctly and - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers