Comments (10)
@willfong Can you clarify that the following steps will reproduce it:
- Install Ubuntu 16.04
- Run
sudo apt-get install mariadb
- Install Bedrock per the instructions at http://bedrockdb.com
- Run
service bedrock start
- Run
mysql -h127.0.0.1 -e "SELECT 1 AS foo, 2 AS bar;"
Is there anything more to it than that -- no special commands or anything?
Tips for fixing:
Here are some pointers to anyone who wants to fix this:
- The MySQL compatibility layer is entirely in
MySQL.cpp/h
- The
getPort()
command is what causes the plugin to open a port - Each time a connection is received on that port,
onPortAccept()
is called - The MySQL protocol is a bit unusual in that the server is the first to announce itself on a new connection, which it does to here
- All MySQL packets are parsed and constructed using the simple
MySQLPacket
struct - Specifically, it sends back the results of
MySQLPacket::serializeHandshake()
- It's possible, but unlikely that that's where it crashes. Odds are the client receives that handshake successfully, and then responds with a request that crashes Bedrock.
- That request would be processed in
onPortRecv()
, which is called whenever a socket accepted on the plugin's port receives data - To see the most verbose logging, start
bedrock
using the-v
flag. This will cause itsSDEBUG()
log lines to execute (eg, like here) - MySQL is a pretty harsh and unforgiving binary protocol, so this often requires manually inspecting the hex-encoded request and comparing against the rather confusion (to me, at least) binary protocol documentation.
- In particular, it uses a super-optimized length-encoded integer format, which you can see how to encode here.
- Incidentally, I'd suggest adding a
SINFO("Executing true query")
line here, as that's the only code path I see that doesn't log what's happening clearly. - However, it looks from the log provided that it's crashing on the query
select @@version_comment limit 1
, which should be processed here, and should in theory successfully return this value here. - But that's a nasty little bit of code, so I could easily imagine a crash bug existing in there.
Regardless, if this is a reliably reproducible problem, that happens during connection setup, it should be relatively easy to fix -- especially since it seems to be happening after the packet itself was parsed. (Bugs during parsing are a lot harder to fix.)
Any volunteers to take it on?
from bedrock.
FYI, posted an Upwork job here if anybody would like to earn a quick $500: https://www.upwork.com/jobs/_~013f98c7e3d216f1a1
from bedrock.
@quinthar Yes, those steps are correct. Thanks for looking into this!
from bedrock.
@willfong, could you check if the bug reproduced on 7ece319 ?
I've tried to do it, but all work fine:
// tty.1
$ ./bedrock -clean -v -plugins status,db,jobs,cache,mysql -cache 10001
// tty.2
$ mysql --version
mysql Ver 15.1 Distrib 10.0.28-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
$ mysql -h127.0.0.1 -e "SELECT 1 AS foo, 2 AS bar;"
+------+------+
| foo | bar |
+------+------+
| 1 | 2 |
+------+------+
from bedrock.
@willfong - Can you please rebuild from the master branch and test to see if you can reproduce this issue? Thanks!
from bedrock.
@willfong - Eager for your comments here, btw.
from bedrock.
@quinthar Hi, Sorry about the delay. This week is a bit busy for me, but I can check it out next week. Thank you very much for your fast resolution to this 😄
from bedrock.
Sorry, this week has been terribly busy for me. Can we mark this as resolved for now? When I get some time again, I can open a new issue if I encounter this again. Thank you again for the prompt resolution!
from bedrock.
@willfong , I can send you already built Bedrock binaries in tgz, so you should just run your test. If it's ok, send me a mail to vadius[]vadius.ru, I'll reply with the archive.
from bedrock.
@willfong should be fixed by #127
from bedrock.
Related Issues (20)
- Failed to open TCP port 'localhost:9999': couldn't bind(errno=98 'Address already in use') HOT 2
- Failed to open TCP port 'localhost:3306': couldn't bind(errno=98 'Address already in use') HOT 2
- yaourt is no longer maintaned, should be replaced in the installation guide
- Formal Protocol Description? HOT 2
- Jobs plugin: NACK?
- macOS Monterey Build Failure HOT 2
- Last release in late 2020... is this project still a priority for Expensify? HOT 3
- Blocking queries until a write operation has synchronized across the cluster?
- Which units are used for peekTime, totalTime, etc...?
- Beginner experience needs polish.
- MySQL Plugin is broken HOT 2
- `test/test` looks for `bedrock` in the `PATH` HOT 4
- Can this project work in collaboration with https://github.com/tursodatabase/libsql ? HOT 1
- Probably a missconfig HOT 1
- Official Bedrock Docker image HOT 1
- MySQL plugin is not processing command line arguments HOT 1
- libstuff/libstuff.h:5:10: fatal error: arpa/inet.h: No such file or directory HOT 1
- Make generate_series() available HOT 5
- controlport CLI param missing from help and causing address in use error
- --
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bedrock.