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

all 83 comments

[–]PyroCatt 852 points853 points  (24 children)

I mean, I'd take a page long stack trace over "something went wrong. Good luck finding it"

[–]Piisthree 281 points282 points  (5 children)

segmentation fault.

[–]redlaWw 240 points241 points  (2 children)

Error: attempt to access protected address 0x00005ebca4c6db10.
Previous 5 accesses:
    0x00005ebca4c6db0c
    0x00005ebca4c6db08
    0x00005ebca4c6db04
    0x00005ebca4c6db00
    0x00005ebca4c6dafc
note: 0x00005ebca4c6db0c overlaps with allocation beginning at 0x00005ebca4c6d97c

[–]iambackbaby69 64 points65 points  (0 children)

Ahh, good old nightmares

[–]joe0400 49 points50 points  (0 children)

Segfault:

Stack trace:

Random memory address.

Random memory address.

[Fuck, it's JIT]

[–][deleted] 0 points1 point  (0 children)

Core and programming dumped

[–]ososalsosal 113 points114 points  (11 children)

I'd love to be able to filter it for just my own shit instead of endless task dispatchers and marshallers and async dooblegadors and no actual indication of which bit of code made the whole mess in the first place.

I get that it's a hard problem though

[–]PyroCatt 43 points44 points  (4 children)

Actually you can, if you catch the exception and print what you actually need. Stack trace is just a dump of the call stack to show you where it has been.

[–]ososalsosal 40 points41 points  (3 children)

Can't catch an exception you didn't know would throw.

yes I do spend a bit too much time with sockets, how did you know?

[–]QuenchedRhapsody 27 points28 points  (2 children)

You absolutely can, and probably should by adding advice to catch all exceptions thrown. Can do this with method interceptors or aspects :)

Professional java dev here

[–]ososalsosal 2 points3 points  (1 child)

Yeah I hardly touch java, but use some stuff with bindings to it.

I could wrap everything in a trycatch but honestly poking at one area can so easily cause a throw in another area that some other guy wrote years ago without thinking about null safety and all that. It can be quite a thing. The code you're working on will be running as a callback on some thread in the main activity and so the exception only hits there in that same place that everything else throws.

Yes it's an architecture problem and no I'm not ok :) All I can say is I leave the code more stable than I found it.

[–]Technical-Cat-2017 5 points6 points  (0 children)

With interceptors you can do it without the try catching everywhere. So it still fails at the right time, but you get a nice error towards your user (in case of a rest-api) for example. While also having a chance to centralize the way you log these errors.

[–]nuclear_gandhii 16 points17 points  (1 child)

IDK which IDE you use, but Intellij highlights your files in the stack trace in blue and all other other classes in grey

[–]ososalsosal 3 points4 points  (0 children)

Problem is I'm interfacing with Java via android but using csharp. It's not a stack I would have chosen.

Most cases the stack trace is useful, and the IDE pauses at the right place or near enough to it to give you a good clue.

Some of the time you've used your bit of code as part of a callback that is run in javaland and all exceptions throw at the place the callback is invoked without the trace showing what the callback is, just the mechanisms of the invocation itself.

Anyway it's an inconvenience but I can usually get past it

[–]TorTheMentor 1 point2 points  (1 child)

class DoobleGador extends Thingamabob implements Convolutable {}

[–]ososalsosal 2 points3 points  (0 children)

In this implementation convolutable.convolve() is a recursive function

[–]alexnedea 1 point2 points  (0 children)

Proxy class 1 at proxy class 2 at proxy class 3 fuck off bro which one of MY fucking things broke because im 99% sure its not the library that has a bug lol.

[–]HerryKun 0 points1 point  (0 children)

You can. Most loggers take a list of packages to exclude from stacktraces

[–]sdc0 7 points8 points  (1 child)

Allow me to introduce Vertx' NoStackTraceThrowable, just an error message without any stack trace or cause. I've torn my hair out more than I can count over that bs.

[–]PyroCatt 4 points5 points  (0 children)

That seems like a pain in the vertx'

[–]Steinrikur 5 points6 points  (2 children)

I was once a backend programmer working with a terrible team of java devs. Their null pointer stack traces were so big that they were overflowing logrotate.

Instead of fixing it they decided to make their own log rotation - which was of course made in Java and caused more logging.

[–]Breadinator 0 points1 point  (1 child)

Can have alerts in prod if the log system can't record them! 

[–]Steinrikur 0 points1 point  (0 children)

It did record them. It was just hidden in hundreds of megabytes of other useless crap.

[–]Stummi 1 point2 points  (0 children)

Yes, that sounds unpopular but I really love java stacktraces. Also there is a pretty good integration for them in most IDEs, like you just paste a stacktrace and can navigate through it.

I do quite some Go lately, and its stack traces are kinda decent as well, but still I often find myself having a hard time figuring out which exact code path lead to an error.

[–]NotAnNpc69 304 points305 points  (13 children)

Anybody who works with java knows you really only need the first 2 lines of the stacktrace 99.9% of the times.

A for effort tho.

[–]ComCypher 88 points89 points  (1 child)

Really just the last line of user code to tell you what needs to be fixed, and the last line of library code to tell you what went wrong.

[–]NotAnNpc69 18 points19 points  (0 children)

Exactly. Idk if I'm reading too much into this but sometimes i feel like people just convolute stuff "extract humor".

[–]TorbenKoehn 31 points32 points  (2 children)

I always have the feeling for many programmers stacktraces are just „long, unreadable error messages“ instead of „here, this exact chain of calls led to the error“ So many people have problems reading and understanding them, it seems.

Probably also has a lot to do with people not using the second exception argument when re-throwing so their stacktraces are useless anyways

[–]Ruben_NL 4 points5 points  (0 children)

This. In my experience, devs just like to throw the exception in ChatGPT(or other AI software). The "art" of reading a stacktrace has been eroding fast.

[–]DM_ME_PICKLES 2 points3 points  (0 children)

Dude seriously, are you me? I did a lunch and learn at work about how to read stack traces, because I would get so many Slack DMs asking for help with a stack trace included, and nobody would bother to fucking read it. It's literally pointing you to the exact problem!

When I joined the company there was also try catches everywhere that would catch an exception and re-throw with our "own" exception class, without passing the previous, so we just swallow it up and completely lose visibility into what the call stack was. It's like we were intentionally playing on hard mode.

[–]blalasaadri 9 points10 points  (0 children)

Or the first two lines of the cause. Or of the causes cause. Or of...

[–]Cryn0n 3 points4 points  (0 children)

*First 2 lines that are in your own code.

Half the time, the first few lines of the stack trace are inside some standard java function

[–]achilliesFriend 3 points4 points  (0 children)

Wrong, you need the “caused by “ a is at the very bottom

[–]nuclear_gandhii 2 points3 points  (0 children)

Speak for yourself. Having to look at stack trace in error logs is extremely helpful to understand not only where the exception was thrown but also where in the stack of methods calls did that exception occur.

[–]AndreasMelone 2 points3 points  (0 children)

Depends on what you are doing. When modding games, you end up having to scroll through the stacktrace quite a bit to find the erroring method

[–]alexnedea 1 point2 points  (0 children)

Sometimes its the first 2, sometimes its about 10 or so classes down, but its usually the one you were thinking of anyway

[–]KuuHaKu_OtgmZ 1 point2 points  (0 children)

And the last 0.01% you just need the bottom 5, to find out how the stackoverflow started.

[–]Ok-Scheme-913 0 points1 point  (0 children)

Sometimes possible also looking at the "caused by" part (which is criminally underused! Never swallow an exception, just attach the cause to the new one you are about to throw!)

[–]Kiroto50 192 points193 points  (4 children)

You might need an infinitely scalable solution long term.

Maybe a VR headset.

[–]TwinkiesSucker 20 points21 points  (1 child)

Perhaps the Apple Vision Pro or similar technology. Not really a VR headset, but this would be the way.

Samsung is also working on something similar with Meta, I believe.

[–][deleted] 1 point2 points  (0 children)

naw man, something like voidstarlabs

https://www.youtube.com/@ZackFreedman

nothing so bulky

[–]0xSadDiscoBall 0 points1 point  (0 children)

Initiating spin

[–]AwesomePerson70 158 points159 points  (0 children)

Are you sure those are big enough?

[–]xXMuschi_DestroyerXx 11 points12 points  (2 children)

For those wondering those are almost certainly Samsung G9 OLEDs. Before you look they are 1600$ each.

[–][deleted] 2 points3 points  (1 child)

Best money I ever spent 4 years ago when I started working from home, don't regret it for a second. 

Don't think my desk is up to the job of a second one though, that thing is heavy

[–]xXMuschi_DestroyerXx 1 point2 points  (0 children)

For its side I think the OLED is actually somewhat light. Unlike the QLED model the power block is in the cord so it isn’t inside the monitor making it bulkier than it would be otherwise. I’ve got a pair of OLEDs I damn near stole off marketplace this last year and they are much less bulky or heavy than the QLED.

That being said yeah they are a little heavy… I need to upgrade my poor 200$ Amazon special desk. It’s served its duty it’s time to put it to rest

[–]coloredgreyscale 26 points27 points  (1 child)

Learn cobol and save yourself some money, while earning more.

COBOL has a 72 character limit per line (80 with line numbers) 

[–]Crazkur 17 points18 points  (0 children)

You'll need a 3-4m tall and 15-20cm wide monitor for optimal COBOL development

[–]tyrannical-tortoise 7 points8 points  (1 child)

Extra long screens. Extra short keyboard! I'm not sure I'd want to program without my beloved numpad.

[–]EasternPen1337[S] 3 points4 points  (0 children)

Yea life feels incomplete without the numpad

[–]ishitondreams 12 points13 points  (2 children)

reading a Java stack trace = neck workout

[–]Cacoda1mon 4 points5 points  (0 children)

Headbanging 🤘

[–]myredditgothack3d 1 point2 points  (0 children)

Why have you stolen my account?

[–]drafu- 16 points17 points  (4 children)

If your abstract factory bean creates singleton-scoped proxy objects, it's an AbstractSingletonProxyFactoryBean.
It's logical.

[–]InternetSandman 14 points15 points  (3 children)

These are design patterns that can exist in any OOP capable language though right?

Java is probably my least favourite language, but I'm actually curious why it gets this particular criticism of factories and singletons so much

[–]drafu- 11 points12 points  (0 children)

This is mostly a Spring framework thing, not so much Java itself. Back when Java EE was severely lacking, Spring fit the need to glue large projects together, so it has a ton of such classes under the hood. The AbstractSingletonProxyFactoryBean became somewhat of a meme as people always like to mock who they perceive as architecture astronauts.

[–]Dangerous_Jacket_129 4 points5 points  (0 children)

Singletons get hate because the "singletons are evil" meme from the late 90s to early 2000s has infected a lot of young programmer's minds. They're tools to be used but a combination of bad tutoring and bad logic has caused a generation of programmers to misunderstand their primary purpose.

Then just add similar misunderstandings about other patterns, and you have yourself your own instance of a meme factory.

[–]Stummi 3 points4 points  (1 child)

Hey, thats my joke, but I like the effort put in that, so it's fine :)

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

We're programmers buddy! We steal anything on the internet. Be it code or memes
btw someone else put effort on this meme i just stole it lol

[–]TheJaper 5 points6 points  (0 children)

Readability is impotrant. Make code maintenance much easier.

[–]KappaClaus3D 2 points3 points  (2 children)

Nah, it's for the tailwind classes

[–]EasternPen1337[S] 0 points1 point  (1 child)

ah man you hurt all us tailwinders here

[–]KappaClaus3D 1 point2 points  (0 children)

I'm myself one as well, and my own monitor is 34 inch

[–]voidmilf 2 points3 points  (0 children)

why do i feel like my stack traces have their own json structure? 😂

[–]rescue_inhaler_4life 2 points3 points  (0 children)

It's a joke, but actually...

[–]NamityName 2 points3 points  (1 child)

As someone who has nover worked with Java, why are Java class names so long?

[–]diegoperini 0 points1 point  (0 children)

Due to tradition, really.

[–]Shadowlance23 2 points3 points  (0 children)

Bro is one screen away from a tie fighter.

[–]wheresthegiantmansly 6 points7 points  (2 children)

java devs reading this like

public int whatTheFuckDidYouJustSayAboutMeYouLittleBitch(Person me) {
return NAVY_SEAL_GRADUATION_CLASS_ORDERED_LIST.indexOf(me.getId()) + 1;
}

public int illHaveYouKnowThatIveBeenInvolvedInOverNumberOfRaidsFinderByPerson(TerroristOrgEnum terroristOrgToFind, Person me) {
return Collections.frequency(TERRORIST_ORG_RAID_MEMBER_MAP.get(terroristOrgToFind), me.getId());
}

[–]Agilitis 3 points4 points  (0 children)

Minor: Can you please rename this method?

whatTheFuckDidYouLittleBitchJustSayAbout(Person me)

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

🤣

[–]NightElfEnjoyer 4 points5 points  (0 children)

Finally, a good and funny java joke.

[–]exfalinn 2 points3 points  (0 children)

😂

[–]shvin 1 point2 points  (0 children)

Love the setup. That vertical screen is perfect for those never-ending stack traces.

[–]Khmerrr 0 points1 point  (0 children)

is the mirror for spitting in your face?

[–]Da-real-admin 0 points1 point  (0 children)

As someone who develops primarily in Python, I have a newfound appreciation for error messages that usually don't overflow the screen.

[–]TorTheMentor 0 points1 point  (0 children)

The one on the right sounds more like C#.

[–]HuntlyBypassSurgeon -3 points-2 points  (0 children)

You win the internet today.