Tell us your stories.
#nginx
2017/07/10 05:33:53 [error] 29204#29204: _1 broken header: "GET / HTTP/1.1 Host: 10.0.1.116 Connection: keep-alive Cache-Control: max-age=0 Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,_/*;q=0.8 DNT: 1 Accept-Encoding: gzip, deflate, sdch Accept-Language: en-US,en;q=0.8
The hardest bug that I've ever had to debug was (gasp) a quirk in Internet Explorer. Older versions of IE did not initialize the methods of console until the debugging console was activated. So if your JavaScript code called console.log(), an error would occur. But as soon as you opened the debugging console to investigate, the failure conditions no longer exist. Took me several days of stumbling around in the dark until I finally happened across a SO post describing the bug.
I have two bugs I'm very proud of finding.
The first was a weird bug in which a piece of cross-platform proprietary boxed software my company wrote would hang. It was seemingly random.
I asked someone to get a freeze it and get a stack trace next time it hung. The person still couldn't figure out what was going on, so I looked at it and figured out that it was grabbing a mutex inside the malloc call inside a signal handler that had fired during a malloc call. The main thread was deadlocking with itself.
I fixed it by changing the signal handler to simply poke a byte into a pipe so the main process' event loop would wake up and call the handler from within the main event loop.
The second was a similarly weird bug in a specialized web server running on Linux that was originally chalked up to 'poorly implemented consumer routers'.
The main event loop was using the select system call and they had also fiddled the ulimit to allow 8192 open file descriptors per process. It turned out that the kernel they were using had a compiled-in limit on the select bit-vector size of 1024 (which is the standard limit for Linux kernels). So basically any connection assigned a file handle of >1024 was going to be ignored.
The best solution would've been to use epoll because poll exhibits poor scaling behavior (it requires a linear search every time an event happens). But that would've required significant re-architecting of the main event loop and that was out-of-scope.
So I told the person to fix it by using poll, which takes an array of pollev structs of arbitrary size (the size is passed in) and from a design standpoint is basically a drop in replacement for select. That solved the problem
If you've never worked on large websites in old browsers, this one will be news to you.
Older versions of Internet Explorer only load a certain amount of CSS before they stop reading the rest of the file with no warning.
There are 3 limits:
@import up to 31 sheets@import nesting supports up to 4 levels deepThat was quite an exotic bug to run into at the time. It took me quite a while to figure out what was going on.
I am not very sure if this is the hardest bug - lets say this is my recent hardest bug I dealt with.
I was working on a page that made heavy use of jQuery and used dynamic visualization tools to represent data in various formats : donut charts and sortable, searchable, editable tables. This page had about 21,000 lines of code separated into partials using handlebars. Initially, the page took 4.53s to load.I debugged every section of this page and implemented all sorts of performance improvement measures to reduce the page load time to less than 1s.
This part of my job was an eye opener for me in the sense how all the common programming mistakes committed earlier , when combined together in a page, were able to make such an impact on the performance.
Some highlights were:
The hardest code for me to debug in general seems to be JavaScript. For the longest time there has been no "serious" debugging environment for it and although Chrome has made tremendous strides here, there still isn't the debugging capability that could rival GDB, OllyDbg, and WinDbg for example.
I also thought that trying to debug code which was crashing the browser by using a tool in that same browser was utterly insane. Yeah, I don't miss JS :D
The hardest one for me had to be a null pointer in C in a system over 20 years ago. Took me a week to find that one. I don't remember anything about the actual issue, only that a week of my life was gone due to a null pointer.
php segement fault in php5.5 that randomly appeared in certain forked processes ... in the end it was an issues with the package and the kernel. Still as soon as you have to use the strace + gdb with php you know there is a bigger issue :)
I got a huge admin panel and there were a lot of different forms, entities and sub-entities. In one model when I checked a box and saved a form I still had 0 in DB, then I started debugging. Due to a complexity of the system and my lack of knowledge that time about how "not smart" people can be, it took me almost a week of debugging 50k lines of log files per request to finally fix that damn checkbox.
At the end it turned out that it was because of some "smart" developer in the past replaced that property accessor on the lowest level in the model and there was a business logic implemented and other properties used in combination.
So basically it was something like Model.isActive = 1; but you still got 0.
Years later now I know what humans are and what they can do, so today I debug taking my own "human stupidity" factor into account.
But seriously, never do such things. You have controllers or at least some helpers for that.
My life....only joking.........it's turned into a feature now.
Jacob Beltran
undefined is not a function.
Stefan Neculai
I'm one of the main devs at Froala Editor and I'm doing this for the last 4 years now. I've had lots of things to deal with while working with the browser editable fields.
I think there are 2 kind of hard bugs: