Club PA 2.0 has arrived! If you'd like to access some extra PA content and help support the forums, check it out at patreon.com/ClubPA
The image size limit has been raised to 1mb! Anything larger than that should be linked to. This is a HARD limit, please do not abuse it.
Our new Indie Games subforum is now open for business in G&T. Go and check it out, you might land a code for a free game. If you're developing an indie game and want to post about it, follow these directions. If you don't, he'll break your legs! Hahaha! Seriously though.
Our rules have been updated and given their own forum. Go and look at them! They are nice, and there may be new ones that you didn't know about! Hooray for rules! Hooray for The System! Hooray for Conforming!

[Programming] Thread: Fixed last bug in 5 month thread

19495969798100»

Posts

  • urahonkyurahonky Registered User regular
    I'm a rebel. I use single and double quotes in the same line.

    It pains me to go back to Java where single quotes is only for chars and double quotes are for strings.

  • TofystedethTofystedeth veni, veneri, vamoosi Registered User regular
    Python strings
    'string'
    "alsostring"
    "string with 'quotes' "
    ' "scare quotes" '
    """ the fuck
    even is 
    this"""
    
    ''' nooo single
    quotes
    not you 
    too! '''
    

    steam_sig.png
    EchozerzhulurahonkyDisruptedCapitalistThe AnonymousDelmainFolken FanelInfidelecco the dolphinAngelHedgieCokebotle
  • a5ehrena5ehren AtlantaRegistered User regular
    Hrm, having a weird segfault issue, but I want to save it for the next thread so I actually get help :P

  • bowenbowen How you doin'? Registered User regular
    Oh shit I didn't even realize we're at 100.

    Ladies.
  • BarrakkethBarrakketh Registered User regular
    Python strings
    """ the fuck
    even is 
    this"""
    
    Not sure if serious, but that is a multiline string. Handy for docstrings, CLI help (argparse et al), and regular expressions using the verbose flag:
    a = re.compile(r"""\d +  # the integral part
                       \.    # the decimal point
                       \d *  # some fractional digits""", re.X)
    
    Which can help save your sanity when dealing with long/complex expressions and you're using features like named groups.

    Rollers are red, chargers are blue....omae wa mou shindeiru
  • TofystedethTofystedeth veni, veneri, vamoosi Registered User regular
    Not serious. Just like poking fun.
    I <3 Python.

    steam_sig.png
  • crimsoncoyotecrimsoncoyote Registered User regular
    edited August 2015
    ihavenoideawhatimdoing

    it's k
    we got this
    #hackathon

    crimsoncoyote on
    urahonkyecco the dolphin
  • InfidelInfidel Heretic Registered User regular
    ihavenoideawhatimdoing

    it's k
    we got this
    #hackathon

    I won my last hackathon. The pressure is on you now, cc!

    OrokosPA.png
    Play D&D 4e? :: Check out Orokos and upload your Character Builder sheet! :: Orokos Dice Roller
    The PhalLounge :: Chat board for Critical Failures IRC! :: #CriticalFailures and #mafia on irc.slashnet.org
    crimsoncoyoteecco the dolphin
  • a5ehrena5ehren AtlantaRegistered User regular
    edited August 2015
    class BaseCls
    {
    	public:
    	virtual void Cleanup() {};
    	SIGNAL *ReleaseSignal() {
    		//stuff
    		Cleanup(); //SIGSEGV, code 1 "address not mapped to object"
    		//stuff
    	};
    }
    
    class derivedCls : public BaseCls
    {
    	public:
    	void Cleanup() {};
    }
    
    class ddCls : public derivedCls
    {
    	//nothing useful
    }
    
    void Function (void){
    	ddCls thing;
    	//this goes straight to the base class because the intermediates do not overload it...
    	//  so it calls the virtual in the base class?
    	thing.ReleaseSignal();
    }
    

    This is obviously greatly simplfied, but the general flow is the same.

    Only change is going from GCC 4.6/C++03 to GCC 4.9/C++11. I assume it is something to do with calling the virtual function, but I really have no idea.

    Cleanup() is an empty function everywhere I've seen it, so I don't know why they bothered making it virtual (or making it in the first place).

    a5ehren on
  • TofystedethTofystedeth veni, veneri, vamoosi Registered User regular
    Yes Visual Studio, complain in the part of the XAML where I defined the style that the target type doesn't match the thing I tried to apply it to, instead of where I made the bogus assignment.
    That makes perfect sense.

    steam_sig.png
    bowen
  • bowenbowen How you doin'? Registered User regular
    It's so hit or miss what it complains about.

    Ladies.
  • djmitchelladjmitchella Registered User regular
    GnomeTank wrote: »
    At a fundamental level it's no different than just using HTML. The syntax differs. You're not using Jade or Handlebars for the templating so much in this case as using it for syntax, which many people prefer over HTML. No different than writing your React's JavaScript code in Coffee or TypeScript (which is a touch harder because of the way JSX works, but people are doing it).

    Okay, that makes sense; thanks for explaining!

  • PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    a5ehren wrote: »
    class BaseCls
    {
    	public:
    	virtual void Cleanup() {};
    	SIGNAL *ReleaseSignal() {
    		//stuff
    		Cleanup(); //SIGSEGV, code 1 "address not mapped to object"
    		//stuff
    	};
    }
    
    class derivedCls : public BaseCls
    {
    	public:
    	void Cleanup() {};
    }
    
    class ddCls : public derivedCls
    {
    	//nothing useful
    }
    
    void Function (void){
    	ddCls thing;
    	//this goes straight to the base class because the intermediates do not overload it...
    	//  so it calls the virtual in the base class?
    	thing.ReleaseSignal();
    }
    

    This is obviously greatly simplfied, but the general flow is the same.

    Only change is going from GCC 4.6/C++03 to GCC 4.9/C++11. I assume it is something to do with calling the virtual function, but I really have no idea.

    Cleanup() is an empty function everywhere I've seen it, so I don't know why they bothered making it virtual (or making it in the first place).

    So the call order here would be base::releasesignal -> derived::cleanup. Everything should be fine here unless something interesting happens in those stuff blocks

    Magic Box
    Academician Prokhor "Phyphor" Zakharov, Chief Scientist of China, Provost of the University of Planet - SE++ Megagame
  • a5ehrena5ehren AtlantaRegistered User regular
    edited August 2015
    Except my core dump has it calling base::cleanup, and then GDB can't access the memory at the address the segfault is reporting (which is not the address for base::cleanup...) . So I'm not even sure what it's trying to do, but the segfault disappears if I comment out the call to cleanup() in the releasesignal method.

    My suspicion is some kind of stack overflow (the main "stuff" block in the function is loading up a fuckoff-huge signal), but I'm not sure why that would only show up after I changed compilers.

    a5ehren on
  • bowenbowen How you doin'? Registered User regular
    Hmm yeah I would expect that.

    ReleaseSignal calls Cleanup, so Cleanup should be the top most on your stack?

    I imagine the problems are in //stuff

    Ladies.
  • JasconiusJasconius sword criminal mad onlineRegistered User regular
    if I had a nickel for every "how did it even run in the first place" moment...

    id have a shitload of nickels

  • bowenbowen How you doin'? Registered User regular
    Jasconius wrote: »
    if I had a nickel for every "how did it even run in the first place" moment...

    id have a shitload of nickels

    Maybe even a dollar!

    Ladies.
  • bowenbowen How you doin'? Registered User regular
    Actually it should be going into derivedCls' cleanup shouldn't it?

    Why is it attempting to use the BaseCls? Sounds like there might be a compiler option or some such that's fucking with this?

    Ladies.
  • JasconiusJasconius sword criminal mad onlineRegistered User regular
    when you fix the last bug in a four month project....

    bowen
  • ecco the dolphinecco the dolphin Registered User regular
    Jasconius wrote: »
    when you fix the last bug in a four month project....


    Haha, good way to end the thread! =)

    New thread here:

    http://forums.penny-arcade.com/discussion/200316/this-is-new-programming-thread-0-days-since-last-bug

    Penny Arcade Developers at PADev.net.
  • a5ehrena5ehren AtlantaRegistered User regular
    edited August 2015
    bowen wrote: »
    Actually it should be going into derivedCls' cleanup shouldn't it?

    Why is it attempting to use the BaseCls? Sounds like there might be a compiler option or some such that's fucking with this?

    Only compiler options are -O0 and -std=gnu++11, with -Wall and -Wextra for good measure. Static analysis on the two classes doesn't come up with anything, either.

    My next thing to try is either Address Sanitizer or Valgrind.

    a5ehren on
  • bowenbowen How you doin'? Registered User regular
    Hmm, seems to work 100% fine on Visual Studio and a few other online based ones.

    Ladies.
  • a5ehrena5ehren AtlantaRegistered User regular
    Yeah, I guess I'll run it with ASAN and see if it is a stack issue.

This discussion has been closed.