You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
| 2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
| 2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
| 2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
| 2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
| 2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
| 2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
| 2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
| 2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
| 2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
| 2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
| 2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
| 2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
| 2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
| 2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
| 2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
| 2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
| 2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
| 2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
| 2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
| 2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(19) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
1
(32) |
2
(22) |
3
(47) |
4
(29) |
5
(18) |
6
(16) |
|
7
(21) |
8
(29) |
9
(23) |
10
(68) |
11
(20) |
12
(17) |
13
(17) |
|
14
(27) |
15
(26) |
16
(21) |
17
(13) |
18
(19) |
19
(29) |
20
(13) |
|
21
(9) |
22
(8) |
23
(29) |
24
(56) |
25
(21) |
26
(46) |
27
(33) |
|
28
(25) |
29
(41) |
30
(35) |
31
(28) |
|
|
|
|
From: Tom H. <to...@co...> - 2005-08-26 23:21:04
|
In message <2e9...@lo...>
Tom Hughes <to...@co...> wrote:
> I did much the same thing now, and it links, but doesn't run:
>
> --14672:1:debuglog DebugLog system started by Stage 2 (main), level 1 logging requested
> --14672:1:main Doing scan_auxv()
> --14672:1:main Preprocess command line opts
>
> VG_(get_memory_from_mmap): newSuperblock's request for 1048576 bytes failed.
> VG_(get_memory_from_mmap): 0 bytes already allocated.
This was triggered by my having a .valgrindrc file. Without it I can
get beyond that. Now it crashes if I valgrind "uname -a" but if I add
a -d switch to valgrind it works...
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|
|
From: Tom H. <to...@co...> - 2005-08-26 23:09:52
|
In message <2e9...@lo...>
Tom Hughes <to...@co...> wrote:
> In message <Pin...@ch...>
> Nicholas Nethercote <nj...@cs...> wrote:
>
> > On Fri, 26 Aug 2005, Tom Hughes wrote:
> >
> > > Hmm. It's not fully working for me... The problem is that gcc is
> > > inserting calls to memcpy to handle structure assignments and those
> > > are then unresolved when linking.
> >
> > Same here. If I put in a local version of memcpy() in m_libcbase.c next
> > to VG_(memcpy)() those errors go away.
>
> I did much the same thing now, and it links, but doesn't run:
But strangely it does run for me on amd64 after I fixed up a few things...
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|
|
From: <sv...@va...> - 2005-08-26 23:09:06
|
Author: tom
Date: 2005-08-27 00:09:00 +0100 (Sat, 27 Aug 2005)
New Revision: 4530
Log:
Fill in a few blanks to get static linking working on amd64.
Modified:
branches/ASPACEM/coregrind/m_libcproc.c
branches/ASPACEM/coregrind/m_main.c
branches/ASPACEM/include/vki-linux.h
branches/ASPACEM/include/vki-x86-linux.h
Modified: branches/ASPACEM/coregrind/m_libcproc.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_libcproc.c 2005-08-26 21:02:47 UTC (rev =
4529)
+++ branches/ASPACEM/coregrind/m_libcproc.c 2005-08-26 23:09:00 UTC (rev =
4530)
@@ -421,6 +421,13 @@
list[i] =3D (UInt)list16[i];
return size;
=20
+# elif defined(VGP_amd64_linux)
+ SysRes sres;
+ sres =3D VG_(do_syscall2)(__NR_getgroups, size, (Addr)list);
+ if (sres.isError)
+ return -1;
+ return sres.val;
+
# else
# error "VG_(getgroups): needs implementation on this platform"
# endif
Modified: branches/ASPACEM/coregrind/m_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_main.c 2005-08-26 21:02:47 UTC (rev 4529=
)
+++ branches/ASPACEM/coregrind/m_main.c 2005-08-26 23:09:00 UTC (rev 4530=
)
@@ -238,6 +238,7 @@
=20
extern char _start[];
=20
+#if defined(VGP_x86_linux)
asm("\n"
"\t.globl _start\n"
"\t.type _start,@function\n"
@@ -247,10 +248,22 @@
"\tcall _start_in_C\n"
"\thlt\n"
);
+#elif defined(VGP_amd64_linux)
+asm("\n"
+ "\t.globl _start\n"
+ "\t.type _start,@function\n"
+ "_start:\n"
+ "\tmovq %rsp,%rdi\n"
+ "\tcall _start_in_C\n"
+ "\thlt\n"
+);
+#else
+#error "_start: needs implementation on this platform"
+#endif
=20
extern Int main (Int argc, HChar **argv, HChar **envp);
=20
-static void _start_in_C ( Int* pArgc )
+static void _start_in_C ( ULong* pArgc )
{
Int argc =3D pArgc[0];
HChar** argv =3D (HChar**)&pArgc[1];
Modified: branches/ASPACEM/include/vki-linux.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/include/vki-linux.h 2005-08-26 21:02:47 UTC (rev 452=
9)
+++ branches/ASPACEM/include/vki-linux.h 2005-08-26 23:09:00 UTC (rev 453=
0)
@@ -1074,9 +1074,41 @@
// From linux-2.6.8.1/include/linux/stat.h
//----------------------------------------------------------------------
=20
+#define VKI_S_IFMT 00170000
+#define VKI_S_IFSOCK 0140000
+#define VKI_S_IFLNK 0120000
+#define VKI_S_IFREG 0100000
+#define VKI_S_IFBLK 0060000
+#define VKI_S_IFDIR 0040000
+#define VKI_S_IFCHR 0020000
+#define VKI_S_IFIFO 0010000
+#define VKI_S_ISUID 0004000
+#define VKI_S_ISGID 0002000
+#define VKI_S_ISVTX 0001000
+
+#define VKI_S_ISLNK(m) (((m) & VKI_S_IFMT) =3D=3D VKI_S_IFLNK)
+#define VKI_S_ISREG(m) (((m) & VKI_S_IFMT) =3D=3D VKI_S_IFREG)
+#define VKI_S_ISDIR(m) (((m) & VKI_S_IFMT) =3D=3D VKI_S_IFDIR)
+#define VKI_S_ISCHR(m) (((m) & VKI_S_IFMT) =3D=3D VKI_S_IFCHR)
+#define VKI_S_ISBLK(m) (((m) & VKI_S_IFMT) =3D=3D VKI_S_IFBLK)
+#define VKI_S_ISFIFO(m) (((m) & VKI_S_IFMT) =3D=3D VKI_S_IFIFO)
+#define VKI_S_ISSOCK(m) (((m) & VKI_S_IFMT) =3D=3D VKI_S_IFSOCK)
+
+#define VKI_S_IRWXU 00700
#define VKI_S_IRUSR 00400
#define VKI_S_IWUSR 00200
+#define VKI_S_IXUSR 00100
=20
+#define VKI_S_IRWXG 00070
+#define VKI_S_IRGRP 00040
+#define VKI_S_IWGRP 00020
+#define VKI_S_IXGRP 00010
+
+#define VKI_S_IRWXO 00007
+#define VKI_S_IROTH 00004
+#define VKI_S_IWOTH 00002
+#define VKI_S_IXOTH 00001
+
//----------------------------------------------------------------------
// From linux-2.6.8.1/include/linux/dirent.h
//----------------------------------------------------------------------
Modified: branches/ASPACEM/include/vki-x86-linux.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/include/vki-x86-linux.h 2005-08-26 21:02:47 UTC (rev=
4529)
+++ branches/ASPACEM/include/vki-x86-linux.h 2005-08-26 23:09:00 UTC (rev=
4530)
@@ -315,44 +315,9 @@
#define VKI_SIOCGSTAMP 0x8906 /* Get stamp */
=20
//----------------------------------------------------------------------
-// From linux-2.6.8.1/include/linux/stat.h
+// From linux-2.6.8.1/include/asm-i386/stat.h
//----------------------------------------------------------------------
=20
-#define VKI_S_IFMT 00170000
-#define VKI_S_IFSOCK 0140000
-#define VKI_S_IFLNK 0120000
-#define VKI_S_IFREG 0100000
-#define VKI_S_IFBLK 0060000
-#define VKI_S_IFDIR 0040000
-#define VKI_S_IFCHR 0020000
-#define VKI_S_IFIFO 0010000
-#define VKI_S_ISUID 0004000
-#define VKI_S_ISGID 0002000
-#define VKI_S_ISVTX 0001000
-
-#define VKI_S_ISLNK(m) (((m) & VKI_S_IFMT) =3D=3D VKI_S_IFLNK)
-#define VKI_S_ISREG(m) (((m) & VKI_S_IFMT) =3D=3D VKI_S_IFREG)
-#define VKI_S_ISDIR(m) (((m) & VKI_S_IFMT) =3D=3D VKI_S_IFDIR)
-#define VKI_S_ISCHR(m) (((m) & VKI_S_IFMT) =3D=3D VKI_S_IFCHR)
-#define VKI_S_ISBLK(m) (((m) & VKI_S_IFMT) =3D=3D VKI_S_IFBLK)
-#define VKI_S_ISFIFO(m) (((m) & VKI_S_IFMT) =3D=3D VKI_S_IFIFO)
-#define VKI_S_ISSOCK(m) (((m) & VKI_S_IFMT) =3D=3D VKI_S_IFSOCK)
-
-#define VKI_S_IRWXU 00700
-#define VKI_S_IRUSR 00400
-#define VKI_S_IWUSR 00200
-#define VKI_S_IXUSR 00100
-
-#define VKI_S_IRWXG 00070
-#define VKI_S_IRGRP 00040
-#define VKI_S_IWGRP 00020
-#define VKI_S_IXGRP 00010
-
-#define VKI_S_IRWXO 00007
-#define VKI_S_IROTH 00004
-#define VKI_S_IWOTH 00002
-#define VKI_S_IXOTH 00001
-
struct vki_stat {
unsigned long st_dev;
unsigned long st_ino;
|
|
From: Tom H. <to...@co...> - 2005-08-26 22:49:57
|
In message <Pin...@ch...>
Nicholas Nethercote <nj...@cs...> wrote:
> On Fri, 26 Aug 2005, Tom Hughes wrote:
>
> > Hmm. It's not fully working for me... The problem is that gcc is
> > inserting calls to memcpy to handle structure assignments and those
> > are then unresolved when linking.
>
> Same here. If I put in a local version of memcpy() in m_libcbase.c next
> to VG_(memcpy)() those errors go away.
I did much the same thing now, and it links, but doesn't run:
--14672:1:debuglog DebugLog system started by Stage 2 (main), level 1 logging requested
--14672:1:main Doing scan_auxv()
--14672:1:main Preprocess command line opts
VG_(get_memory_from_mmap): newSuperblock's request for 1048576 bytes failed.
VG_(get_memory_from_mmap): 0 bytes already allocated.
Sorry. You could try using a tool that uses less memory;
eg. addrcheck instead of memcheck.
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|
|
From: Tom H. <to...@co...> - 2005-08-26 22:48:58
|
In message <Pin...@ch...>
Nicholas Nethercote <nj...@cs...> wrote:
> On Fri, 26 Aug 2005, Nicholas Nethercote wrote:
>
> > Then I'm left with a weird error involving malloc() in VEX, even though you
> > commented that out. I don't understand it at all.
>
> Ok, rebuilding Vex from scratch fixed that. I guess its dependency stuff
> isn't quite working.
It won't do on that branch - it should be fixed on the trunk though.
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|
|
From: Nicholas N. <nj...@cs...> - 2005-08-26 21:20:08
|
On Fri, 26 Aug 2005, Nicholas Nethercote wrote: > Then I'm left with a weird error involving malloc() in VEX, even though you > commented that out. I don't understand it at all. Ok, rebuilding Vex from scratch fixed that. I guess its dependency stuff isn't quite working. N |
|
From: Nicholas N. <nj...@cs...> - 2005-08-26 21:20:02
|
On Fri, 26 Aug 2005, Tom Hughes wrote: > Hmm. It's not fully working for me... The problem is that gcc is > inserting calls to memcpy to handle structure assignments and those > are then unresolved when linking. Same here. If I put in a local version of memcpy() in m_libcbase.c next to VG_(memcpy)() those errors go away. Then I'm left with a weird error involving malloc() in VEX, even though you commented that out. I don't understand it at all. N ../coregrind/libcoregrind.a(.text+0x515e): In function `vgPlain_vprintf': /u/njn/grind/aspacem/coregrind/m_libcprint.c:95: undefined reference to `memcpy' ../coregrind/libcoregrind.a(.text+0xf4c4): In function `handle_SCSS_change': /u/njn/grind/aspacem/coregrind/m_signals.c:426: undefined reference to `memcpy' ../coregrind/libcoregrind.a(.text+0x10cf7): In function `queue_signal': /u/njn/grind/aspacem/coregrind/m_signals.c:1605: undefined reference to `memcpy' ../coregrind/libcoregrind.a(.text+0x197b5): In function `vgModuleLocal_read_callframe_info_dwarf2': /u/njn/grind/aspacem/coregrind/m_debuginfo/dwarf.c:2478: undefined reference to `memcpy' ../coregrind/libcoregrind.a(.text+0x316e5): In function `build_vg_sigframe': /u/njn/grind/aspacem/coregrind/m_sigframe/sigframe-x86-linux.c:447: undefined reference to `memcpy' ../coregrind/libcoregrind.a(.text+0x31702):/u/njn/grind/aspacem/coregrind/m_sigframe/sigframe-x86-linux.c:449: more undefined references to `memcpy' follow ../coregrind/libcoregrind.a(.text+0x5d662): In function `LibVEX_Alloc': /v/filer3/v1q009/njn/grind/aspacem/VEX/priv/main/vex_util.c:108: undefined reference to `malloc' |
|
From: Nicholas N. <nj...@cs...> - 2005-08-26 21:03:49
|
On Thu, 18 Aug 2005, Jeroen N. Witmond wrote: > While looking for a way to generate FAQ.txt from FAQ.xml Ah, great... have you worked out how to do it? > I noticed that in a few places in file docs/xml/FAQ.xml in valgrind > 3.1.SVN, screens and program listings are part of the answer where they > should be part of the question. Attached patch fixes this problem. I've committed the changes, thanks very much. N |
|
From: <sv...@va...> - 2005-08-26 21:02:49
|
Author: njn Date: 2005-08-26 22:02:47 +0100 (Fri, 26 Aug 2005) New Revision: 4529 Log: update Modified: trunk/docs/internals/3_0_BUGSTATUS.txt Modified: trunk/docs/internals/3_0_BUGSTATUS.txt =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/docs/internals/3_0_BUGSTATUS.txt 2005-08-26 21:01:32 UTC (rev 4= 528) +++ trunk/docs/internals/3_0_BUGSTATUS.txt 2005-08-26 21:02:47 UTC (rev 4= 529) @@ -440,3 +440,10 @@ FIXED-TRUNK: TODO FIXED-30BRANCH: TODO =20 +---------------------------------------------------------------- + +not-in-bugzilla Fix XML bugs in FAQ =20 + +FIXED-TRUNK: 4528 +FIXED-30BRANCH: TODO + |
|
From: <sv...@va...> - 2005-08-26 21:01:36
|
Author: njn
Date: 2005-08-26 22:01:32 +0100 (Fri, 26 Aug 2005)
New Revision: 4528
Log:
Fix XML bugs in the FAQ.
Modified:
trunk/docs/xml/FAQ.xml
Modified: trunk/docs/xml/FAQ.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/docs/xml/FAQ.xml 2005-08-26 19:42:27 UTC (rev 4527)
+++ trunk/docs/xml/FAQ.xml 2005-08-26 21:01:32 UTC (rev 4528)
@@ -102,9 +102,7 @@
<qandaentry id=3D"faq.exit_errors">
<question>
<para>Programs run OK on Valgrind, but at exit produce a bunch
- of errors a bit like this:</para>
- </question>
- <answer><para>
+ of errors a bit like this:
<programlisting>
=3D=3D20755=3D=3D Invalid read of size 4
=3D=3D20755=3D=3D at 0x40281C8A: _nl_unload_locale (loadlocale.c:238)
@@ -119,6 +117,8 @@
</programlisting>
=20
and then die with a segmentation fault.</para>
+ </question>
+ <answer>
<para>When the program exits, Valgrind runs the procedure
<literal>__libc_freeres()</literal> in glibc. This is a hook
for memory debuggers, so they can ask glibc to free up any
@@ -138,12 +138,12 @@
<qandaentry id=3D"faq.bugdeath">
<question>
<para>My (buggy) program dies like this:</para>
- </question>
- <answer>
<screen>
% valgrind: vg_malloc2.c:442 (bszW_to_pszW): Assertion 'pszW >=3D 0' fai=
led.
</screen>
=20
+ </question>
+ <answer>
<para>If Memcheck (the memory checker) shows any invalid reads,
invalid writes and invalid frees in your program, the above may
happen. Reason is that your program may trash Valgrind's
@@ -158,12 +158,12 @@
<question>
<para>My program dies, printing a message like this along the
way:</para>
- </question>
- <answer>
<screen>
% disInstr: unhandled instruction bytes: 0x66 0xF 0x2E 0x5
</screen>
=20
+ </question>
+ <answer>
<para>Older versions did not support some x86 instructions,
particularly SSE/SSE2 instructions. Try a newer Valgrind; we
now support almost all instructions. If it still happens with
@@ -422,8 +422,6 @@
<qandaentry id=3D"faq.overruns">
<question>
<para>Why doesn't Memcheck find the array overruns in this program?</p=
ara>
- </question>
- <answer>
<programlisting>
int static[5];
=20
@@ -437,6 +435,8 @@
return 0;
}
</programlisting>
+ </question>
+ <answer>
<para>Unfortunately, Memcheck doesn't do bounds checking on
static or stack arrays. We'd like to, but it's just not
possible to do in a reasonable way that fits with how Memcheck
|
|
From: <sv...@va...> - 2005-08-26 19:42:31
|
Author: njn
Date: 2005-08-26 20:42:27 +0100 (Fri, 26 Aug 2005)
New Revision: 4527
Log:
Change slightly the way integers are printed by printf() and friends.
Previously, %d printed a 32-bit int. %ld and %lld printed 64-bit ints.
So if you wanted to print a word-sized int (eg. a SizeT variable), you
had to cast it to a Long and then print with %lld in order to work on
both 32-bit and 64-bit platforms.
I changed things so that %d prints a 32-bit int, %ld prints a word-sized
int, and %lld prints a 64-bit int. There are two advantages to this:
- it now matches the way the normal glibc printf() works;
- you can print word-sized ints without casting.
I also made the corresponding change for %u/lu/llu and %x/lx/llx, and I
changed a couple of VG_(printf)() invocations accordingly.
Modified:
trunk/coregrind/m_aspacemgr/aspacemgr.c
trunk/coregrind/m_debuglog.c
trunk/coregrind/m_syswrap/syswrap-generic.c
trunk/coregrind/m_syswrap/syswrap-linux.c
trunk/massif/ms_main.c
Modified: trunk/coregrind/m_aspacemgr/aspacemgr.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_aspacemgr/aspacemgr.c 2005-08-26 18:10:45 UTC (rev =
4526)
+++ trunk/coregrind/m_aspacemgr/aspacemgr.c 2005-08-26 19:42:27 UTC (rev =
4527)
@@ -741,9 +741,9 @@
VG_(printf)(
"\n"
"map_file_segment(addr=3D%p len=3D%lu prot=3D0x%x flags=3D0x%x\=
n"
- " dev=3D0x%4x ino=3D%d off=3D%ld\n"
+ " dev=3D0x%4x ino=3D%d off=3D%lld\n"
" filename=3D'%s')\n",
- addr, (ULong)len, prot, flags, dev, ino, off, filename);
+ addr, len, prot, flags, dev, ino, off, filename);
=20
if (0) VG_(show_segments)("before map_file_segment");
=20
Modified: trunk/coregrind/m_debuglog.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_debuglog.c 2005-08-26 18:10:45 UTC (rev 4526)
+++ trunk/coregrind/m_debuglog.c 2005-08-26 19:42:27 UTC (rev 4527)
@@ -384,6 +384,7 @@
Int i;
Int flags;
Int width;
+ Int n_ls =3D 0;
Bool is_long;
=20
/* We assume that vargs has already been initialised by the=20
@@ -408,7 +409,7 @@
continue;
}
flags =3D 0;
- is_long =3D False;
+ n_ls =3D 0;
width =3D 0; /* length of the field. */
if (format[i] =3D=3D '(') {
flags |=3D VG_MSG_PAREN;
@@ -436,9 +437,16 @@
}
while (format[i] =3D=3D 'l') {
i++;
- is_long =3D True;
+ n_ls++;
}
=20
+ // %d means print a 32-bit integer.
+ // %ld means print a word-size integer.
+ // %lld means print a 64-bit integer.
+ if (0 =3D=3D n_ls) { is_long =3D False; }
+ else if (1 =3D=3D n_ls) { is_long =3D ( sizeof(void*) =3D=3D sizeo=
f(Long) ); }
+ else { is_long =3D True; }
+
switch (format[i]) {
case 'd': /* %d */
flags |=3D VG_MSG_SIGNED;
Modified: trunk/coregrind/m_syswrap/syswrap-generic.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_syswrap/syswrap-generic.c 2005-08-26 18:10:45 UTC (=
rev 4526)
+++ trunk/coregrind/m_syswrap/syswrap-generic.c 2005-08-26 19:42:27 UTC (=
rev 4527)
@@ -2718,7 +2718,7 @@
PRE(sys_ftruncate)
{
*flags |=3D SfMayBlock;
- PRINT("sys_ftruncate ( %d, %lld )", ARG1,(ULong)ARG2);
+ PRINT("sys_ftruncate ( %d, %ld )", ARG1,ARG2);
PRE_REG_READ2(long, "ftruncate", unsigned int, fd, unsigned long, len=
gth);
}
=20
Modified: trunk/coregrind/m_syswrap/syswrap-linux.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_syswrap/syswrap-linux.c 2005-08-26 18:10:45 UTC (re=
v 4526)
+++ trunk/coregrind/m_syswrap/syswrap-linux.c 2005-08-26 19:42:27 UTC (re=
v 4527)
@@ -456,7 +456,7 @@
PRE(sys_sendfile)
{
*flags |=3D SfMayBlock;
- PRINT("sys_sendfile ( %d, %d, %p, %llu )", ARG1,ARG2,ARG3,(ULong)ARG4=
);
+ PRINT("sys_sendfile ( %d, %d, %p, %lu )", ARG1,ARG2,ARG3,ARG4);
PRE_REG_READ4(ssize_t, "sendfile",
int, out_fd, int, in_fd, vki_off_t *, offset,
vki_size_t, count);
@@ -473,7 +473,7 @@
PRE(sys_sendfile64)
{
*flags |=3D SfMayBlock;
- PRINT("sendfile64 ( %d, %d, %p, %llu )",ARG1,ARG2,ARG3,(ULong)ARG4);
+ PRINT("sendfile64 ( %d, %d, %p, %lu )",ARG1,ARG2,ARG3,ARG4);
PRE_REG_READ4(ssize_t, "sendfile64",
int, out_fd, int, in_fd, vki_loff_t *, offset,
vki_size_t, count);
@@ -794,7 +794,7 @@
{
Int i;
=20
- PRINT("sys_io_submit ( %llu, %lld, %p )", (ULong)ARG1,(Long)ARG2,ARG3=
);
+ PRINT("sys_io_submit ( %llu, %ld, %p )", (ULong)ARG1,ARG2,ARG3);
PRE_REG_READ3(long, "io_submit",
vki_aio_context_t, ctx_id, long, nr,
struct iocb **, iocbpp);
Modified: trunk/massif/ms_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/massif/ms_main.c 2005-08-26 18:10:45 UTC (rev 4526)
+++ trunk/massif/ms_main.c 2005-08-26 19:42:27 UTC (rev 4527)
@@ -1531,7 +1531,7 @@
// tl_assert(sum <=3D xpt->exact_ST_dbld);
// tl_assert(sum * 1.05 > xpt->exact_ST_dbld );
// if (sum !=3D xpt->exact_ST_dbld) {
-// VG_(printf)("%ld, %ld\n", sum, xpt->exact_ST_dbld);
+// VG_(printf)("%lld, %lld\n", sum, xpt->exact_ST_dbld);
// }
}
=20
|
|
From: Tom H. <to...@co...> - 2005-08-26 18:45:57
|
In message <200...@ac...>
Julian Seward <js...@ac...> wrote:
> > Alternatively, you could link with -nostartfiles, which will omit
> > crt1.o completely. In that case you need your own start.S that
> > provides a _start() function that processes auxv and calls Valgrind's
> > main().
>
> Did that. It seems to work. Cool. Just committed revs 1363 and 4526.
Hmm. It's not fully working for me... The problem is that gcc is
inserting calls to memcpy to handle structure assignments and those
are then unresolved when linking.
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|
|
From: Tom H. <to...@co...> - 2005-08-26 18:29:24
|
In message <200...@ac...>
Julian Seward <js...@ac...> wrote:
>
> > Alternatively, you could link with -nostartfiles, which will omit
> > crt1.o completely. In that case you need your own start.S that
> > provides a _start() function that processes auxv and calls Valgrind's
> > main().
>
> Did that. It seems to work. Cool. Just committed revs 1363 and 4526.
So I see. I was just about to post my version which does it all
in assembly:
asm("\t.globl _start\n"
"\t.type _start,@function\n"
"_start:\n"
"\tpopl %esi\n"
"\tmovl %esp, %ecx\n"
"\tand $0xfffffff0, %esp\n"
"\tmovl %esi, %eax\n"
"\tincl %eax\n"
"\tshl $2, %eax\n"
"\taddl %ecx, %eax\n"
"\tpushl %eax\n"
"\tpushl %ecx\n"
"\tpushl %esi\n"
"\tcall main\n"
"\tmov %eax, %ebx\n"
"\tmov $1, %eax\n"
"\tint $0x80\n"
"\thlt\n");
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|
|
From: Julian S. <js...@ac...> - 2005-08-26 18:16:41
|
> Alternatively, you could link with -nostartfiles, which will omit > crt1.o completely. In that case you need your own start.S that > provides a _start() function that processes auxv and calls Valgrind's > main(). Did that. It seems to work. Cool. Just committed revs 1363 and 4526. Thanks, Tom, Greg. So it looks as if statically linked, glibc-free Valgrind is a viable idea. J |
|
From: <sv...@va...> - 2005-08-26 18:10:50
|
Author: sewardj
Date: 2005-08-26 19:10:45 +0100 (Fri, 26 Aug 2005)
New Revision: 4526
Log:
Completely remove the need for glibc in (experimental, statically
linked) Valgrind.
This commit:
- replaces a bunch of glibc functions with valgrind's m_libc*
equivalents
- does passes linker flags in memcheck/ so that glibc isn't even
linked
- adds our own _start in m_main.c, which establishes argc/argv/envp
and calls onwards to main()
The resulting memcheck works, except for timestamps and debug
attaching, neither of which are critical.
Modified:
branches/ASPACEM/coregrind/m_debugger.c
branches/ASPACEM/coregrind/m_libcfile.c
branches/ASPACEM/coregrind/m_libcprint.c
branches/ASPACEM/coregrind/m_libcproc.c
branches/ASPACEM/coregrind/m_main.c
branches/ASPACEM/coregrind/m_scheduler/scheduler.c
branches/ASPACEM/coregrind/m_signals.c
branches/ASPACEM/coregrind/m_ume.c
branches/ASPACEM/coregrind/pub_core_libcfile.h
branches/ASPACEM/coregrind/pub_core_libcproc.h
branches/ASPACEM/include/vki-linux.h
branches/ASPACEM/include/vki-x86-linux.h
branches/ASPACEM/memcheck/Makefile.am
Modified: branches/ASPACEM/coregrind/m_debugger.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_debugger.c 2005-08-26 13:24:10 UTC (rev =
4525)
+++ branches/ASPACEM/coregrind/m_debugger.c 2005-08-26 18:10:45 UTC (rev =
4526)
@@ -40,12 +40,14 @@
=20
// We can remove these easily by implementing our own VG_(ptrace)() and
// VG_(fork)().
-#include <sys/ptrace.h>
-#include <sys/wait.h>
-#include <unistd.h>
+//#include <sys/ptrace.h>
+//#include <sys/wait.h>
+//#include <unistd.h>
=20
static Int ptrace_setregs(Int pid, VexGuestArchState* vex)
{
+ I_die_here;
+#if 0
struct vki_user_regs_struct regs;
#if defined(VGA_x86)
regs.cs =3D vex->guest_CS;
@@ -93,6 +95,7 @@
#else
# error Unknown arch
#endif
+#endif /* 0 */
}
=20
/* Start debugger and get it to attach to this process. Called if the
@@ -102,7 +105,9 @@
continue, quit the debugger. */
void VG_(start_debugger) ( ThreadId tid )
{
- Int pid;
+ I_die_here;
+#if 0
+ Int pid;
=20
if ((pid =3D fork()) =3D=3D 0) {
ptrace(PTRACE_TRACEME, 0, NULL, NULL);
@@ -172,6 +177,7 @@
VG_(kill)(pid, VKI_SIGKILL);
VG_(waitpid)(pid, &status, 0);
}
+#endif
}
=20
=20
Modified: branches/ASPACEM/coregrind/m_libcfile.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_libcfile.c 2005-08-26 13:24:10 UTC (rev =
4525)
+++ branches/ASPACEM/coregrind/m_libcfile.c 2005-08-26 18:10:45 UTC (rev =
4526)
@@ -203,13 +203,13 @@
#endif
}
=20
-SSizeT VG_(pread) ( Int fd, void* buf, Int count, Int offset )
+SysRes VG_(pread) ( Int fd, void* buf, Int count, Int offset )
{
OffT off =3D VG_(lseek)( fd, (OffT)offset, VKI_SEEK_SET);
if (off !=3D 0)
- return (SSizeT)(-1);
+ return VG_(mk_SysRes_Error)( VKI_EINVAL );
SysRes res =3D VG_(do_syscall3)(__NR_read, fd, (UWord)buf, count );
- return (SSizeT)( res.isError ? -1 : res.val);
+ return res;
}
=20
/* ---------------------------------------------------------------------
Modified: branches/ASPACEM/coregrind/m_libcprint.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_libcprint.c 2005-08-26 13:24:10 UTC (rev=
4525)
+++ branches/ASPACEM/coregrind/m_libcprint.c 2005-08-26 18:10:45 UTC (rev=
4526)
@@ -38,8 +38,6 @@
#include "pub_core_options.h"
#include "valgrind.h" // For RUNNING_ON_VALGRIND
=20
-#include <time.h>
-#include <sys/time.h>
=20
=20
/* ---------------------------------------------------------------------
@@ -256,9 +254,10 @@
=20
void VG_(ctime) ( /*OUT*/HChar* buf )
{
+#if 0
struct timeval tv;
struct tm tm;
- buf[0] =3D 0; =20
+ buf[0] =3D 0;
if ( gettimeofday( &tv, NULL ) =3D=3D 0
&& localtime_r( &tv.tv_sec, &tm ) =3D=3D &tm )
{
@@ -267,6 +266,9 @@
tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
tm.tm_hour, tm.tm_min, tm.tm_sec, tv.tv_usec / 1000 =
);
}
+#else
+ VG_(strcpy)(buf, "VG_(ctime) HACK!");
+#endif
}
=20
=20
Modified: branches/ASPACEM/coregrind/m_libcproc.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_libcproc.c 2005-08-26 13:24:10 UTC (rev =
4525)
+++ branches/ASPACEM/coregrind/m_libcproc.c 2005-08-26 18:10:45 UTC (rev =
4526)
@@ -400,7 +400,32 @@
return VG_(do_syscall0)(__NR_getegid) . val;
}
=20
+/* Get supplementary groups into list[0 .. size-1]. Returns the
+ number of groups written, or -1 if error. Note that in order to be
+ portable, the groups are 32-bit unsigned ints regardless of the
+ platform. */
+Int VG_(getgroups)( Int size, UInt* list )
+{
+# if defined(VGP_x86_linux)
+ Int i;
+ SysRes sres;
+ UShort list16[32];
+ if (size < 0) return -1;
+ if (size > 32) size =3D 32;
+ sres =3D VG_(do_syscall2)(__NR_getgroups, size, (Addr)list16);
+ if (sres.isError)
+ return -1;
+ if (sres.val !=3D size)
+ return -1;
+ for (i =3D 0; i < size; i++)
+ list[i] =3D (UInt)list16[i];
+ return size;
=20
+# else
+# error "VG_(getgroups): needs implementation on this platform"
+# endif
+}
+
/* ---------------------------------------------------------------------
Timing stuff
------------------------------------------------------------------ */
Modified: branches/ASPACEM/coregrind/m_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_main.c 2005-08-26 13:24:10 UTC (rev 4525=
)
+++ branches/ASPACEM/coregrind/m_main.c 2005-08-26 18:10:45 UTC (rev 4526=
)
@@ -211,8 +211,56 @@
/*=3D=3D=3D Address space determination =
=3D=3D=3D*/
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
=20
+/* Glibc's sysdeps/i386/elf/start.S has the following gem of a
+ comment, which explains how the stack looks right at process start
+ (when _start is jumped to). Hence _start passes %esp to
+ _start_in_C, which extracts argc/argv/envp and starts up
+ correctly. */
+
+/* This is the canonical entry point, usually the first thing in the tex=
t
+ segment. The SVR4/i386 ABI (pages 3-31, 3-32) says that when the ent=
ry
+ point runs, most registers' values are unspecified, except for:
+
+ %edx Contains a function pointer to be registered with `atexi=
t'.
+ This is how the dynamic linker arranges to have DT_FINI
+ functions called for shared libraries that have been loa=
ded
+ before this code runs.
+
+ %esp The stack contains the arguments and environment:
+ 0(%esp) argc
+ 4(%esp) argv[0]
+ ...
+ (4*argc)(%esp) NULL
+ (4*(argc+1))(%esp) envp[0]
+ ...
+ NULL
+*/
+
extern char _start[];
=20
+asm("\n"
+ "\t.globl _start\n"
+ "\t.type _start,@function\n"
+ "_start:\n"
+ "\tmovl %esp,%eax\n"
+ "\tpushl %eax\n"
+ "\tcall _start_in_C\n"
+ "\thlt\n"
+);
+
+extern Int main (Int argc, HChar **argv, HChar **envp);
+
+static void _start_in_C ( Int* pArgc )
+{
+ Int argc =3D pArgc[0];
+ HChar** argv =3D (HChar**)&pArgc[1];
+ HChar** envp =3D (HChar**)&pArgc[1+argc+1];
+ Int r =3D main(argc,argv,envp);
+ VG_(exit)(r);
+}
+
+///////////////////////////////////////////////////////////////
+
static void layout_remaining_space(Addr argc_addr, float ratio)
{
SysRes res;
@@ -2846,6 +2894,7 @@
}
}
=20
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: branches/ASPACEM/coregrind/m_scheduler/scheduler.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_scheduler/scheduler.c 2005-08-26 13:24:1=
0 UTC (rev 4525)
+++ branches/ASPACEM/coregrind/m_scheduler/scheduler.c 2005-08-26 18:10:4=
5 UTC (rev 4526)
@@ -332,7 +332,7 @@
do { \
ThreadState * volatile _qq_tst =3D VG_(get_ThreadState)(tid); \
\
- (jumped) =3D setjmp(_qq_tst->sched_jmpbuf); =
\
+ (jumped) =3D __builtin_setjmp(_qq_tst->sched_jmpbuf); =
\
if ((jumped) =3D=3D 0) { \
vg_assert(!_qq_tst->sched_jmpbuf_valid); \
_qq_tst->sched_jmpbuf_valid =3D True; \
Modified: branches/ASPACEM/coregrind/m_signals.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_signals.c 2005-08-26 13:24:10 UTC (rev 4=
525)
+++ branches/ASPACEM/coregrind/m_signals.c 2005-08-26 18:10:45 UTC (rev 4=
526)
@@ -1508,7 +1508,7 @@
if (tst->sched_jmpbuf_valid) {
/* Can't continue; must longjmp back to the scheduler and thus
enter the sighandler immediately. */
- longjmp(tst->sched_jmpbuf, True);
+ __builtin_longjmp(tst->sched_jmpbuf, True);
}
}
=20
Modified: branches/ASPACEM/coregrind/m_ume.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_ume.c 2005-08-26 13:24:10 UTC (rev 4525)
+++ branches/ASPACEM/coregrind/m_ume.c 2005-08-26 18:10:45 UTC (rev 4526)
@@ -54,16 +54,7 @@
=20
#include "pub_core_ume.h"
=20
-//#include <sys/mman.h>
-#include <fcntl.h>
-#include <errno.h>
=20
-//#include <string.h>
-//#include <stdlib.h>
-//#include <unistd.h>
-//#include <assert.h>
-
-
// HACK HACK HACK HACK HACK HACK HACK HACK HACK HACK HACK HACK HACK A
// temporary bootstrapping allocator, for use until such time as we
// can get rid of the circularites in allocator dependencies at
@@ -306,15 +297,17 @@
static=20
struct elfinfo *readelf(int fd, const char *filename)
{
+ SysRes sres;
struct elfinfo *e =3D hack_malloc(sizeof(*e));
int phsz;
=20
vg_assert(e);
e->fd =3D fd;
=20
- if (VG_(pread)(fd, &e->e, sizeof(e->e), 0) !=3D sizeof(e->e)) {
+ sres =3D VG_(pread)(fd, &e->e, sizeof(e->e), 0);
+ if (sres.isError || sres.val !=3D sizeof(e->e)) {
VG_(printf)("valgrind: %s: can't read ELF header: %s\n",=20
- filename, VG_(strerror)(errno));
+ filename, VG_(strerror)(sres.val));
goto bad;
}
=20
@@ -351,9 +344,10 @@
e->p =3D hack_malloc(phsz);
vg_assert(e->p);
=20
- if (VG_(pread)(fd, e->p, phsz, e->e.e_phoff) !=3D phsz) {
+ sres =3D VG_(pread)(fd, e->p, phsz, e->e.e_phoff);
+ if (sres.isError || sres.val !=3D phsz) {
VG_(printf)("valgrind: can't read phdr: %s\n",=20
- VG_(strerror)(errno));
+ VG_(strerror)(sres.val));
//FIXME VG_(free)(e->p);
goto bad;
}
@@ -456,6 +450,7 @@
}
=20
// Forward declaration.
+/* returns: 0 =3D success, non-0 is failure */
static int do_exec_inner(const char *exe, struct exeinfo *info);
=20
static int match_ELF(const char *hdr, int len)
@@ -467,6 +462,7 @@
static int load_ELF(char *hdr, int len, int fd, const char *name,
struct exeinfo *info)
{
+ SysRes sres;
struct elfinfo *e;
struct elfinfo *interp =3D NULL;
ESZ(Addr) minaddr =3D ~0; /* lowest mapped address */
@@ -485,7 +481,7 @@
e =3D readelf(fd, name);
=20
if (e =3D=3D NULL)
- return ENOEXEC;
+ return VKI_ENOEXEC;
=20
/* The kernel maps position-independent executables at TASK_SIZE*2/3;
duplicate this behavior as close as we can. */
@@ -522,11 +518,12 @@
VG_(pread)(fd, buf, ph->p_filesz, ph->p_offset);
buf[ph->p_filesz] =3D '\0';
=20
- intfd =3D open(buf, O_RDONLY);
- if (intfd =3D=3D -1) {
+ sres =3D VG_(open)(buf, VKI_O_RDONLY, 0);
+ if (sres.isError) {
VG_(printf)("valgrind: m_ume.c: can't open interpreter\n");
VG_(exit)(1);
}
+ intfd =3D sres.val;
=20
interp =3D readelf(intfd, buf);
if (interp =3D=3D NULL) {
@@ -575,14 +572,14 @@
"acceptable range %p-%p\n",
(void *)minaddr + ebase, (void *)maxaddr + ebase,
(void *)info->exe_base, (void *)info->exe_end);
- return ENOMEM;
+ return VKI_ENOMEM;
}
}
=20
info->brkbase =3D mapelf(e, ebase); /* map the executable */
=20
if (info->brkbase =3D=3D 0)
- return ENOMEM;
+ return VKI_ENOMEM;
=20
if (interp !=3D NULL) {
/* reserve a chunk of address space for interpreter */
@@ -632,6 +629,7 @@
return (len > 2) && VG_(memcmp)(hdr, "#!", 2) =3D=3D 0;
}
=20
+/* returns: 0 =3D success, non-0 is failure */
static int load_script(char *hdr, int len, int fd, const char *name,
struct exeinfo *info)
{
@@ -646,7 +644,7 @@
interp++;
=20
if (*interp !=3D '/')
- return ENOEXEC; /* absolute path only for interpreter */
+ return VKI_ENOEXEC; /* absolute path only for interpreter */
=20
/* skip over interpreter name */
for(cp =3D interp; cp < end && *cp !=3D ' ' && *cp !=3D '\t' && *cp !=
=3D '\n'; cp++)
@@ -696,50 +694,54 @@
(otherwise the executable may misbehave if it doesn't have the
permissions it thinks it does).
*/
+/* returns: 0 =3D success, non-0 is failure */
static int check_perms(int fd)
{
- struct stat st;
+ struct vki_stat st;
=20
- if (fstat(fd, &st) =3D=3D -1)=20
- return errno;
+ if (VG_(fstat)(fd, &st) =3D=3D -1)=20
+ return VKI_EACCES;
=20
- if (st.st_mode & (S_ISUID | S_ISGID)) {
+ if (st.st_mode & (VKI_S_ISUID | VKI_S_ISGID)) {
//VG_(printf)("Can't execute suid/sgid executable %s\n", exe);
- return EACCES;
+ return VKI_EACCES;
}
=20
if (VG_(geteuid)() =3D=3D st.st_uid) {
- if (!(st.st_mode & S_IXUSR))
- return EACCES;
+ if (!(st.st_mode & VKI_S_IXUSR))
+ return VKI_EACCES;
} else {
int grpmatch =3D 0;
=20
if (VG_(getegid)() =3D=3D st.st_gid)
grpmatch =3D 1;
else {
- gid_t groups[32];
- int ngrp =3D getgroups(32, groups);
- int i;
-
- for(i =3D 0; i < ngrp; i++)
+ UInt groups[32];
+ Int ngrp =3D VG_(getgroups)(32, groups);
+ Int i;
+ /* ngrp will be -1 if VG_(getgroups) failed. */
+ for (i =3D 0; i < ngrp; i++) {
if (groups[i] =3D=3D st.st_gid) {
grpmatch =3D 1;
break;
}
+ }
}
=20
if (grpmatch) {
- if (!(st.st_mode & S_IXGRP))
- return EACCES;
- } else if (!(st.st_mode & S_IXOTH))
- return EACCES;
+ if (!(st.st_mode & VKI_S_IXGRP))
+ return VKI_EACCES;
+ } else if (!(st.st_mode & VKI_S_IXOTH))
+ return VKI_EACCES;
}
=20
return 0;
}
=20
+/* returns: 0 =3D success, non-0 is failure */
static int do_exec_inner(const char *exe, struct exeinfo *info)
{
+ SysRes sres;
int fd;
int err;
char buf[VKI_PAGE_SIZE];
@@ -755,13 +757,14 @@
{ match_script, load_script },
};
=20
- fd =3D open(exe, O_RDONLY);
- if (fd =3D=3D -1) {
+ sres =3D VG_(open)(exe, VKI_O_RDONLY, 0);
+ if (sres.isError) {
if (0)
VG_(printf)("Can't open executable %s: %s\n",
- exe, VG_(strerror)(errno));
- return errno;
+ exe, VG_(strerror)(sres.val));
+ return sres.val;
}
+ fd =3D sres.val;
=20
err =3D check_perms(fd);
if (err !=3D 0) {
@@ -769,15 +772,16 @@
return err;
}
=20
- bufsz =3D VG_(pread)(fd, buf, sizeof(buf), 0);
- if (bufsz < 0) {
+ sres =3D VG_(pread)(fd, buf, sizeof(buf), 0);
+ if (sres.isError || sres.val !=3D sizeof(buf)) {
VG_(printf)("Can't read executable header: %s\n",
- VG_(strerror)(errno));
+ VG_(strerror)(sres.val));
VG_(close)(fd);
- return errno;
+ return sres.val;
}
+ bufsz =3D sres.val;
=20
- ret =3D ENOEXEC;
+ ret =3D VKI_ENOEXEC;
for(i =3D 0; i < sizeof(formats)/sizeof(*formats); i++) {
if ((formats[i].match)(buf, bufsz)) {
ret =3D (formats[i].load)(buf, bufsz, fd, exe, info);
@@ -792,6 +796,7 @@
=20
// See ume.h for an indication of which entries of 'info' are inputs, wh=
ich
// are outputs, and which are both.
+/* returns: 0 =3D success, non-0 is failure */
int VG_(do_exec)(const char *exe, struct exeinfo *info)
{
info->interp_name =3D NULL;
Modified: branches/ASPACEM/coregrind/pub_core_libcfile.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/pub_core_libcfile.h 2005-08-26 13:24:10 UT=
C (rev 4525)
+++ branches/ASPACEM/coregrind/pub_core_libcfile.h 2005-08-26 18:10:45 UT=
C (rev 4526)
@@ -62,7 +62,7 @@
=20
extern Int VG_(access) ( HChar* path, Bool irusr, Bool iwusr, Bool ixusr=
);
=20
-extern SSizeT VG_(pread) ( Int fd, void* buf, Int count, Int offset );
+extern SysRes VG_(pread) ( Int fd, void* buf, Int count, Int offset );
=20
#endif // __PUB_CORE_LIBCFILE_H
=20
Modified: branches/ASPACEM/coregrind/pub_core_libcproc.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/pub_core_libcproc.h 2005-08-26 13:24:10 UT=
C (rev 4525)
+++ branches/ASPACEM/coregrind/pub_core_libcproc.h 2005-08-26 18:10:45 UT=
C (rev 4526)
@@ -73,8 +73,9 @@
extern Char **VG_(env_clone) ( Char **env_clone );
=20
// misc
-extern Int VG_(poll)( struct vki_pollfd *, UInt nfds, Int timeout);
+extern Int VG_(poll)( struct vki_pollfd *, UInt nfds, Int timeout);
extern void VG_(nanosleep) ( struct vki_timespec * );
+extern Int VG_(getgroups)( Int size, UInt* list );
=20
// atfork
typedef void (*vg_atfork_t)(ThreadId);
Modified: branches/ASPACEM/include/vki-linux.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/include/vki-linux.h 2005-08-26 13:24:10 UTC (rev 452=
5)
+++ branches/ASPACEM/include/vki-linux.h 2005-08-26 18:10:45 UTC (rev 452=
6)
@@ -1021,6 +1021,7 @@
#define VKI_EPERM 1 /* Operation not permitted */
#define VKI_ESRCH 3 /* No such process */
#define VKI_EINTR 4 /* Interrupted system call */
+#define VKI_ENOEXEC 8 /* Exec format error */
#define VKI_EBADF 9 /* Bad file number */
#define VKI_EAGAIN 11 /* Try again */
#define VKI_EWOULDBLOCK VKI_EAGAIN
Modified: branches/ASPACEM/include/vki-x86-linux.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/include/vki-x86-linux.h 2005-08-26 13:24:10 UTC (rev=
4525)
+++ branches/ASPACEM/include/vki-x86-linux.h 2005-08-26 18:10:45 UTC (rev=
4526)
@@ -315,12 +315,12 @@
#define VKI_SIOCGSTAMP 0x8906 /* Get stamp */
=20
//----------------------------------------------------------------------
-// From linux-2.6.8.1/include/asm-i386/stat.h
+// From linux-2.6.8.1/include/linux/stat.h
//----------------------------------------------------------------------
=20
#define VKI_S_IFMT 00170000
#define VKI_S_IFSOCK 0140000
-#define VKI_S_IFLNK 0120000
+#define VKI_S_IFLNK 0120000
#define VKI_S_IFREG 0100000
#define VKI_S_IFBLK 0060000
#define VKI_S_IFDIR 0040000
@@ -338,6 +338,21 @@
#define VKI_S_ISFIFO(m) (((m) & VKI_S_IFMT) =3D=3D VKI_S_IFIFO)
#define VKI_S_ISSOCK(m) (((m) & VKI_S_IFMT) =3D=3D VKI_S_IFSOCK)
=20
+#define VKI_S_IRWXU 00700
+#define VKI_S_IRUSR 00400
+#define VKI_S_IWUSR 00200
+#define VKI_S_IXUSR 00100
+
+#define VKI_S_IRWXG 00070
+#define VKI_S_IRGRP 00040
+#define VKI_S_IWGRP 00020
+#define VKI_S_IXGRP 00010
+
+#define VKI_S_IRWXO 00007
+#define VKI_S_IROTH 00004
+#define VKI_S_IWOTH 00002
+#define VKI_S_IXOTH 00001
+
struct vki_stat {
unsigned long st_dev;
unsigned long st_ino;
Modified: branches/ASPACEM/memcheck/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/memcheck/Makefile.am 2005-08-26 13:24:10 UTC (rev 45=
25)
+++ branches/ASPACEM/memcheck/Makefile.am 2005-08-26 18:10:45 UTC (rev 45=
26)
@@ -26,7 +26,8 @@
-static \
$(top_srcdir)/coregrind/libcoregrind.a \
-Wl,-defsym,valt_load_address=3D@VALT_LOAD_ADDRESS@ \
- -Wl,-T,$(top_srcdir)/valt_load_address.lds
+ -Wl,-T,$(top_srcdir)/valt_load_address.lds \
+ -nodefaultlibs -lgcc -nostartfiles
=20
mcincludedir =3D $(includedir)/valgrind
=20
|
|
From: <sv...@va...> - 2005-08-26 18:00:37
|
Author: sewardj
Date: 2005-08-26 19:00:31 +0100 (Fri, 26 Aug 2005)
New Revision: 1363
Log:
Don't even mention malloc, since it screws up statically linked, glibc
Valgrind.
Modified:
trunk/priv/main/vex_util.c
Modified: trunk/priv/main/vex_util.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/priv/main/vex_util.c 2005-08-25 21:34:24 UTC (rev 1362)
+++ trunk/priv/main/vex_util.c 2005-08-26 18:00:31 UTC (rev 1363)
@@ -102,10 +102,10 @@
# define ALIGN (sizeof(void*)-1)
vassert(vex_initdone);
vassert(nbytes >=3D 0);
- if (vex_valgrind_support) {
+ if (0 && vex_valgrind_support) {
/* ugly hack -- do not remove */
- extern void* malloc ( int );
- return malloc(nbytes);
+ //extern void* malloc ( int );
+ //return malloc(nbytes);
} else {
nbytes =3D (nbytes + ALIGN) & ~ALIGN;
if (mode =3D=3D VexAllocModeTEMP) {
|
|
From: Greg P. <gp...@us...> - 2005-08-26 17:51:05
|
Nicholas Nethercote writes: > On Thu, 25 Aug 2005, Greg Parker wrote: > > I'm not sure how much time I'll spend on the PPC and x86 versions. > > Part of that depends on whether the Linux/PPC version keeps mostly > > ahead of what I need. Eventually, I expect ports for both > > architectures. > > I'm confused by this... can you run Darwin on x86 now, even if it's not > the full MacOS X? Yes, Darwin/x86 is available to everyone today, assuming you have hardware that falls under its driver support. -- Greg Parker gp...@us... |
|
From: Greg P. <gp...@us...> - 2005-08-26 17:43:18
|
Julian Seward writes: > However: I can't get it to link with "-nodefaultlibs -lgcc". The > invokation and results are shown below. Anybody have any idea what > I should do? The no-linking-glibc-world is one I know nothing about. > > /usr/lib/gcc-lib/i586-suse-linux/3.3.4/../../../crt1.o(.text+0xc): In function > `_start': > ../sysdeps/i386/elf/start.S:109: undefined reference to `__libc_csu_fini' > /usr/lib/gcc-lib/i586-suse-linux/3.3.4/../../../crt1.o(.text+0x11):../sysdeps/i386/elf/start.S:110: > undefined reference to `__libc_csu_init' > /usr/lib/gcc-lib/i586-suse-linux/3.3.4/../../../crt1.o(.text+0x1d):../sysdeps/i386/elf/start.S:119: > undefined reference to `__libc_start_main' > collect2: ld returned 1 exit status Currently, your build is still using the default crt1.o. In crt1.o, _start() calls __libc_csu_init() and __libc_start_main(), which are probably part of glibc's initialization. You might be able to get away with providing empty versions of those functions, since your pseudo-libc does all of its initialization in Valgrind's main(). (__libc_start_main() might be expected to call main() itself; check glibc's source.) Alternatively, you could link with -nostartfiles, which will omit crt1.o completely. In that case you need your own start.S that provides a _start() function that processes auxv and calls Valgrind's main(). You'd likely want to start with gcc's start.S (the one that becomes crt1.o) and hack from there. In either case, if Valgrind has any C++ static initializers or __attribute__((constructor)) functions, you'll need to handle them yourself. I expect that there aren't any. On Mac OS X and Valgrind 2.x, I used the second solution, because the default start files there have lots of historical ugliness. -- Greg Parker gp...@us... |
|
From: Julian S. <js...@ac...> - 2005-08-26 17:18:52
|
> I think you need -nostartfiles as well.
If I add that, then it complains about a lack of "_start" but nothing
else.
So I added this to m_main.c:
//extern char _start[];
extern Int main (Int argc, HChar **argv, HChar **envp);
Int _start (Int argc, HChar **argv, HChar **envp)
{
return main(argc,argv,envp);
}
and it links. So I get a warm fuzzy feeling.
However, it segfaults at startup. Stepping through with GDB, it dies
when looking for auxv on the stack. And the args to main are obviously
bogus:
main (argc=-1073745111, argv=0x0, envp=0xbffff364) at m_main.c:2352
So I guess my crude scheme of calling main from _start ain't going to
work.
Now what? Should _start do some futzing around with the
initial stack that the kernel builds, so as to get a correct
argc/v/envp ?
J
|
|
From: Tom H. <to...@co...> - 2005-08-26 16:44:02
|
In message <Pin...@ch...>
Nicholas Nethercote <nj...@cs...> wrote:
> On Fri, 26 Aug 2005, Julian Seward wrote:
>
> > (For the curious: I replaced all glibc uses by our own implementations,
> > apart from three which are non-essential and hard to do:
> > localtime_r in VG_(ctime)
> > ptrace in m_debugger.c
> > fork in m_debugger.c.
> > If anyone has enthusiasm to hack up standalone replacements, especially
> > for localtime_r, please hack on!)
>
> For ptrace and fork don't we just need trivial wrappers for the syscalls?
More or less, although fork is slightly more complicated I think
because it returns to two different threads of control.
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|
|
From: Tom H. <to...@co...> - 2005-08-26 16:43:00
|
In message <200...@ac...>
Julian Seward <js...@ac...> wrote:
> sewardj@feenicks:~/VgASPACEM/aspacem/memcheck$
> (cd ../coregrind && make) \
> && gcc -Wmissing-prototypes -Winline -Wall -Wshadow -O -g -m32 \
> -mpreferred-stack-boundary=2 -O2 -Wno-long-long -o valgrind_memcheck \
> -static ../coregrind/libcoregrind.a \
> -Wl,-defsym,valt_load_address=0xb0000000 \
> -Wl,-T,../valt_load_address.lds mac_leakcheck.o \
> mac_malloc_wrappers.o mc_main.o mac_shared.o mc_translate.o \
> -nodefaultlibs -lgcc
>
> /usr/lib/gcc-lib/i586-suse-linux/3.3.4/../../../crt1.o(.text+0xc): In function
> `_start':
> ../sysdeps/i386/elf/start.S:109: undefined reference to `__libc_csu_fini'
> /usr/lib/gcc-lib/i586-suse-linux/3.3.4/../../../crt1.o(.text+0x11):../sysdeps/i386/elf/start.S:110:
> undefined reference to `__libc_csu_init'
> /usr/lib/gcc-lib/i586-suse-linux/3.3.4/../../../crt1.o(.text+0x1d):../sysdeps/i386/elf/start.S:119:
> undefined reference to `__libc_start_main'
> collect2: ld returned 1 exit status
I think you need -nostartfiles as well. At the moment it is linking
crt1.o which is trying to start the C library (it pushs the address
of main and that of those init and fini functions and then calls
__libc_start_main to start the C library.
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|
|
From: Nicholas N. <nj...@cs...> - 2005-08-26 16:34:24
|
On Fri, 26 Aug 2005, Julian Seward wrote:
> However: I can't get it to link with "-nodefaultlibs -lgcc". The
> invokation and results are shown below. Anybody have any idea what
> I should do? The no-linking-glibc-world is one I know nothing about.
I'd try to get it working on a trivial case before plumbing it into
Valgrind. I don't even know how to do that, though:
[~/grind/trunk5] cat a.c
int main(void)
{
return 0;
}
[~/grind/trunk5] gcc -nodefaultlibs -lgcc a.c
/usr/lib/crt1.o(.text+0x1d): In function `_start':
: undefined reference to `__libc_start_main'
collect2: ld returned 1 exit status
I also tried -nostdlib
[~/grind/trunk5] gcc -nostdlib -lgcc a.c
/lusr/opt/binutils-2.15/bin/ld: warning: cannot find entry symbol
_start; defaulting to 08048094
[~/grind/trunk5] a.out
Segmentation fault
I don't know.
> (For the curious: I replaced all glibc uses by our own implementations,
> apart from three which are non-essential and hard to do:
> localtime_r in VG_(ctime)
> ptrace in m_debugger.c
> fork in m_debugger.c.
> If anyone has enthusiasm to hack up standalone replacements, especially
> for localtime_r, please hack on!)
For ptrace and fork don't we just need trivial wrappers for the syscalls?
Nick
|
|
From: Julian S. <js...@ac...> - 2005-08-26 16:24:18
|
Greetings. I've been doing some hacking :-) aimed at getting rid
of all glibc dependencies (on the ASPACEM branch, if you want to see).
So, as of 1 minute ago, I have a statically linked valgrind_memcheck
that appears to work, and which depends on no glibc symbols.
How do I know? Because I've been linking with "-nodefaultlibs -lgcc",
which causes the linker to complain if any glibc-defined symbols are
used. So I've slowly been whittling these down to zero.
Ideally I'd like the build to use these flags, since it will cause
the build to fail in an obvious way if any glibc symbols creep back in.
However: I can't get it to link with "-nodefaultlibs -lgcc". The
invokation and results are shown below. Anybody have any idea what
I should do? The no-linking-glibc-world is one I know nothing about.
(For the curious: I replaced all glibc uses by our own implementations,
apart from three which are non-essential and hard to do:
localtime_r in VG_(ctime)
ptrace in m_debugger.c
fork in m_debugger.c.
If anyone has enthusiasm to hack up standalone replacements, especially
for localtime_r, please hack on!)
J
sewardj@feenicks:~/VgASPACEM/aspacem/memcheck$
(cd ../coregrind && make) \
&& gcc -Wmissing-prototypes -Winline -Wall -Wshadow -O -g -m32 \
-mpreferred-stack-boundary=2 -O2 -Wno-long-long -o valgrind_memcheck \
-static ../coregrind/libcoregrind.a \
-Wl,-defsym,valt_load_address=0xb0000000 \
-Wl,-T,../valt_load_address.lds mac_leakcheck.o \
mac_malloc_wrappers.o mc_main.o mac_shared.o mc_translate.o \
-nodefaultlibs -lgcc
/usr/lib/gcc-lib/i586-suse-linux/3.3.4/../../../crt1.o(.text+0xc): In function
`_start':
../sysdeps/i386/elf/start.S:109: undefined reference to `__libc_csu_fini'
/usr/lib/gcc-lib/i586-suse-linux/3.3.4/../../../crt1.o(.text+0x11):../sysdeps/i386/elf/start.S:110:
undefined reference to `__libc_csu_init'
/usr/lib/gcc-lib/i586-suse-linux/3.3.4/../../../crt1.o(.text+0x1d):../sysdeps/i386/elf/start.S:119:
undefined reference to `__libc_start_main'
collect2: ld returned 1 exit status
|
|
From: <sv...@va...> - 2005-08-26 13:24:17
|
Author: njn Date: 2005-08-26 14:24:10 +0100 (Fri, 26 Aug 2005) New Revision: 4525 Log: update Modified: trunk/docs/internals/3_0_BUGSTATUS.txt Modified: trunk/docs/internals/3_0_BUGSTATUS.txt =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/docs/internals/3_0_BUGSTATUS.txt 2005-08-26 09:57:17 UTC (rev 4= 524) +++ trunk/docs/internals/3_0_BUGSTATUS.txt 2005-08-26 13:24:10 UTC (rev 4= 525) @@ -422,15 +422,21 @@ ---------------------------------------------------------------- =20 111090 Internal Error running Massif -111285 massif segfaults in the malloc replacement code on amd64 =20 FIXED-TRUNK: 4492 FIXED-30BRANCH: 4509 =20 ---------------------------------------------------------------- =20 -101204: noisy warning +101204 noisy warning =20 FIXED-TRUNK: 4511 FIXED-30BRANCH: TODO =20 +---------------------------------------------------------------- + +111555 VEX/Makefile: CC is set to gcc + +FIXED-TRUNK: TODO +FIXED-30BRANCH: TODO + |
|
From: Julian S. <js...@ac...> - 2005-08-26 10:09:12
|
> The code in the assembly routine to restore the register was not > restoring %ebx properly Wow. Well spotted. J |