Menu

#4 solaris8 - segfault in displayEnd()

open
nobody
None
5
2012-09-14
2010-07-19
Anonymous
No

Using this silly case:
$ ./bar -if bar -of junk
155.3KB at 0.0B/s eta: 0:00:00 100% [=====================================================================================]
Copied: 683226217705696zsh: segmentation fault (core dumped) ./bar -if bar -of junk
$ file bar
bar: ELF 32-bit MSB executable SPARC Version 1, dynamically linked, not stripped

Work around:
Modify CFLAGS to include '-m64' which creates a 64-bit executable.

Discussion

  • Anonymous

    Anonymous - 2010-07-19

    GDB backtrace:

    0 0xff2b3218 in strlen () from /usr/lib/libc.so.1

    1 0xff306520 in _doprnt () from /usr/lib/libc.so.1

    2 0xff307fc8 in fprintf () from /usr/lib/libc.so.1

    3 0x00016594 in displayEnd () at display.c:705

    4 0x0001eea0 in main (argc=5, argv=0xffbef13c) at bar.c:59

     
  • Anonymous

    Anonymous - 2010-07-19

    A related bug, also fixed by the -m64, is that if you specify -s
    <size> it never does anything.

    This is because this code in safe_mul():

        multiplier = 1;
        multiplier *= 1000;
        multiplier *= 1000;
        multiplier *= 1000;
        multiplier *= 1000;
        multiplier *= 1000;
        multiplier *= 1000;
    

    ends up setting multiplier to 2808348672

    multiplier:1
    multiplier:1000
    multiplier:1000000
    multiplier:1000000000
    multiplier:3567587328
    multiplier:2764472320
    multiplier:2808348672

    Then when it divides by 10 a few lines later...

    multiplier:280834867
    multiplier:28083486
    multiplier:2808348
    multiplier:280834
    multiplier:28083
    multiplier:2808
    multiplier:280
    multiplier:28
    multiplier:2
    multiplier:0

    Whups! If multiplier is 0, then the loop goes no place.

     
  • Michael Peek

    Michael Peek - 2010-08-20

    Hmmm.... 1000000000 * 1000 = 3567587328 ?
    Can you send me your config.log file?

     
  • Christian Höltje

    I'm not a big user of Source Forge....how do I attach a file?

     
  • Christian Höltje

    I put it here: http://docwhat.org/files/tmp/bar-solaris-config.log

    Feel free to attach it to this bug, if you have that ability. :-/

     
  • Michael Peek

    Michael Peek - 2010-08-20

    Something must be wonky somewhere. I can't resolve the hostname docwhat.org. Can you email it to me at michaelpeek@sourceforge.net?

    Also, I'm working on 1.11.0, and I'm adding code that will hopefully correctly detect the ability to use the -m64 flag. Would you be up for trying it out when it's ready?

     
  • Michael Peek

    Michael Peek - 2010-08-20

    Whoops... michaelpeek@sourceforge.net doesn't seem to work anymore. Try peek@tiem.utk.edu instead.

     
  • Michael Peek

    Michael Peek - 2010-08-21

    Nevermind, I got it. For some reason I couldn't resolve docwhat.org from work, but I could got it once I got home. Thanks!

     

Log in to post a comment.