[dpdk-users] segmentation fault after using rte_malloc()

曾懷恩 the at csie.io
Fri Apr 19 05:31:27 CEST 2019


HI, Stephen,

Yes, I set huge page in  default_hugepagesz=1G hugepagesz=1G hugepages=4

and also did rte_eal_init at the beginning of my program.

thanks for reply.


> Stephen Hemminger <stephen at networkplumber.org> 於 2019年4月19日 上午10:59 寫道:
> 
> On Fri, 19 Apr 2019 09:11:05 +0800
> 曾懷恩 <the at csie.io> wrote:
> 
>> 	Hi all, 
>> 
>> 	i have 1 problem while using rte_malloc
>> 
>> 	Every time I use this function and use the memory it returns, it shows segmentation fault(core dump)
>> 
>> 	Is something wrong?
>> 
>> 	thanks.
>> 
>> 
>> 	rte init …
>> 	………...
>> 	unsigned char *str1;
>> 	printf("str1 addr = %x\n", str1);
>> 	str1 = rte_malloc(NULL,2,RTE_CACHE_LINE_SIZE);
>> 	printf("str1 addr = %x\n", str1);
>> 	str1[0] = 'a’; //segmentation fault here
>> 	str1[1] = '\0';
> Do you have huge pages?
> Did you do eal_init?



More information about the users mailing list