Skip to content
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

Could you help me? Emacs Bug: Invalid datatype (0x01) #9

Closed
gnusupport opened this issue Apr 27, 2019 · 8 comments
Closed

Could you help me? Emacs Bug: Invalid datatype (0x01) #9

gnusupport opened this issue Apr 27, 2019 · 8 comments
Labels

Comments

@gnusupport
Copy link

(defun rcd-sql (sql)
  (pq:query *rcd-pg* sql))

(rcd-sql "SELECT a.attname, pg_catalog.format_type(a.atttypid, a.atttypmod), (SELECT substring(pg_catalog.pg_get_expr(d.adbin, d.adrelid) for 128) FROM pg_catalog.pg_attrdef d WHERE d.adrelid = a.attrelid AND d.adnum = a.attnum AND a.atthasdef), a.attnotnull, a.attnum, (SELECT c.collname FROM pg_catalog.pg_collation c, pg_catalog.pg_type t WHERE c.oid = a.attcollation AND t.oid = a.atttypid AND a.attcollation <> t.typcollation) AS attcollation, a.attidentity, NULL AS indexdef, NULL AS attfdwoptions, a.attstorage, CASE WHEN a.attstattarget=-1 THEN NULL ELSE a.attstattarget END AS attstattarget, pg_catalog.col_description(a.attrelid, a.attnum) FROM pg_catalog.pg_attribute a WHERE a.attrelid = '33748' AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum")

(["tlds_id" "integer" "nextval('tlds_tlds_id_seq'::regclass)" "" 1 #<EMACS BUG: INVALID DATATYPE (0x01) Save your buffers immediately and please report this bug> "" #<EMACS BUG: INVALID DATATYPE (0x01) Save your buffers immediately and please report this bug> #<EMACS BUG: INVALID DATATYPE (0x01) Save your buffers immediately and please report this bug> "p" #<EMACS BUG: INVALID DATATYPE (0x01) Save your buffers immediately and please report this bug> "ID"] ["tlds_tld" "text" #<EMACS BUG: INVALID DATATYPE (0x01) Save your buffers immediately and please report this bug> "" 2 #<EMACS BUG: INVALID DATATYPE (0x01) Save your buffers immediately and please report this bug> "" #<EMACS BUG: INVALID DATATYPE (0x01) Save your buffers immediately and please report this bug> #<EMACS BUG: INVALID DATATYPE (0x01) Save your buffers immediately and please report this bug> "x" #<EMACS BUG: INVALID DATATYPE (0x01) Save your buffers immediately and please report this bug> "TLD"] ["tlds_nic" "integer" #<EMACS BUG: INVALID DATATYPE (0x01) Save your buffers immediately and please report this bug> #<EMACS BUG: INVALID DATATYPE (0x01) Save your buffers immediately and please report this bug> 3 #<EMACS BUG: INVALID DATATYPE (0x01) Save your buffers immediately and please report this bug> "" #<EMACS BUG: INVALID DATATYPE (0x01) Save your buffers immediately and please report this bug> #<EMACS BUG: INVALID DATATYPE (0x01) Save your buffers immediately and please report this bug> "p" #<EMACS BUG: INVALID DATATYPE (0x01) Save your buffers immediately and please report this bug> "NIC Company"] ["tlds_description" "text" #<EMACS BUG: INVALID DATATYPE (0x01) Save your buffers immediately and please report this bug> #<EMACS BUG: INVALID DATATYPE (0x01) Save your buffers immediately and please report this bug> 4 #<EMACS BUG: INVALID DATATYPE (0x01) Save your buffers immediately and please report this bug> "" #<EMACS BUG: INVALID DATATYPE (0x01) Save your buffers immediately and please report this bug> #<EMACS BUG: INVALID DATATYPE (0x01) Save your buffers immediately and please report this bug> "x" #<EMACS BUG: INVALID DATATYPE (0x01) Save your buffers immediately and please report this bug> "Description"] . #<EMACS BUG: INVALID DATATYPE (0x01) Save your buffers immediately and please report this bug>)

     attname      | format_type |               substring               | attnotnull | attnum | attcollation | attidentity | indexdef | attfdwoptions | attstorage | attstattarget | col_description 
------------------+-------------+---------------------------------------+------------+--------+--------------+-------------+----------+---------------+------------+---------------+-----------------
 tlds_id          | integer     | nextval('tlds_tlds_id_seq'::regclass) | t          |      1 |              |             |          |               | p          |               | ID
 tlds_tld         | text        |                                       | t          |      2 |              |             |          |               | x          |               | TLD
 tlds_nic         | integer     |                                       | f          |      3 |              |             |          |               | p          |               | NIC Company
 tlds_description | text        |                                       | f          |      4 |              |             |          |               | x          |               | Description
(4 rows)


Basically, I have git upgraded to newest development Emacs version. Recompiled your module which worked so well over last months. And now I cannot run it, as I am crashing whole emacs by the above SQL query.

Do you know maybe, do you have some clue, how to avoid the crash?

@gnusupport
Copy link
Author

Now I find that problem appears even with "SELECT 1".

There is always same bug coming up. Do you have idea maybe?

@anse1
Copy link
Owner

anse1 commented Apr 28, 2019

Thanks for the report, I can reproduce it with the latest emacs master.
I don't see anything suspicious in emacs' change log wrt. the module interface at first glance.
Running git-bisect on emacs now to find out more.

@gnusupport
Copy link
Author

Thank you much.

Latest commit that works is a1c53d4294550380de76d6a6c4e29e9e8f6f9133
Date: Tue Apr 16 14:33:24 2019 -0700

One before that one that worked is e40f39bec34feeec893fb66625f19cc4663cd217
Date: Sun Apr 14 09:27:50 2019 -0600

somewhere in the middle from April 16th to near the present time, Emacs is segfault on loading of the module.

I am trying ti find commit closer to the present time that works well.

@anse1
Copy link
Owner

anse1 commented Apr 28, 2019 via email

@gnusupport
Copy link
Author

From gnu-emacs-help mailing list, as suggested by Philipp Stephani, I did following if this can help, and it was done with the latest commit:

emacs --module-assertion
Emacs module assertion: Emacs value not found in 11 values of 1 environments
Fatal error 6: Aborted
Backtrace:
emacs[0x5039f2]
emacs[0x4176a5]
emacs[0x41788b]
emacs[0x418223]
emacs[0x58cb31]
emacs[0x58ef72]
/home/admin/Programming/git/emacs-libpq/pq.so(+0x14ed)[0x7fd9e35444ed]
Aborted

@phst
Copy link

phst commented Apr 28, 2019

The issue is most likely that https://github.com/anse1/emacs-libpq/blob/master/pq.c#L325-L326 puts local references into static variables, which is not allowed, see https://phst.eu/emacs-modules#value-lifetime.

@anse1
Copy link
Owner

anse1 commented Apr 28, 2019 via email

@anse1 anse1 added the bug label Apr 28, 2019
@gnusupport
Copy link
Author

I confirm, it works well now again, just as it was. Thank you much for efforts. It means!

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

No branches or pull requests

3 participants