Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uninitialized value in init_channel #326

Closed
vanosg opened this issue Jan 29, 2017 · 4 comments
Closed

Uninitialized value in init_channel #326

vanosg opened this issue Jan 29, 2017 · 4 comments
Milestone

Comments

@vanosg
Copy link
Member

vanosg commented Jan 29, 2017

==28123== Conditional jump or move depends on uninitialised value(s)
==28123==    at 0x7C18139: recheck_channel (chan.c:881)
==28123==    by 0x7C1859C: got315 (chan.c:1152)
==28123==    by 0x77EDBB8: server_raw (server.c:1150)
==28123==    by 0x4E75693: TclInvokeStringCommand (in /usr/lib/x86_64-linux-gnu/libtcl8.6.so)
==28123==    by 0x4E77A86: TclNRRunCallbacks (in /usr/lib/x86_64-linux-gnu/libtcl8.6.so)
==28123==    by 0x4E787BA: ??? (in /usr/lib/x86_64-linux-gnu/libtcl8.6.so)
==28123==    by 0x4E78092: Tcl_EvalEx (in /usr/lib/x86_64-linux-gnu/libtcl8.6.so)
==28123==    by 0x4E792A4: Tcl_Eval (in /usr/lib/x86_64-linux-gnu/libtcl8.6.so)
==28123==    by 0x4E7A2C5: Tcl_VarEvalVA (in /usr/lib/x86_64-linux-gnu/libtcl8.6.so)
==28123==    by 0x4E7A398: Tcl_VarEval (in /usr/lib/x86_64-linux-gnu/libtcl8.6.so)
==28123==    by 0x439872: trigger_bind (tclhash.c:739)
==28123==    by 0x439872: check_tcl_bind (tclhash.c:873)
==28123==    by 0x77ED0D9: check_tcl_raw (servmsg.c:182)
==28123==    by 0x77ED0D9: server_activity (servmsg.c:1077)
==28123==  Uninitialised value was created by a heap allocation
==28123==    at 0x4C28C20: malloc (vg_replace_malloc.c:296)
==28123==    by 0x42B8C4: n_malloc (mem.c:332)
==28123==    by 0x42F7B5: mod_malloc (modules.c:984)
==28123==    by 0x75C9AB8: init_channel (tclchan.c:1937)
==28123==    by 0x7C0EB54: reset_chan_info (irc.c:423)
==28123==    by 0x7C15DD0: gotjoin (chan.c:1835)
==28123==    by 0x77EDBB8: server_raw (server.c:1150)
==28123==    by 0x4E75693: TclInvokeStringCommand (in /usr/lib/x86_64-linux-gnu/libtcl8.6.so)
==28123==    by 0x4E77A86: TclNRRunCallbacks (in /usr/lib/x86_64-linux-gnu/libtcl8.6.so)
==28123==    by 0x4E787BA: ??? (in /usr/lib/x86_64-linux-gnu/libtcl8.6.so)
==28123==    by 0x4E78092: Tcl_EvalEx (in /usr/lib/x86_64-linux-gnu/libtcl8.6.so)
==28123==    by 0x4E792A4: Tcl_Eval (in /usr/lib/x86_64-linux-gnu/libtcl8.6.so)
==28123== 
@vanosg vanosg added this to the v1.8.1 milestone Jan 29, 2017
@Cizzle
Copy link
Member

Cizzle commented Feb 3, 2017

Could you put steps to reproduce? I'm suspecting m->tried_getuser is the culprit and needs adding at chan.c L1071 and chan.c L1793.

@vanosg
Copy link
Member Author

vanosg commented Feb 3, 2017

Joining a channel that is empty (the bot is the first user)

@vanosg
Copy link
Member Author

vanosg commented Feb 3, 2017

You're on the right path- I stuck it in there and set to 1 just as a quick fix, and that seems to have 'fixed' it. Question is, do those calls belong there, or should it be initialized earlier, or a little bit of both? I can look at it in a bit, but I'm going to bet you'll be faster :)

@thommey
Copy link
Member

thommey commented Feb 3, 2017

fix: change tclchan.c:1937 (init_channel) to use channel_malloc instead of nmalloc for the first element of the chan->channel.member list

vanosg added a commit that referenced this issue Feb 3, 2017
* Call bzero() after nmalloc() when initializing a new channel to properly zero all data since channel_malloc() isn't available.
thommey pushed a commit to thommey/eggdrop that referenced this issue Mar 23, 2017


* Call bzero() after nmalloc() when initializing a new channel to properly zero all data since channel_malloc() isn't available.
thommey pushed a commit to thommey/eggdrop that referenced this issue Mar 24, 2017


* Call bzero() after nmalloc() when initializing a new channel to properly zero all data since channel_malloc() isn't available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants