Skip to content

Try to get firebird working on linux x32 CI #16113

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

Closed
wants to merge 11 commits into from

Conversation

nielsdos
Copy link
Member

@nielsdos nielsdos commented Sep 28, 2024

I'll clean up the history upon merging.

@nielsdos
Copy link
Member Author

@SakiTakamachi I'm trying to get 32-bit Linux CI to run Firebird. I added a service container and the necessary configuration, but the tests fail with Uncaught PDOException: SQLSTATE[HY000] [335544721] Unable to complete network request to host "localhost", so it seems that the test suite cannot connect to the server in the service container. Do you have any idea why?

@cmb69
Copy link
Member

cmb69 commented Sep 28, 2024

Maybe @KentarouTakeda can help?

@@ -146,6 +146,10 @@ jobs:
MYSQL_TEST_HOST: mysql
PDO_MYSQL_TEST_DSN: mysql:host=mysql;dbname=test
PDO_MYSQL_TEST_HOST: mysql
PDO_FIREBIRD_TEST_DATABASE: test.fdb
PDO_FIREBIRD_TEST_DSN: firebird:dbname=localhost:test.fdb
Copy link
Member

@SakiTakamachi SakiTakamachi Sep 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nielsdos
maybe

Suggested change
PDO_FIREBIRD_TEST_DSN: firebird:dbname=localhost:test.fdb
PDO_FIREBIRD_TEST_DSN: firebird:dbname=firebird:test.fdb

edit:
Looking at the mysql DSN above, it appears that the 32-bit CI specifies the service name rather than "localhost".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @SakiTakamachi is right. It's because of this line.

container:
image: ubuntu:20.04

  • x64: Tests are run directly on the host specified in runs-on
  • x32: A ubuntu:20.04 container is created inside the runs-on host, and tests are run inside it.

I tried to run x32 tests directly in the runs-on container, but it seems very difficult.

So it seems best to fix it the way Saki says. In that case, please note that actions/test-linux and x64 tests will also need some adjustments.

Copy link
Contributor

@KentarouTakeda KentarouTakeda Sep 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the tests passed in my fork.

However, some tests failed because they were written to reference ::1. I don't know how to fix these yet. I created a pull request to fix this: #16115

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good finds! I missed this nuance completely, I'll import your commit. Thanks a lot @KentarouTakeda and @SakiTakamachi

SakiTakamachi
SakiTakamachi previously approved these changes Sep 29, 2024
Copy link
Member

@SakiTakamachi SakiTakamachi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@SakiTakamachi SakiTakamachi dismissed their stale review September 29, 2024 10:43

Ah, sorry, I mistook it for another PR.

@nielsdos
Copy link
Member Author

All but two tests succeeded:

  • ext/pdo_firebird/tests/bug_15604.phpt fails because of another datatype being returned; may be related to a different version of firebird being used? Also I find the test name strange It is not possible to pass a NULL value as an input parameter if the field is marked as NOT NULL. If it's "NOT NULL", why should a "NULL" value be allowed?
  • ext/pdo_firebird/tests/bug_76448.phpt fails due to a mutex handling bug, I'll try to get a 32-bit ZTS build going to check what's going on.

@SakiTakamachi
Copy link
Member

@nielsdos

Regarding the first test:

First, the data type is different because it's probably a bigint type.

Since can't represent a 64 bit number in 32 bits, it will probably be a character.

Also, null is passed to the not null column, but in this test, a sequence is prepared for when null is passed to the id, so no error occurs and the id is completed.

The same is true for mysql's autoincrement, but there is a function that automatically completes by passing null to a not null column, so it is not necessarily impossible to pass null to a not null column.

@nielsdos
Copy link
Member Author

@SakiTakamachi I see, thanks for clarifying and I'll also change the test code to use "int" instead of "bigint".

@cmb69
Copy link
Member

cmb69 commented Oct 7, 2024

  • ext/pdo_firebird/tests/bug_76448.phpt fails due to a mutex handling bug, I'll try to get a 32-bit ZTS build going to check what's going on.

I can basically reproduce this on Windows x86 ZTS. After a minute, the test times out, reporting:

Warning: stream_socket_accept(): Accept failed: Ein Verbindungsversuch ist fehlgeschlagen, da die Gegenstelle nach einer bestimmten Zeitspanne nicht richtig reagiert hat, oder die hergestellte Verbindung war fehlerhaft, da der verbundene Host nicht reagiert hat in C:\php-sdk\phpdev\vs17\x86\php-src\ext\pdo_firebird\tests\payload_server.php on line 18

Termsig=-1073741819

The warning is due to WSAETIMEDOUT. The termsig is access violation.

I'll look into this.

Oh, actually, the test apparently always fails for me (x64, NTS, too).

@cmb69
Copy link
Member

cmb69 commented Dec 1, 2024

Oh, actually, the test apparently always fails for me (x64, NTS, too).

Well, should not build against v4 and run against v3.

Anyhow, it looks like the test does not test what it is supposed to, as of PHP 8.4 or when pdo_firebird is built against the v4 API. While it reaches

if (!isc_version(&H->db, php_firebird_info_cb, (void*)tmp)) {

the callback is never called (albeit the test might succeed):

/* callback to used to report database server info */
static void php_firebird_info_cb(void *arg, char const *s) /* {{{ */
{
if (arg) {
if (*(char*)arg) { /* second call */
strlcat(arg, " ", INFO_BUF_LEN);
}
strlcat(arg, s, INFO_BUF_LEN);
}
}
/* }}} */

So the test is badly written, since it should not succeed if it doesn't test what it is supposed to test, and it should be more malleable (like the new MySQL Fake Server). but given that the documentation about the Firebird wire protocol is apparently sparse, one would need to read the implementation, sniff the network and what not. Especially for this test it might not be worth the trouble (the bug was about using strcat() instead of strlcat()). Maybe we should just drop/skip this test case.

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
@nielsdos
Copy link
Member Author

nielsdos commented Dec 4, 2024

PR broke, it's stuck on "updating".

@nielsdos nielsdos closed this Dec 4, 2024
@nielsdos
Copy link
Member Author

nielsdos commented Dec 4, 2024

Replacement: #17045

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants