Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9191677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:44:33+00:00 2026-06-17T20:44:33+00:00

Linux machine 3.2.0-34-generic, x86_64 Source: libtar Version: 1.2.11-8 #include <stdio.h> #include <libtar.h> #include <fcntl.h>

  • 0

Linux machine 3.2.0-34-generic, x86_64

Source: libtar
Version: 1.2.11-8

#include <stdio.h>
#include <libtar.h>
#include <fcntl.h>
int main(void)
{
TAR *pTar;
char *tarFilename = "file.tar";
char *srcDir = "/home/test";
char *extractTo = ".";
tar_open(&pTar, tarFilename, NULL, O_WRONLY | O_CREAT, 0644, TAR_GNU);
tar_append_tree(pTar, srcDir, extractTo);
tar_close(pTar);
return (0);
}

Compiling as:

gcc main.c -o run -ltar

Getting segfault

Now with “gcc main.c -g3 -O0 -o run -ltar”

Program received signal SIGABRT, Aborted.
0x00007ffff7845425 in __GI_raise (sig=<optimized out>)
at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64  ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
0  0x00007ffff7845425 in __GI_raise (sig=<optimized out>)
at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
1  0x00007ffff7848b8b in __GI_abort () at abort.c:91
2  0x00007ffff788339e in __libc_message (do_abort=2, 
  fmt=0x7ffff798ae3f "*** %s ***: %s terminated\n")
  at ../sysdeps/unix/sysv/linux/libc_fatal.c:201
3  0x00007ffff7919807 in __GI___fortify_fail (
  msg=0x7ffff798add6 "buffer overflow detected") at fortify_fail.c:32
4  0x00007ffff7918700 in __GI___chk_fail () at chk_fail.c:29
5  0x00007ffff79179e6 in __strncpy_chk (s1=<optimized out>, 
  s2=<optimized out>, n=<optimized out>, s1len=<optimized out>)
  at strncpy_chk.c:34
6  0x00007ffff7bd12ef in th_finish () from /usr/lib/libtar.so.0
7  0x00007ffff7bd0dc1 in th_write () from /usr/lib/libtar.so.0
8  0x00007ffff7bd07f0 in tar_append_file () from /usr/lib/libtar.so.0
9  0x00007ffff7bd3c12 in tar_append_tree () from /usr/lib/libtar.so.0
10 0x00000000004006f1 in main () at main.c:12

All examples, f.e. here

Using libtar to compress a directory

Seems to work fine….

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T20:44:35+00:00Added an answer on June 17, 2026 at 8:44 pm

    It looks like a library defect
    https://bugzilla.redhat.com/show_bug.cgi?id=538770

    You may need to upgrade libtar-devel

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On my machine Linux machine ulimit -n gives 1024 . This code: from tempfile
on a Linux machine, I am using ptrace with the PTRACE_SINGLESTEP parameter to count
I have two Linux Machine,1st is machine X ,other is machine Y i want
Im using a linux machine, and I followed the instructions seen on https://www.php.net/manual/en/install.php to
I am running Java 6 on a Linux machine (RHEL 5) and my program
I am running an application on linux machine. By giving the ip address of
I need to monitor folders on my linux machine periodically to check whether they
I am working on a program in C on a linux machine that displays
I'm trying to move a MySQL database from a Linux machine to one running
I'm working in C with openMP using gcc on a linux machine. In an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.