#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2017
    Posts
    1
    Rep Power
    0

    Customised Beanstalk Memory Crash


    My changes are working as designed however, it crashes out if you enter a tube name above 12 characters.

    If this is a new tube name then create a new announce tube using -A name
    https://github.com/BiGMiCR0/beanstal...77e3061dabd4f5

    Have been trying to write unit tests for this as well with no success or a fix does anyone have any idea what I have done wrong.

    ==15169== Command: ./beanstalkd -A testtubename
    ==15169==
    ==15169== Invalid write of size 1
    ==15169== at 0x4C3275B: memcpy@@GLIBC_2.14 (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
    ==15169== by 0x40962E: dispatch_cmd (prot.c:1550)
    ==15169== by 0x409D65: do_cmd (prot.c:1678)
    ==15169== by 0x409EFF: conn_data (prot.c:1718)
    ==15169== by 0x40A46E: h_conn (prot.c:1860)
    ==15169== by 0x40A520: prothandle (prot.c:1872)
    ==15169== by 0x40BC98: srvserve (serv.c:56)
    ==15169== by 0x40DCE1: main (main.c:91)
    ==15169== Address 0x52090aa is 0 bytes after a block of size 186 alloc'd
    ==15169== at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
    ==15169== by 0x4043A1: allocate_job (job.c:97)
    ==15169== by 0x40444B: make_job_with_id (job.c:113)
    ==15169== by 0x409591: dispatch_cmd (prot.c:1549)
    ==15169== by 0x409D65: do_cmd (prot.c:1678)
    ==15169== by 0x409EFF: conn_data (prot.c:1718)
    ==15169== by 0x40A46E: h_conn (prot.c:1860)
    ==15169== by 0x40A520: prothandle (prot.c:1872)
    ==15169== by 0x40BC98: srvserve (serv.c:56)
    ==15169== by 0x40DCE1: main (main.c:91)
    ==15169==


    Thanks in advance for any reply's.
  2. #2
  3. Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Aug 2011
    Posts
    5,861
    Rep Power
    509
    Your primes are all prime.

    Your description of the program
    Beanstalk is a simple, fast work queue.

    Its interface is generic, but was originally designed for reducing the latency of page views in high-volume web applications by running time-consuming tasks asynchronously.
    is meaningless to me.

    I was unable to recreate a problem. (runs terminated with ^C)
    Code:
    $  ./beanstalkd -A testtubename
    
    
    $  ./beanstalkd -A test
    
    the
    blort
    q
    
    
    $
    [code]Code tags[/code] are essential for python code and Makefiles!
  4. #3
  5. Contributed User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2005
    Posts
    4,475
    Rep Power
    1875
    Also posted here
    For reference.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper
  6. #4
  7. Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Aug 2011
    Posts
    5,861
    Rep Power
    509
    You have the best gif.

    Comments on this post

    • salem agrees : Thanks :)
    [code]Code tags[/code] are essential for python code and Makefiles!

IMN logo majestic logo threadwatch logo seochat tools logo