-
-
Notifications
You must be signed in to change notification settings - Fork 13
segmentation fault with example project from README #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
That's interesting. Can you post the contents of "basic_queries.sql"? Also, can you run it via gdb/lldb to get a backtrace? |
content of the file could be found here https://github.com/alex-dukhno/isomorphicdb/blob/main/docs/user-guide/sql/basic_queries.sql
let me set it up and try to run it |
also, I suppose it's worth pointing out that that example is meant to be run as: That said, you should have just gotten a parse error, not a core dump |
I configured https://github.com/japaric/rust-san#how-to-use-the-sanitizers
|
That’s helpful. Thanks. It crashed in Postgres’ code which means I’ve got a bug somewhere on the rust side (likely). I’ll investigate. But like I said above, you’re using that example wrong. :) |
Give me a minute 😄
|
What kind of MacBook do you have? Is it a new M1? |
|
So the "scanner" example works fine, but the basic example that simply calls the I can't re-create this locally on my MacBook. Still looking... |
what version of Rust are you using? I'm kinda stumped at the moment. There's gotta be some difference between our environments. |
Ok, so I run the following experiment.
I suppose the difference somewhere in project configuration ... |
can you tar up your example project that fails and post it here? or email it to me: eebbrr @ gmail dot com |
I was on |
Your project works for me:
|
(oh, and this is with |
This fixes the sigfault in my project diff --git Cargo.toml Cargo.toml
index 5eed888..61b715c 100644
--- Cargo.toml
+++ Cargo.toml
@@ -5,6 +5,6 @@ authors = ["Alex Dukhno <[email protected]>"]
edition = "2018"
[dependencies]
-postgres-parser = "0.2"
+postgres-parser = { path = "../postgres-parser" }
serde = { version = "1.0.123", features = ["derive"] }
serde_json = "1.0.62" Is this possible because building parser locally is different from building and compiling it from crates.io? is it because of |
wel, that's interesting. I used it from crates.io too. And my private project that uses it builds it from crates.io w/o any problems. What does |
Weird question, maybe because it is night here 🤦 , I have postgres installed locally could it cause some problem? |
Naw. I do too -- 6 different versions!
I've just removed my |
Yeah, that worked fine too. I'm clueless at the moment. 😢 |
Ok, I will debug it with lldb tomorrow. I hope I get something useful. Thanks for the help |
May you can try removing your ~/.cargo/registry directory, doing a cargo clean, and see what happens? This is definitely weird. What version of clang do you have? Mine is:
Which apparently I must have installed via brew. |
I did and got the same
I've installed llvm today via brew
|
well, actually, that's the clang installed by XCode. I wonder if that's a thing... There's a "known issue" with that, and I wonder if that's what we're seeing: https://github.com/zombodb/postgres-parser#known-issues |
Then I am wondering why example works fine? How is it possible that in directly cloned repo another clang is used? |
Yeah. I’m wondering that too. I dunno. Soooo weird. |
I wonder if it has something to do with diff --git a/Cargo.lock b/Cargo.lock
index 3a93997..e8886be 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -75,9 +75,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "clang-sys"
-version = "1.0.3"
+version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0659001ab56b791be01d4b729c44376edc6718cf389a502e579b77b758f3296c"
+checksum = "f54d78e30b388d4815220c8dd03fea5656b6c6d32adb59e89061552a102f8da1"
dependencies = [
"glob",
"libc",
@@ -101,9 +101,9 @@ dependencies = [
[[package]]
name = "env_logger"
-version = "0.8.2"
+version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f26ecb66b4bdca6c1409b40fb255eefc2bd4f6d135dab3c3124f80ffa2a9661e"
+checksum = "17392a012ea30ef05a610aa97dfb49496e71c9f676b27879922ea5bdf60d9d3f"
dependencies = [
"atty",
"humantime",
@@ -159,9 +159,9 @@ checksum = "b7282d924be3275cec7f6756ff4121987bc6481325397dde6ba3e7802b1a8b1c"
[[package]]
name = "libloading"
-version = "0.6.7"
+version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "351a32417a12d5f7e82c368a66781e307834dae04c6ce0cd4456d52989229883"
+checksum = "6f84d96438c15fcd6c3f244c8fce01d1e2b9c6b5623e9c711dc9286d8fc92d6a"
dependencies = [
"cfg-if",
"winapi",
@@ -239,9 +239,9 @@ dependencies = [
[[package]]
name = "quote"
-version = "1.0.8"
+version = "1.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "991431c3519a3f36861882da93630ce66b52918dcf1b8e2fd66b397fc96f28df"
+checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7"
dependencies = [
"proc-macro2",
] |
let me update all the dependencies and Cargo.lock and publish v0.2.3 and lets see what happens. |
and it works ...
|
hmm. So it has something to do with Apple's clang/llvm toolchain. That's cool. :( I've just published v0.2.3 with updated deps and Cargo.lock. You'll need to do a |
I've uninstalled brew's llvm and am trying from scratch with Apple's. If I can reproduce it here then I can probably debug it. |
Okay, so And I think with that, the |
That is the most possible explanation. The only thing is that I can't explain is that if building parser requires EDIT |
Hi thank you for this crate, I am considering to use it in my db project instead of sqlparser
However, when I tried to run simple project from README example:
I got segmentation fault:
however, when I run one example (e.g.
scanner
) it works 🤷♂️ :any advice on how to troubleshoot this appreciated 😄
The text was updated successfully, but these errors were encountered: