Bug 149621 - devel/valgrind failng shmat(). Returns Invalid Argument.
Summary: devel/valgrind failng shmat(). Returns Invalid Argument.
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Stanislav Sedov
Depends on:
Reported: 2010-08-13 16:30 UTC by Stephen Sanders
Modified: 2010-10-15 09:10 UTC (History)
0 users

See Also:

file.txt (674 bytes, text/plain)
2010-08-13 16:30 UTC, Stephen Sanders
no flags Details
ssanders.vcf (271 bytes, text/x-vcard; charset=utf-8)
2010-09-23 16:59 UTC, Stephen Sanders
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stephen Sanders 2010-08-13 16:30:02 UTC
We have a large program that runs in a normal environment but is failing to run under valgrind and outputting the following before exiting.

==53581== Warning: set address range perms: large range [0x33ea000, 0x28bea000) (defined)
npQueueManager::npQueueManager(int, int)(271) - failed on 'Invalid argument'
2010/08/13 11:14:13.857 al3170-1.opnet.com .libs/mt-hcfestats ERROR MQ-1002: Fail to get share memory of the size initsize

Using the attached test program, shmat() fails under valgrind but not in a normal environment.

This bug sounds very similar to Valgrind Bugs numbers 157665 and 116483.

The output of valgind when running the attached test is presented below.

==53556== Memcheck, a memory error detector
==53556== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al.
==53556== Using Valgrind-3.5.0 and LibVEX; rerun with -h for copyright info
==53556== Command: ./a.out
shmat failed on 'Invalid argument'
==53556== HEAP SUMMARY:
==53556==     in use at exit: 4,096 bytes in 1 blocks
==53556==   total heap usage: 3 allocs, 2 frees, 4,202 bytes allocated
==53556== LEAK SUMMARY:
==53556==    definitely lost: 0 bytes in 0 blocks
==53556==    indirectly lost: 0 bytes in 0 blocks
==53556==      possibly lost: 0 bytes in 0 blocks
==53556==    still reachable: 4,096 bytes in 1 blocks
==53556==         suppressed: 0 bytes in 0 blocks
==53556== Rerun with --leak-check=full to see details of leaked memory
==53556== For counts of detected and suppressed errors, rerun with: -v
==53556== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

Fix: None

Patch attached with submission follows:
How-To-Repeat: Compile and run the attached test program.  Once in under the OS and again using valgrind.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2010-08-13 16:50:07 UTC
Responsible Changed
From-To: freebsd-ports-bugs->stas

Fix synopsis and assign.
Comment 2 Stephen Sanders 2010-09-23 16:59:22 UTC
 This appears to be a problem in FreeBSD 8.1 as well as FreeBSD 8.0.
Comment 3 dfilter service freebsd_committer 2010-10-15 09:07:36 UTC
stas        2010-10-15 08:07:31 UTC

  FreeBSD ports repository

  Modified files:
    devel/valgrind       Makefile distinfo 
  - Fix shmat syscall wrapper [1].
  - Implement shmctl syscall wrapper.
  PR:             ports/149621 [1]
  Submitted by:   Stephen Sanders <ssanders@opnet.com> [1]
  Revision  Changes    Path
  1.43      +2 -2      ports/devel/valgrind/Makefile
  1.8       +3 -3      ports/devel/valgrind/distinfo
cvs-all@freebsd.org mailing list
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 4 Stanislav Sedov freebsd_committer 2010-10-15 09:08:03 UTC
State Changed
From-To: open->closed

Fixed in revision 4.