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

`flickcurl oauth-create` crashes on Arch Linux #28

Closed
l0b0 opened this Issue Jan 25, 2015 · 9 comments

Comments

Projects
None yet
2 participants
@l0b0
Copy link

commented Jan 25, 2015

$ flickcurl oauth-create
*** Error in `flickcurl': double free or corruption (fasttop): 0x0000000001495870 ***
======= Backtrace: =========
/usr/lib/libc.so.6(+0x732ae)[0x7f13cdd342ae]
/usr/lib/libc.so.6(+0x7872e)[0x7f13cdd3972e]
/usr/lib/libc.so.6(+0x78eeb)[0x7f13cdd39eeb]
/usr/lib/libflickcurl.so.0(flickcurl_free_form+0x11)[0x7f13ce2e8dd1]
/usr/lib/libflickcurl.so.0(flickcurl_oauth_create_request_token+0x1d9)[0x7f13ce3055c9]
flickcurl[0x40c8f3]
flickcurl[0x40776a]
/usr/lib/libc.so.6(__libc_start_main+0xf0)[0x7f13cdce1040]
flickcurl[0x407814]
======= Memory map: ========
00400000-0041b000 r-xp 00000000 08:32 428369                             /usr/bin/flickcurl
0061a000-0061b000 r--p 0001a000 08:32 428369                             /usr/bin/flickcurl
0061b000-0061e000 rw-p 0001b000 08:32 428369                             /usr/bin/flickcurl
0134f000-014ba000 rw-p 00000000 00:00 0                                  [heap]
7f13c3dfa000-7f13c3dff000 r-xp 00000000 08:32 396551                     /usr/lib/libnss_dns-2.20.so
7f13c3dff000-7f13c3ffe000 ---p 00005000 08:32 396551                     /usr/lib/libnss_dns-2.20.so
7f13c3ffe000-7f13c3fff000 r--p 00004000 08:32 396551                     /usr/lib/libnss_dns-2.20.so
7f13c3fff000-7f13c4000000 rw-p 00005000 08:32 396551                     /usr/lib/libnss_dns-2.20.so
7f13c4000000-7f13c4021000 rw-p 00000000 00:00 0 
7f13c4021000-7f13c8000000 ---p 00000000 00:00 0 
7f13c81fc000-7f13c8207000 r-xp 00000000 08:32 396550                     /usr/lib/libnss_files-2.20.so
7f13c8207000-7f13c8407000 ---p 0000b000 08:32 396550                     /usr/lib/libnss_files-2.20.so
7f13c8407000-7f13c8408000 r--p 0000b000 08:32 396550                     /usr/lib/libnss_files-2.20.so
7f13c8408000-7f13c8409000 rw-p 0000c000 08:32 396550                     /usr/lib/libnss_files-2.20.so
7f13c8409000-7f13c840a000 ---p 00000000 00:00 0 
7f13c840a000-7f13c8c0a000 rw-p 00000000 00:00 0 
7f13c8c0a000-7f13c8c20000 r-xp 00000000 08:32 399547                     /usr/lib/libgcc_s.so.1
7f13c8c20000-7f13c8e1f000 ---p 00016000 08:32 399547                     /usr/lib/libgcc_s.so.1
7f13c8e1f000-7f13c8e20000 rw-p 00015000 08:32 399547                     /usr/lib/libgcc_s.so.1
7f13c8e20000-7f13c8f10000 r-xp 00000000 08:32 404495                     /usr/lib/libstdc++.so.6.0.20
7f13c8f10000-7f13c9110000 ---p 000f0000 08:32 404495                     /usr/lib/libstdc++.so.6.0.20
7f13c9110000-7f13c9118000 r--p 000f0000 08:32 404495                     /usr/lib/libstdc++.so.6.0.20
7f13c9118000-7f13c911a000 rw-p 000f8000 08:32 404495                     /usr/lib/libstdc++.so.6.0.20
7f13c911a000-7f13c912f000 rw-p 00000000 00:00 0 
7f13c912f000-7f13ca959000 r--p 00000000 08:32 425214                     /usr/lib/libicudata.so.54.1
7f13ca959000-7f13cab58000 ---p 0182a000 08:32 425214                     /usr/lib/libicudata.so.54.1
7f13cab58000-7f13cab59000 r--p 01829000 08:32 425214                     /usr/lib/libicudata.so.54.1
7f13cab59000-7f13cab6d000 r-xp 00000000 08:32 396526                     /usr/lib/libresolv-2.20.so
7f13cab6d000-7f13cad6c000 ---p 00014000 08:32 396526                     /usr/lib/libresolv-2.20.so
7f13cad6c000-7f13cad6e000 r--p 00013000 08:32 396526                     /usr/lib/libresolv-2.20.so
7f13cad6e000-7f13cad6f000 rw-p 00015000 08:32 396526                     /usr/lib/libresolv-2.20.so
7f13cad6f000-7f13cad71000 rw-p 00000000 00:00 0 
7f13cad71000-7f13cad74000 r-xp 00000000 08:32 438017                     /usr/lib/libkeyutils.so.1.5
7f13cad74000-7f13caf73000 ---p 00003000 08:32 438017                     /usr/lib/libkeyutils.so.1.5
7f13caf73000-7f13caf74000 r--p 00002000 08:32 438017                     /usr/lib/libkeyutils.so.1.5
7f13caf74000-7f13caf75000 rw-p 00003000 08:32 438017                     /usr/lib/libkeyutils.so.1.5
7f13caf75000-7f13caf81000 r-xp 00000000 08:32 425208                     /usr/lib/libkrb5support.so.0.1
7f13caf81000-7f13cb180000 ---p 0000c000 08:32 425208                     /usr/lib/libkrb5support.so.0.1
7f13cb180000-7f13cb181000 r--p 0000b000 08:32 425208                     /usr/lib/libkrb5support.so.0.1
7f13cb181000-7f13cb182000 rw-p 0000c000 08:32 425208                     /usr/lib/libkrb5support.so.0.1
7f13cb182000-7f13cb1bf000 r-xp 00000000 08:32 425154                     /usr/lib/libxslt.so.1.1.28
7f13cb1bf000-7f13cb3be000 ---p 0003d000 08:32 425154                     /usr/lib/libxslt.so.1.1.28
7f13cb3be000-7f13cb3bf000 r--p 0003c000 08:32 425154                     /usr/lib/libxslt.so.1.1.28
7f13cb3bf000-7f13cb3c0000 rw-p 0003d000 08:32 425154                     /usr/lib/libxslt.so.1.1.28
7f13cb3c0000-7f13cb3c1000 rw-p 00000000 00:00 0 
7f13cb3c1000-7f13cb53b000 r-xp 00000000 08:32 425197                     /usr/lib/libicuuc.so.54.1
7f13cb53b000-7f13cb73b000 ---p 0017a000 08:32 425197                     /usr/lib/libicuuc.so.54.1
7f13cb73b000-7f13cb74c000 r--p 0017a000 08:32 425197                     /usr/lib/libicuuc.so.54.1
7f13cb74c000-7f13cb74d000 rw-p 0018b000 08:32 425197                     /usr/lib/libicuuc.so.54.1
7f13cb74d000-7f13cb751000 rw-p 00000000 00:00 0 
7f13cb751000-7f13cb776000 r-xp 00000000 08:32 402484                     /usr/lib/liblzma.so.5.2.0
7f13cb776000-7f13cb975000 ---p 00025000 08:32 402484                     /usr/lib/liblzma.so.5.2.0
7f13cb975000-7f13cb976000 r--p 00024000 08:32 402484                     /usr/lib/liblzma.so.5.2.0
7f13cb976000-7f13cb977000 rw-p 00025000 08:32 402484                     /usr/lib/liblzma.so.5.2.0
7f13cb977000-7f13cb98e000 r-xp 00000000 08:32 396596                     /usr/lib/libpthread-2.20.so
7f13cb98e000-7f13cbb8d000 ---p 00017000 08:32 396596                     /usr/lib/libpthread-2.20.so
7f13cbb8d000-7f13cbb8e000 r--p 00016000 08:32 396596                     /usr/lib/libpthread-2.20.so
7f13cbb8e000-7f13cbb8f000 rw-p 00017000 08:32 396596                     /usr/lib/libpthread-2.20.so
7f13cbb8f000-7f13cbb93000 rw-p 00000000 00:00 0 
7f13cbb93000-7f13cbb96000 r-xp 00000000 08:32 403233                     /usr/lib/libcom_err.so.2.1
7f13cbb96000-7f13cbd95000 ---p 00003000 08:32 403233                     /usr/lib/libcom_err.so.2.1
7f13cbd95000-7f13cbd96000 r--p 00002000 08:32 403233                     /usr/lib/libcom_err.so.2.1
7f13cbd96000-7f13cbd97000 rw-p 00003000 08:32 403233                     /usr/lib/libcom_err.so.2.1
7f13cbd97000-7f13cbdc6000 r-xp 00000000 08:32 425189                     /usr/lib/libk5crypto.so.3.1
7f13cbdc6000-7f13cbfc5000 ---p 0002f000 08:32 425189                     /usr/lib/libk5crypto.so.3.1
7f13cbfc5000-7f13cbfc7000 r--p 0002e000 08:32 425189                     /usr/lib/libk5crypto.so.3.1
7f13cbfc7000-7f13cbfc8000 rw-p 00030000 08:32 425189                     /usr/lib/libk5crypto.so.3.1
7f13cbfc8000-7f13cbfc9000 rw-p 00000000 00:00 0 
7f13cbfc9000-7f13cc09e000 r-xp 00000000 08:32 406224                     /usr/lib/libkrb5.so.3.3
7f13cc09e000-7f13cc29d000 ---p 000d5000 08:32 406224                     /usr/lib/libkrb5.so.3.3
7f13cc29d000-7f13cc2ab000 r--p 000d4000 08:32 406224                     /usr/lib/libkrb5.so.3.3
7f13cc2ab000-7f13cc2ae000 rw-p 000e2000 08:32 406224                     /usr/lib/libkrb5.so.3.3
7f13cc2ae000-7f13cc2f8000 r-xp 00000000 08:32 420110                     /usr/lib/libgssapi_krb5.so.2.2
7f13cc2f8000-7f13cc4f7000 ---p 0004a000 08:32 420110                     /usr/lib/libgssapi_krb5.so.2.2
7f13cc4f7000-7f13cc4f9000 r--p 00049000 08:32 420110                     /usr/lib/libgssapi_krb5.so.2.2
7f13cc4f9000-7f13cc4fb000 rw-p 0004b000 08:32 420110                     /usr/lib/libgssapi_krb5.so.2.2
7f13cc4fb000-7f13cc6e1000 r-xp 00000000 08:32 405753                     /usr/lib/libcrypto.so.1.0.0
7f13cc6e1000-7f13cc8e1000 ---p 001e6000 08:32 405753                     /usr/lib/libcrypto.so.1.0.0
7f13cc8e1000-7f13cc8fd000 r--p 001e6000 08:32 405753                     /usr/lib/libcrypto.so.1.0.0
7f13cc8fd000-7f13cc909000 rw-p 00202000 08:32 405753                     /usr/lib/libcrypto.so.1.0.0
7f13cc909000-7f13cc90d000 rw-p 00000000 00:00 0 
7f13cc90d000-7f13cc972000 r-xp 00000000 08:32 405752                     /usr/lib/libssl.so.1.0.0
7f13cc972000-7f13ccb71000 ---p 00065000 08:32 405752                     /usr/lib/libssl.so.1.0.0
7f13ccb71000-7f13ccb76000 r--p 00064000 08:32 405752                     /usr/lib/libssl.so.1.0.0
7f13ccb76000-7f13ccb7d000 rw-p 00069000 08:32 405752                     /usr/lib/libssl.so.1.0.0
7f13ccb7d000-7f13ccba5000 r-xp 00000000 08:32 410826                     /usr/lib/libssh2.so.1.0.1
7f13ccba5000-7f13ccda4000 ---p 00028000 08:32 410826                     /usr/lib/libssh2.so.1.0.1
7f13ccda4000-7f13ccda5000 r--p 00027000 08:32 410826                     /usr/lib/libssh2.so.1.0.1
7f13ccda5000-7f13ccda6000 rw-p 00028000 08:32 410826                     /usr/lib/libssh2.so.1.0.1
7f13ccda6000-7f13ccdd8000 r-xp 00000000 08:32 425516                     /usr/lib/libidn.so.11.6.12
7f13ccdd8000-7f13ccfd8000 ---p 00032000 08:32 425516                     /usr/lib/libidn.so.11.6.12
7f13ccfd8000-7f13ccfd9000 r--p 00032000 08:32 425516                     /usr/lib/libidn.so.11.6.12
7f13ccfd9000-7f13ccfda000 rw-p 00033000 08:32 425516                     /usr/lib/libidn.so.11.6.12
7f13ccfda000-7f13cd038000 r-xp 00000000 08:32 425224                     /usr/lib/libraptor2.so.0.0.0
7f13cd038000-7f13cd238000 ---p 0005e000 08:32 425224                     /usr/lib/libraptor2.so.0.0.0
7f13cd238000-7f13cd23b000 r--p 0005e000 08:32 425224                     /usr/lib/libraptor2.so.0.0.0
7f13cd23b000-7f13cd23d000 rw-p 00061000 08:32 425224                     /usr/lib/libraptor2.so.0.0.0
7f13cd23d000-7f13cd240000 r-xp 00000000 08:32 396490                     /usr/lib/libdl-2.20.so
7f13cd240000-7f13cd43f000 ---p 00003000 08:32 396490                     /usr/lib/libdl-2.20.so
7f13cd43f000-7f13cd440000 r--p 00002000 08:32 396490                     /usr/lib/libdl-2.20.so
7f13cd440000-7f13cd441000 rw-p 00003000 08:32 396490                     /usr/lib/libdl-2.20.so
7f13cd441000-7f13cd544000 r-xp 00000000 08:32 396648                     /usr/lib/libm-2.20.so
7f13cd544000-7f13cd744000 ---p 00103000 08:32 396648                     /usr/lib/libm-2.20.so
7f13cd744000-7f13cd745000 r--p 00103000 08:32 396648                     /usr/lib/libm-2.20.so
7f13cd745000-7f13cd746000 rw-p 00104000 08:32 396648                     /usr/lib/libm-2.20.so
7f13cd746000-7f13cd75b000 r-xp 00000000 08:32 399612                     /usr/lib/libz.so.1.2.8
7f13cd75b000-7f13cd95a000 ---p 00015000 08:32 399612                     /usr/lib/libz.so.1.2.8
7f13cd95a000-7f13cd95b000 r--p 00014000 08:32 399612                     /usr/lib/libz.so.1.2.8
7f13cd95b000-7f13cd95c000 rw-p 00015000 08:32 399612                     /usr/lib/libz.so.1.2.8
7f13cd95c000-7f13cdab6000 r-xp 00000000 08:32 420112                     /usr/lib/libxml2.so.2.9.2
7f13cdab6000-7f13cdcb5000 ---p 0015a000 08:32 420112                     /usr/lib/libxml2.so.2.9.2
7f13cdcb5000-7f13cdcbd000 r--p 00159000 08:32 420112                     /usr/lib/libxml2.so.2.9.2
7f13cdcbd000-7f13cdcbf000 rw-p 00161000 08:32 420112                     /usr/lib/libxml2.so.2.9.2
7f13cdcbf000-7f13cdcc1000 rw-p 00000000 00:00 0 
7f13cdcc1000-7f13cde5a000 r-xp 00000000 08:32 396649                     /usr/lib/libc-2.20.so
7f13cde5a000-7f13ce05a000 ---p 00199000 08:32 396649                     /usr/lib/libc-2.20.so
7f13ce05a000-7f13ce05e000 r--p 00199000 08:32 396649                     /usr/lib/libc-2.20.so
7f13ce05e000-7f13ce060000 rw-p 0019d000 08:32 396649                     /usr/lib/libc-2.20.so
7f13ce060000-7f13ce064000 rw-p 00000000 00:00 0 
7f13ce064000-7f13ce0d5000 r-xp 00000000 08:32 436542                     /usr/lib/libcurl.so.4.3.0
7f13ce0d5000-7f13ce2d4000 ---p 00071000 08:32 436542                     /usr/lib/libcurl.so.4.3.0
7f13ce2d4000-7f13ce2d6000 r--p 00070000 08:32 436542                     /usr/lib/libcurl.so.4.3.0
7f13ce2d6000-7f13ce2d7000 rw-p 00072000 08:32 436542                     /usr/lib/libcurl.so.4.3.0
7f13ce2d7000-7f13ce2d8000 rw-p 00000000 00:00 0 
7f13ce2d8000-7f13ce313000 r-xp 00000000 08:32 428363                     /usr/lib/libflickcurl.so.0.0.0
7f13ce313000-7f13ce512000 ---p 0003b000 08:32 428363                     /usr/lib/libflickcurl.so.0.0.0
7f13ce512000-7f13ce515000 r--p 0003a000 08:32 428363                     /usr/lib/libflickcurl.so.0.0.0
7f13ce515000-7f13ce516000 rw-p 0003d000 08:32 428363                     /usr/lib/libflickcurl.so.0.0.0
7f13ce516000-7f13ce538000 r-xp 00000000 08:32 396562                     /usr/lib/ld-2.20.so
7f13ce6f0000-7f13ce700000 rw-p 00000000 00:00 0 
7f13ce736000-7f13ce737000 rw-p 00000000 00:00 0 
7f13ce737000-7f13ce738000 r--p 00021000 08:32 396562                     /usr/lib/ld-2.20.so
7f13ce738000-7f13ce739000 rw-p 00022000 08:32 396562                     /usr/lib/ld-2.20.so
7f13ce739000-7f13ce73a000 rw-p 00000000 00:00 0 
7fff817e0000-7fff81801000 rw-p 00000000 00:00 0                          [stack]
7fff819f0000-7fff819f2000 r--p 00000000 00:00 0                          [vvar]
7fff819f2000-7fff819f4000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
Aborted (core dumped)

Using the latest version on an up-to-date Arch Linux:

$ flickcurl --version
1.26
$ uname --kernel-name --kernel-release --kernel-version --machine --processor --hardware-platform --operating-system
Linux 3.18.2-2-ARCH #1 SMP PREEMPT Fri Jan 9 07:37:51 CET 2015 x86_64 unknown unknown GNU/Linux
$ cat ~/.flickcurl.conf
[flickr]
oauth_client_key=[...]
oauth_client_secret=[...]

@l0b0 l0b0 changed the title flickcurl oauth-create crashes on Arch Linux `flickcurl oauth-create` crashes on Arch Linux Jan 25, 2015

@dajobe

This comment has been minimized.

Copy link
Owner

commented Jan 25, 2015

I can't duplicate this over here tracing the possible paths inside flickcurl_oauth_create_request_token() that end up at flickcurl_free_form()

Do you think you could compile it with more debugging (-g3 for example) so I can see line numbers?

Even better would be configure with --enable-maintainer-mode --enable-capture
(although that might require you to install some extra software)

@l0b0

This comment has been minimized.

Copy link
Author

commented Jan 25, 2015

-g3 is not recognized by ./configure or GNU Make 4.1:

$ make -g3
make: invalid option -- 'g'
make: invalid option -- '3'

After adding --enable-capture in autogen.sh (--enable-maintainer-mode is already in there) it still fails in the same way:

$ ./utils/flickcurl oauth-create
[...]
Invoking CURL to resolve the URL
OAuth request token request https://www.flickr.com/services/oauth/request_token response was 3 params
OAuth request token returned token '[...]' secret token '[...]'
*** Error in `/home/victor/dev/flickcurl/utils/.libs/lt-flickcurl': double free or corruption (fasttop): 0x00000000018a3870 ***
@dajobe

This comment has been minimized.

Copy link
Owner

commented Jan 25, 2015

you need to do 'CFLAGS=-g3 make' or 'CC=gcc -g3 make'

@dajobe

This comment has been minimized.

Copy link
Owner

commented Jan 25, 2015

I think there is a way to force it to dump core on a malloc double free, that way you can be in the debugger and check the call stack

@dajobe

This comment has been minimized.

Copy link
Owner

commented Jan 25, 2015

Looks like it might be from http://www.gnu.org/software/libc/manual/html_node/Heap-Consistency-Checking.html with

$ MALLOC_CHECK_=2 ./utils/flickcurl oauth-create
@l0b0

This comment has been minimized.

Copy link
Author

commented Jan 25, 2015

Latest results:

$ ulimit -c unlimited
$ MALLOC_CHECK_=2 ./utils/flickcurl oauth-create
[...]
lt-flickcurl: ERROR: Capture failed to write to captured/oauth.request_token.xml - No such file or directory
[...]
Invoking CURL to resolve the URL
OAuth request token request https://www.flickr.com/services/oauth/request_token response was 3 params
OAuth request token returned token '[...]' secret token '[...]'
Aborted (core dumped)

Core dump analysis (Is this all you need?):

$ coredumpctl gdb
        Signal: 6 (ABRT)
Core was generated by `[...]/flickcurl/utils/.libs/lt-flickcurl oauth.create'.
Program terminated with signal SIGABRT, Aborted.
#0  0x00007fab182b8a97 in raise () from /usr/lib/libc.so.6
@dajobe

This comment has been minimized.

Copy link
Owner

commented Jan 25, 2015

That helped, I can see an issue with flickcurl_free_form.

@dajobe

This comment has been minimized.

Copy link
Owner

commented Jan 25, 2015

If you want a patch, edit src/common.c at line 1594 and remove the free(content) - https://github.com/dajobe/flickcurl/blob/master/src/common.c#L1594

dajobe added a commit that referenced this issue Jan 25, 2015

@dajobe dajobe closed this Jan 25, 2015

@l0b0

This comment has been minimized.

Copy link
Author

commented Jan 26, 2015

Thank you; it works now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.