Strange things

What's Hot
See the code extract below (it's C)

        e = &d->sd.w.events.EventList[i];
//        fprintf(channel,"dev=%s id=%d value=%d op=%s\n",e->dev_str,e->dev_id,e->event,op_list[e->op])
// possible compiler or library bug prevents printing all these at once. you get a segmentation fault, but not if you do 'em separately
        fprintf(channel,"dev=%s ",e->dev_str);
        fprintf(channel,"id=%d ",e->dev_id);
        fprintf(channel,"value=%d ",e->event);
        fprintf(channel,"op=%s\n",op_list[e->op]);

The fprintf with the comment delimiter in front used to work, until I rebuilt the program on the latest Debian brew. Then it fell over, so I split the fprintf up to see which item was causing the fault, and discovered that they all work - individually. My suspicion is in the comment. has anyone else any other insight?

"Working" software has only unobserved bugs. (Parroty Error: Pieces of Nine! Pieces of Nine!)
Seriously: If you value it, take/fetch it yourself
0reaction image LOL 0reaction image Wow! 0reaction image Wisdom

Comments

  • PolarityManPolarityMan Frets: 7282
    Wouldn't be the first time glibc update breaks things, I reckon it's more likely that the memory in one of your structures has been free'd or never been initialized and it just happens to work due to a memory overlay in the individual case.
    ဈǝᴉʇsɐoʇǝsǝǝɥɔဪቌ
    0reaction image LOL 0reaction image Wow! 0reaction image Wisdom
  • ddloopingddlooping Frets: 325
    Very strange indeed!  :-O   :D
    0reaction image LOL 0reaction image Wow! 0reaction image Wisdom
  • bertiebertie Frets: 13567
    zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz



    :))
    just because you don't, doesn't mean you can't
     just because you do, doesn't mean you should.
    0reaction image LOL 0reaction image Wow! 0reaction image Wisdom
  • spacecadetspacecadet Frets: 671
    Eh?
    0reaction image LOL 0reaction image Wow! 0reaction image Wisdom
Sign In or Register to comment.