Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault at iniparser_getstring function #41

Closed
tianguochun opened this issue Jul 11, 2019 · 2 comments
Closed

Segmentation fault at iniparser_getstring function #41

tianguochun opened this issue Jul 11, 2019 · 2 comments

Comments

@tianguochun
Copy link

96 ini_test();
(gdb) n
ini_test
year = 2019

Program received signal SIGSEGV, Segmentation fault.
strlen () at ../sysdeps/x86_64/strlen.S:106
106 ../sysdeps/x86_64/strlen.S: No such file or directory.
(gdb) bt
#0 strlen () at ../sysdeps/x86_64/strlen.S:106
#1 0x0000000000409cc2 in xstrdup (s=0x7fff0040a635 <error: Cannot access memory at address 0x7fff0040a635>) at ini/dictionary.c:68
#2 0x0000000000408d87 in iniparser_getstring (d=0x60f280, key=0x7fff0040a635 <error: Cannot access memory at address 0x7fff0040a635>, def=0x0)
at ini/iniparser.c:368
#3 0x0000000000401c02 in ini_get_string (c=0x60e010) at ini/ini_config.c:77
#4 0x000000000040115f in ini_test () at test_libconfig.c:41
#5 0x00000000004011e2 in main (argc=1, argv=0x7fffffffe598) at test_libconfig.c:96
(gdb) f 3
#3 0x0000000000401c02 in ini_get_string (c=0x60e010) at ini/ini_config.c:77
77 ret = iniparser_getstring(ini, type_list[cnt-1].cval, NULL);
(gdb) p type_list
$1 = (struct int_charp *) 0x60f080
(gdb) p *type_list
$2 = {type = 1, {ival = 4236853, cval = 0x7fff0040a635 <error: Cannot access memory at address 0x7fff0040a635>}}

@gozfree
Copy link
Owner

gozfree commented Jul 11, 2019

the example.ini file parse is ok, please show your test ini file.

@gozfree
Copy link
Owner

gozfree commented Jul 21, 2019

already fixed it

@gozfree gozfree closed this as completed Jul 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants