Menu

#9 Bus Errpr on solaris

open
portability (3)
7
2007-12-14
2007-12-13
No

Testing on solaris with RMF formats today gave me Bus Error. Line like this caused the problem:

nTag=*(unsigned long *)pc;

Removing the cast solved it (i dont know why)

nTag=*pc;

Maybe this affects other codecs also.

Discussion

  • Till Toenshoff

    Till Toenshoff - 2007-12-14

    Logged In: YES
    user_id=559680
    Originator: NO

    1. Please try multiple files for reproducing such problem (if you did not already)
    2. I am surprised that the change to nTag=*pc; didnt render it broken as i would have expected that to pass only one byte of the tag data.
    -- use this instead for a test: nTag=*(unsigned long *)&pc[0];

     
  • Till Toenshoff

    Till Toenshoff - 2007-12-14
    • labels: --> portability
    • priority: 5 --> 7
    • assigned_to: nobody --> lobotomat
    • status: open --> pending
     
  • Vinicius Kursancew

    • status: pending --> open
     
  • Vinicius Kursancew

    Logged In: YES
    user_id=1926381
    Originator: YES

    I changed all the files that had this that were involved in the decoding process (including Adpcm.cpp)

    It wont work because i found out that sparc expects integers to be always 4 byte aligned, cannot do:
    char c[5];
    char *cp = c+1;
    long l = *(unsigned long*)cp;

    One solution i can think of is:
    union {
    char data[4];
    unsigned long ldata;
    } tmp;
    memcpy(tmp.data, inp, 4);
    inputbuffer = tmp.ldata;

     
  • Till Toenshoff

    Till Toenshoff - 2007-12-14

    Logged In: YES
    user_id=559680
    Originator: NO

    Hmm, a memcpy to a properly aligned integer seems to be the only way then... darn, that sux!

    Wouldnt a simple memcpy (without creating a union) be enough?
    char c[5];
    char *cp=c+1;
    long l;
    memcpy (&l,cp);

     
  • Vinicius Kursancew

    Logged In: YES
    user_id=1926381
    Originator: YES

    sure its enough... i was tripping

     
  • Till Toenshoff

    Till Toenshoff - 2007-12-28

    Logged In: YES
    user_id=559680
    Originator: NO

    started to fix those issues - that issue is mostly affecting the decoders, hardly any encoder.

    Following decoders are fixed by now on CVS and should work fine on SPARC machines;
    SMAF
    WAV

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.