Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upRuntime Error Causes Hard Crash When Performing Inserts With Bad Schema #1825
Comments
This comment has been minimized.
Beamed
commented
Aug 23, 2018
|
This is apparently an issue with the schema of the database; I was using a bit when I should have been using a boolean (too much time in MSSQL land). However, I think the error handling here could be improved. I've updated the title to reflect that. Is there anything I can do to assist with that? |
Beamed
changed the title from
Runtime Error Causes Hard Crash When Performing Inserts
to
Runtime Error Causes Hard Crash When Performing Inserts With Bad Schema
Aug 23, 2018
This comment has been minimized.
|
I've attempted to reproduce your issue with the steps provided, and was unable to. As written, the code prints
A cursory googling shows that the error code you provided is a generic access error on Windows (e.g. their version of a segfault). There is no unsafe code involved in the serialization of booleans, so I suspect this is caused by a misconfiguration in your system, likely in the version of libpq.dll you are linking against. Since there appears to be no actionable bug in Diesel here, I'm going to close this issue. Feel free to continue to ask questions here, but I can't guarantee we will be able to help with specific configuration issues |
sgrif
closed this
Aug 31, 2018
This comment has been minimized.
Beamed
commented
Aug 31, 2018
|
Thanks for digging further into the issue; I was unable to find information on the error itself at all. It looks like you're able to get an appropriate error; was it maybe an issue of the nightly on Aug 22nd? Agreed it is probably an issue of libpq.dll, especially since I cannot replicate it on Linux. I'll update my libpq.dll (somehow) and try to replicate with my test program later this weekend and follow up on this issue. Thank you for responding and taking care to ensure the error handling story is good! :) |
Beamed commentedAug 23, 2018
•
edited
Setup
Have a Postgres instance available to use.
Versions
Feature Flags
Problem Description
When attempting to run an insert, the program fails (crashes without panicking or runtime errors). See below output as an example. An error should definitely be returned by the Result type, rather than perform a hard crash immediately.
What are you trying to accomplish?
Inserting a row into the database and getting meaningful error handling.
What is the expected output?
Error: Unable to perform insert into database(or some message)
Hello world!
What is the actual output?
error: process didn't exit successfully:
target\debug\DieselTest.exe(exit code: 3221225477)Are you seeing any additional errors?
error: process didn't exit successfully:
target\debug\DieselTest.exe(exit code: 3221225477)Steps to reproduce
Run the attached code with the "author" field in SQL set as a BIT instead of a BOOLEAN for a postgres backend.
main.zip
Checklist
closed if this is not the case)