drogonframework / drogonframework/drogon

drogon_ctl create model ./models -o ./models -f givs segmentation fauld

Open
#2,327 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
14.3k
Forks
1.4k
Avg merge
1d 12h
Merged PRs (30d)
15

Description

**Describe the bug**
When running drogon_ctl create model to generate model classes from an existing PostgreSQL database table, the command crashes with a segmentation fault.

### To Reproduce
**Steps to reproduce the behavior:**

1. Prepare a config.json file with PostgreSQL connection info, including "db_clients" configuration.
3. Ensure the target database and table (e.g., book) exist in PostgreSQL.
4. Run the command:

`drogon_ctl create model ./models -o ./models --table=book -f -c config.json`
The command crashes immediately with:

`Segmentation fault (core dumped)`

**Expected behavior**
The model class files for the specified table should be generated without crashing.

**Screenshots**
N/A

Desktop (please complete the following information):
OS: Ubuntu 24.04

Drogon version: 1.9.10

Compiler: GCC 14.2

**Additional context**

- Database: PostgreSQL 16.9
-
- config.json contains a valid "db_clients" entry with correct host, port, dbname, user, and password fields.
-
- The table book exists in the public schema.
-
- Tried both JSON and YAML config files with the same issue.
-
- The segfault prevents any further debug information output.
-
- The issue occurs even with minimal config and a single table.

Please let me know if you need the config file or logs to help reproduce.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.