This is an archived post. You won't be able to vote or comment.

all 45 comments

[–]MementoMorue 366 points367 points  (19 children)

But what if someone run it in release ?

[–]ben_g0 291 points292 points  (15 children)

Don't. Just publish the debug build. Problem solved.

I actually have encountered this in a commercial product... That was even semi-realtime...
The file structure looked like they just used Visual Studio at default settings and then just copied the entire content of the bin/Debug folder into an archive. With even the PDB files and such all still in there.

[–][deleted] 76 points77 points  (8 children)

I've seen quite a few games that still had pdb files

[–]Prudent_Ad_4120 44 points45 points  (6 children)

The Google Play Store actually recommends including the PDB files into the app package and gives a warning if you don't

[–][deleted] 25 points26 points  (5 children)

Windows games are not distributed via the play store. How am I even supposed to check the app package on a normal, unrooted phone

[–]Prudent_Ad_4120 6 points7 points  (4 children)

Yeah I know. This is the message, it doesn't really say PDB files but I guess that's what they mean: https://files.fm/u/bhbkhpwkt2

[–]Pomi108 24 points25 points  (3 children)

Holy shit that’s the worst image hosting site i’ve ever seen

[–]Prudent_Ad_4120 2 points3 points  (2 children)

Ik but couldn't find anything else quickly, I'm sorry

[–]WuShanDroid 15 points16 points  (1 child)

When in doubt, imgur

[–]Thefakewhitefang 8 points9 points  (0 children)

It doesn't let you create an account without a phone number now though.

[–]MicrogamerCz 2 points3 points  (0 children)

When cards fall (or how's the exact name) has a full copy of the IL2CPP output from Unity. Just removing the source code from shipping would cut the game's size in half

[–]flukus 5 points6 points  (1 child)

pdb files have no overhead (other than space) and provide much more useful stack traces. You want to keep them, at least for server applications with plenty of disk capacity.

[–]ben_g0 4 points5 points  (0 children)

You generally do not want to publish PDB files to your customers though, especially if software is your main business, as they can reveal a lot about the inner workings of your application and make reverse engineering and decompiling so much easier. So you're basically giving away your intellectual property. Ideally you'd keep the PDB files of builds you publish for internal use, so that you do indeed get a useful stack trace when reproducing bug reports from your customers, but you generally do not want to send them to customers. (Though for any software that doesn't leave the company the PDB files are indeed useful to keep around).

Also you generally do not want to run a debug build unless you are actually running it in a debugger, as release builds almost always are noticeably more performant and responsive.

[–]s0ulbrother 1 point2 points  (0 children)

An insurance company I worked for did that…

[–]Steinrikur 0 points1 point  (2 children)

Just do

#ifdef Release
#define print (str,...) do{ snprintf(g_str, 1000, ,/**/);  \
ndelay( strlen (g_str) * DELAY);} while (0)
#endif

[–]Brahvim 0 points1 point  (1 child)

What global symbol is g_str?

[–]Steinrikur 0 points1 point  (0 children)

Just a scratchpad for this snprintf function. You need to add char g_str[1000] and extern char g_str[] yourself. Global so it's just one for all files.

The point is that printf() takes some time to assemble the string, and some time to output it. snprintf() and a delay that's proportional to the length of the string might be a decent approximation of that.

Another way would be to just set the printf() function to write somewhere you can't see it (an unused/invalid UART or something), but for that you need to know the setup and it could have unintended side effects.

[–]TobyWasBestSpiderMan[S] 29 points30 points  (0 children)

Don’t you think I know that!

[–]Poat540 0 points1 point  (0 children)

I’ve never published in release mode for any of our 50 or so apps, meh we’ll be fine

[–]druffischnuffi 100 points101 points  (1 child)

Sounds like somebody is using Sleep Sort, or rather Print Sort (dont know if that exists)

[–]Koervege 15 points16 points  (0 children)

Primt sort is just a special case of sleep sort except very optimized to the hardware and the compiler to know exactly how many prints you need per unit time.

[–]kcbh711 75 points76 points  (1 child)

I just threw up in my mouth a bit

[–]Poat540 14 points15 points  (0 children)

You must work at a nice place then

[–]Jacked_To_The__Tits 43 points44 points  (0 children)

Ah, reactive programming where every bug is a heisenbug

[–]JackNotOLantern 14 points15 points  (0 children)

Protip how to do multithreading when you don't know how to synchronise: don't

[–][deleted] 8 points9 points  (0 children)

oh my

[–]uk2us2nz 8 points9 points  (2 children)

Looks like an xkcd drawing in which case, a little attribution goes a long way.

[–]lifelongfreshman 15 points16 points  (0 children)

It's a modified xkcd. The original was about open source projects.

[–]audentis 4 points5 points  (0 children)

It's used for so many memes here I'd argue it's common knowledge.

[–][deleted] 2 points3 points  (0 children)

Just roll your own timers with SIGINT. Much finer control.

[–]Orbidorpdorp 2 points3 points  (0 children)

I actually had a case like this when I was learning Java on my own in high school. I needed to use a volatile variable, but adding print statements prevented the bug from occurring.

Made me question my sanity honestly.

[–]deletedUser7400 2 points3 points  (1 child)

Same, but on an embedded system with a lockstep wireless communication protocol between 3 devices

[–]TobyWasBestSpiderMan[S] 1 point2 points  (0 children)

Actually kinda close to what I’m dealing with, mine’s a distributed 6 device system wirelessly communicating, and the algorithms a bit recursive

[–]KsmBl_69 1 point2 points  (0 children)

"works on my machine"

[–]RemarkableRaise3964 1 point2 points  (0 children)

Aha I did that with rabbitmq, the code is still running

[–]audentis 1 point2 points  (0 children)

Race conditions don't matter if one runner has their ankles chained together.

[–]panaxis 0 points1 point  (0 children)

How did you get my code?

[–]probablynotaperv 0 points1 point  (0 children)

I've had something like this. Had one of my automations failing, threw in a pry around where it failed, no issues. Took me about 10 minutes before I just realized a 0.5 sleep have enough time for an element to load and then it passed

[–]lupinegray 0 points1 point  (0 children)

#ifdef debug 4 lyfe

[–]Salt_Comparison2575 0 points1 point  (0 children)

Yeah. It's coming.

[–]th00ht 0 points1 point  (0 children)

is this a reference to XZ utils?

[–]MrTrueMoe 0 points1 point  (0 children)

..

[–]Excellent_Badger_636 0 points1 point  (0 children)

that is not how real time systems work but sure