LogWarn() (and the others like it) are printf-alikes, so they need a
format parameter. It would be called like this:
LogWarn(COMPONENT_NFS_V4, "%s", errstr);
But, you don't need the errstr at all, you can just call like this:
LogWarn(COMPONENT_NFS_V4, "Invalid map: %s: %s", clue, line);
Daniel
On 7/17/20 12:52 PM, Becker, Jeffrey C. (ARC-TN)[InuTeq, LLC] via Devel
wrote:
Hi,
I’m trying to call your logging as follows:
sprintf(errstr, "Invalid map: %s: %s", clue, line);
LogWarn(COMPONENT_NFS_V4, errstr);
I’m getting a segfault in LogWarn.
Program received signal SIGSEGV, Segmentation fault.
0x00002aaaaad43ca4 in display_log_component_level
(component=COMPONENT_NFS_V4,
file=0x2aaaaae4d5d8
"/mnt/nbnfs2/jcbecker/reexporter/nfs-ganesha/src/uidmap/uidmap.c",
line=519, function=0x2aaaaae4d7d8 <__func__.18797> "um_load",
level=NIV_WARN,
format=0x7fffffffc470 "Invalid map: unknown_user: dataset:
129.99.10.111 \t21102:61856 dataset n1856", arguments=0x7fffffff2718)
at
/mnt/nbnfs2/jcbecker/reexporter/nfs-ganesha/src/log/log_functions.c:1519
1519 if (level <=
facility->lf_max_level
The traceback is below. I’m investigating, but any advice is welcome.
Thanks.
-Jeff
(gdb) where
#0 0x00002aaaaad43ca4 in display_log_component_level (
component=COMPONENT_NFS_V4,
file=0x2aaaaae4d5d8
"/mnt/nbnfs2/jcbecker/reexporter/nfs-ganesha/src/uidmap/uidmap.c",
line=519, function=0x2aaaaae4d7d8 <__func__.18797> "um_load",
level=NIV_WARN,
format=0x7fffffffc470 "Invalid map: unknown_user: dataset:
129.99.10.111 \t21102:61856 dataset n1856", arguments=0x7fffffff2718)
at
/mnt/nbnfs2/jcbecker/reexporter/nfs-ganesha/src/log/log_functions.c:1519
#1 0x00002aaaaad43df6 in DisplayLogComponentLevel (
component=COMPONENT_NFS_V4,
file=0x2aaaaae4d5d8
"/mnt/nbnfs2/jcbecker/reexporter/nfs-ganesha/src/uidmap/uidmap.c",
line=519, function=0x2aaaaae4d7d8 <__func__.18797> "um_load",
level=NIV_WARN,
format=0x7fffffffc470 "Invalid map: unknown_user: dataset:
129.99.10.111 \t21102:61856 dataset n1856")
at
/mnt/nbnfs2/jcbecker/reexporter/nfs-ganesha/src/log/log_functions.c:1704
_______________________________________________
Devel mailing list -- devel(a)lists.nfs-ganesha.org
To unsubscribe send an email to devel-leave(a)lists.nfs-ganesha.org