From: "Verkamp, Daniel" <daniel.verkamp@intel.com>
To: "users@dpdk.org" <users@dpdk.org>
Subject: Re: [dpdk-users] rte_zmalloc() returning non-zeroed memory on FreeBSD
Date: Wed, 10 Aug 2016 23:39:03 +0000 [thread overview]
Message-ID: <1470872340.40000.53.camel@intel.com> (raw)
In-Reply-To: <1470871839.40000.48.camel@intel.com>
On Wed, 2016-08-10 at 23:30 +0000, Verkamp, Daniel wrote:
> I've attached a minimized reproducer
> program - running it twice in a row fails reliably for me.
It seems the attachment got stripped, so here it is inline:
#include <stdio.h>
#include <rte_config.h>
#include <rte_eal.h>
#include <rte_malloc.h>
int main(int argc, char **argv)
{
unsigned char *buf;
int i;
size_t size = 5200;
rte_eal_init(argc, argv);
buf = rte_zmalloc("test", size, 64);
printf("Got buf %p\n", buf);
for (i = 0; i < size; i++) {
if (buf[i] != 0) {
printf("byte %d is %x\n", i, buf[i]);
return 1;
}
}
printf("All bytes cleared\n");
printf("Writing garbage\n");
for (i = 0; i < size; i++) {
buf[i] = 0x5A;
}
return 0;
}
next prev parent reply other threads:[~2016-08-10 23:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-10 23:30 Verkamp, Daniel
2016-08-10 23:39 ` Verkamp, Daniel [this message]
2016-08-11 7:05 ` Thomas Monjalon
2016-08-15 17:23 ` [dpdk-users] [dpdk-dev] " Harris, James R
[not found] ` <8b8e180e-a996-ef6e-cbf8-23028a194224@intel.com>
2016-08-16 22:54 ` Harris, James R
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1470872340.40000.53.camel@intel.com \
--to=daniel.verkamp@intel.com \
--cc=users@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).