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 854853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T07:59:28+00:00 2026-05-15T07:59:28+00:00

[Edit1:] For the seqName, I declare it as a global parameter at the beginning

  • 0

[Edit1:]

For the seqName, I declare it as a global parameter at the beginning of the file as

char seqName[20];

[Edit2:]

Aren’t those number of passing to the program during the actual execution? I got the following message just by using the valgrind tool. The command I input is:

jl@ubuntu:~/work/dsr_analysis$ valgrind –tool=memcheck –leak-check=yes ./test

[Edit3:]

Sorry, since I am a new user of Valgrind, when I use it, I only typing the command in Edit2.

However, my program dose have some command-line parameters.

Therefore, I think I’d better to debug my program by the new command:

valgrind –tool=memcheck –leak-check=yes ./test foreman.cif 352 288


There is a piece of my program:

height = atoi(argv[3]);

width = atoi(argv[2]);

sprintf(seqName,"%s", argv[1]);

// strcpy(seqName, argv[1]);

After compiling it, a exe file test is generated, then I use Valgrind to check it.
Then I got the following message, however I cannot understand what it tends to tell me.
Can anyone provide some kind help, Thanks.

jl@ubuntu:~/work/dsr_analysis$ valgrind –tool=memcheck –leak-check=yes ./test

==28940== Memcheck, a memory error detector

==28940== Copyright (C) 2002-2009, and GNU GPL’d, by Julian Seward et al.

==28940== Using Valgrind-3.6.0.SVN-Debian and LibVEX;

rerun with -h for copyright info

==28940== Command: ./test

==28940==

==28940== Invalid read of size 1

==28940== at 0x40260CA: strcpy (mc_replace_strmem.c:311)

==28940== by 0x804A5C6: main (me_search.c:1428)

==28940== Address 0x0 is not stack’d, malloc’d or (recently) free’d

==28940==

==28940==

==28940== Process terminating with default action of signal 11 (SIGSEGV)

==28940== Access not within mapped region at address 0x0

==28940== at 0x40260CA: strcpy (mc_replace_strmem.c:311)

==28940== by 0x804A5C6: main (me_search.c:1428)

==28940== If you believe this happened as a result of a stack

==28940== overflow in your program’s main thread (unlikely but

==28940== possible), you can try to increase the size of the

==28940== main thread stack using the –main-stacksize= flag.

==28940== The main thread stack size used in this run was 8388608.

==28940==

==28940== HEAP SUMMARY:

==28940== in use at exit: 0 bytes in 0 blocks

==28940== total heap usage: 0 allocs, 0 frees, 0 bytes allocated

==28940==

==28940== All heap blocks were freed — no leaks are possible

==28940==

==28940== For counts of detected and suppressed errors, rerun with: -v

==28940== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 13 from 8)1 contexts
(suppressed: 13 from 8)

1 contexts (suppressed: 13 from 8)

  • 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-05-15T07:59:29+00:00Added an answer on May 15, 2026 at 7:59 am

    You really haven’t posted clear enough code to be sure, but if you call your executable with no command-line parameters, then argv[1] will contain a NULL pointer, and argv[2], argv[3] etc. will contain undefined values.

    Edit: You need to provide the program with parameters on the valgrind command line (I guess – I don’t use valgrind myself). Something like:

    valgrind ... ./test foo bar zod
    

    And BTW, calling an executable test is a bad idea on Linux/Unix as it is very easy to get confused with the shell built-in of the same name

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

Sidebar

Ask A Question

Stats

  • Questions 511k
  • Answers 511k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Create the FK first, update the model from the database… May 16, 2026 at 5:25 pm
  • Editorial Team
    Editorial Team added an answer The technique I describe below works well for us because,… May 16, 2026 at 5:25 pm
  • Editorial Team
    Editorial Team added an answer Everything depends on the context. Like with CSS for desktop… May 16, 2026 at 5:25 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

i am making a program to implement xor encryption,while playing around with my program
I am looking for a tool which will make able to edit parts of
I am doing tests on an ejb3-project using ejb3unit session bean test . The
I am trying to add value to CoreData from .plist and get from coreData
I'm using Spring for form input and validation. The form controller's command contains the
I have a bunch of Ajax requests that execute just fine, but I end
Quite simple, I'm learning Python, and I can't find a reference that tells me
I am looking to write some webservices. What defines one unit of service. I
I a trying to make a mutableCopy of a planet object that contains 5
Is the copyWithZone (See Below) correct, particularly the bit where I use the setters

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.