Bug 224878 - devel/valgrind fails on i386
Summary: devel/valgrind fails on i386
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Niclas Zeising
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-03 21:49 UTC by Mikhail Teterin
Modified: 2019-03-10 11:44 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (bdrewery)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Teterin freebsd_committer 2018-01-03 21:49:53 UTC
The freshly-built port (tried valgrind-devel too) fails to debug anything:

% valgrind sleep 1
valgrind: I failed to allocate space for the application's stack.
valgrind: This may be the result of a very large --main-stacksize=
valgrind: setting.  Cannot continue.  Sorry.

I'd like to think, amd64 is still Ok, but I'm trying to use it on i386 here (running 11.1-STABLE #1 r327490 on a PAE-enabled kernel).
Comment 1 Mikhail Teterin freebsd_committer 2018-02-28 22:59:11 UTC
The same breakage exists on 10.4-STABLE i386, without PAE.
Comment 2 Mikhail Teterin freebsd_committer 2018-03-01 14:59:06 UTC
Yes, the tool works fine for me on amd64. Unfortunately, I need to work with Oracle client-libraries, but the databases/oracle8-client is only available for i386 ...
Comment 3 Ben Bullock 2018-09-04 01:21:29 UTC
Using printf statement debugging,

m_aspacemgr/aspacemgr-linux.c:2836:2 0
m_initimg/initimg-freebsd.c:532:0
m_initimg/initimg-freebsd.c:541:0

I found the error is caused by the following. The error starts in the above aspacemgr-linux.c:
---
   if (nsegments[startI].kind != SkFree){
VG_(printf)("%s:%d:%d %d\n", __FILE__, __LINE__, nsegments[startI].kind, SkFree);
      return False;
}
---
It seems nsegments[startI].kind is 2 but SkFree is zero.

This returns "False", causing the following to fail in initimg-freebsd.c:
---
     ok = VG_(am_create_reservation)(
             resvn_start,
             resvn_size -inner_HACK,
             SmUpper, 
             anon_size +inner_HACK
          );
VG_(printf)("%s:%d:%d\n", __FILE__, __LINE__, ok);
     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
	      );
     }
VG_(printf)("%s:%d:%d\n", __FILE__, __LINE__, ok);
     if ((!ok) || sr_isError(res)) {
        /* Allocation of the stack failed.  We have to stop. */
        VG_(printf)("valgrind: "
                    "I failed to allocate space for the application's stack.\n");
---
SkFree seems to be a constant value, defined in an enum in "include/pub_tool_aspacemgr.h".

The underlying problem seems to be some kind of unaddressed change in the system call used, which is making these failures happen. Is the maintainer actively working on this project any more? The configure.ac script had to be fiddled with to get it to work, since it only refers to old compiler versions.
Comment 4 Walter Schwarzenfeld freebsd_triage 2019-03-09 08:40:07 UTC
Maintainership dropped ports r495096.
Comment 5 Walter Schwarzenfeld freebsd_triage 2019-03-10 11:44:50 UTC
Assign to new maintainer.